[petsc-dev] Need -lfl in c2html

Jed Brown jed at jedbrown.org
Sun Feb 23 11:53:56 CST 2014


Barry Smith <bsmith at mcs.anl.gov> writes:

> On Feb 23, 2014, at 12:47 AM, Jed Brown <jed at jedbrown.org> wrote:
>
>> My configure on 'master' fails with the following.  I need to link with
>> -lfl to get the symbol yywrap.  I don't know why we haven't been
>> encountering this before.
>
>    There was one user report of this a few weeks, but in all the
>    previous years I don’t recall this ever being an issue.
>
>    I guess you better update maint.

Testing on petsc-mini.mcs, c2html's configure automatically finds -ll
(/usr/lib/libl.a) and there is no -lfl.  We could check for existence of
-lfl and pass in LEXLIB=-lfl if it works, but that could find a libfl
floating around from a different lex implementation.  This is really
something c2html's configure should be working out, and when I look, it
really tries (this is why we haven't seen the issue before):

configure:1829: checking for yywrap in -lfl
configure:1856: gcc -o conftest -g -O2   conftest.c -lfl   >&5
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
configure:1859: $? = 1
configure: failed program was:
#line 1837 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char yywrap ();
int main ()
{
  yywrap ();
  return 0;
}
configure:1876: result: no


Huh, what could be happening here:

$ nm -D /usr/lib/libfl.so | grep yy
                 U yylex
0000000000000740 T yywrap


libfl.so defines main, which calls yylex().  We used to have a static
library (libfl.a) in which case linking yywrap did not depend on a
function called yylex (which is supposed to be defined outside
libfl.so).  This causes the normal AC_CHECK_LIB(fl, yylex) to fail.

Now it doesn't delight me that c2html's configure script has been edited
From the one generated by autoconf.  I'll check with flex upstream to
figure out what they intend to be used as a configure test now.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140223/e6c2f211/attachment.sig>


More information about the petsc-dev mailing list