View Issue Details

IDProjectCategoryView StatusLast Update
0001590GNUnetbuild processpublic2010-08-06 21:52
Reporterc89_nerd Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionno change required 
Summary0001590: configure.ac not detecting EXTRACTOR_plugin_add_defaults
Description$ ./configure --with-extractor=/usr/local 2>&1|less
checking for extractor.h... yes
checking for EXTRACTOR_plugin_add_defaults in -lextractor... no
configure: error: GNUnet requires libextractor
$ nm /usr/local/lib/libextractor.a|grep -e plugin_add_defaults
000007fa T EXTRACTOR_plugin_add_defaults[... !!! LIES !!! ...]
$ cp configure.ac configure.ac.orig
$ vi configure.ac
$ diff -u configure.ac.orig configure.ac
--- configure.ac.orig Tue Jul 27 19:37:09 2010
+++ configure.ac Tue Jul 27 19:39:15 2010
@@ -211,23 +211,20 @@
         ;;
       yes)
         AC_CHECK_HEADERS(extractor.h,
- AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
- extractor=1))
+ extractor=1)
         ;;
       *)
         LDFLAGS="-L$with_extractor/lib $LDFLAGS"
         CPPFLAGS="-I$with_extractor/include $CPPFLAGS"
         AC_CHECK_HEADERS(extractor.h,
- AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
             EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH"
- extractor=1))
+ extractor=1)
         ;;
     esac
    ],
    [AC_MSG_RESULT([--with-extractor not specified])
     AC_CHECK_HEADERS(extractor.h,
- AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
- extractor=1))])
+ extractor=1)])
 if test "$extractor" != 1
 then
  AC_MSG_ERROR([GNUnet requires libextractor])
$ autoconf
[... aclocal.m4:16 version warning blah blah ...]
$ ./configure --with-extractor=/usr/local 2>&1|less
[... much better ...]
[... other unrelated issues ...]
TagsNo tags attached.
Attached Files
config.log (83,302 bytes)

Activities

Christian Grothoff

2010-07-28 22:15

manager   ~0004090

Not sure about this. You're simply disabling the check and are likely to get other issues later. Could you have *another* version of libextractor.so on your system without the symbol? I find that very likely.

If you run the "old" configure script (without your changes) and attach config.log, I might be able to get a better grip on what's going on.

c89_nerd

2010-08-03 04:05

reporter   ~0004101

In summary I removed all references to libextractor in the /usr/local/lib directory and re-(make install)'ed gnunet and extractor from scratch.
Same problem, so manually tried to simulate what I believed the configure script was doing, and I was able to get it to link. Don't know how to understand the configure script however...

below are my exact steps:

$ rm -R gnunet-0.9.0pre1
$ tar -x -f gnunet-0.9.0pre1.tar
$ bunzip2 libextractor-0.6.0.tar.bz2
$ tar -x -f libextractor-0.6.0.tar
$ ls /usr/lib/libext*
ls: /usr/lib/libext*: No such file or directory
$ ls /usr/local/lib/libext*
[... many many many ...]
$ rm -R /usr/local/lib/libext*
$ cd libextractor-0.6.0
$ env LDFLAGS=${LDFLAGS}" -lSTUPIDshm_openEMULATOR -L/usr/local/lib" CFLAGS=${CFLAGS}" -I /usr/local/include" ./configure --with-libiconv-prefix=/usr/local --with-ltdl-include=/usr/local/include --with-ltdl-lib=/usr/local/lib 2>&1|less
[...]
$ make 2>&1|less
[...]
$ make install 2>&1|less
[...]
$ cd ..
$ rm -R libextractor-0.6.0
$ bzip2 libextractor-0.6.0.tar
$ cd gnunet-0.9.0pre1
$ ./configure --with-extractor=/usr/local 2>&1|less
[... same thing ...]
checking for libextractor... /usr/local
checking extractor.h usability... yes
checking extractor.h presence... yes
checking for extractor.h... yes
checking for EXTRACTOR_plugin_add_defaults in -lextractor... no
configure: error: GNUnet requires libextractor
$ nm /usr/local/lib/libextractor.a|grep -e EXTRACTOR_plugin_add_defaults
000007fa T EXTRACTOR_plugin_add_defaults
$ less config.log
[...]
#define LIBCURL_PROTOCOL_DICT 1
#define LIBCURL_PROTOCOL_TFTP 1
#define HAVE_LIBKVM 1
#define HAVE_EXTRACTOR_H 1

configure: exit 1
[... that's it; it just dies for seemingly no reason ...]
$ grep -n -e EXTRACTOR ./configure
19642: [...]
[...]
$ vi ./configure
[... lets see what configure is doing ...]
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

[...]
main ()
{
return EXTRACTOR_plugin_add_defaults ();
  ;
  return 0;
}
_ACEOF
[... ohhhh neat I just learned about the << operator ...]
if ac_fn_c_try_link "$LINENO"; then ;
  ac_cv_lib_extractor_EXTRACTOR_plugin_add_defaults=yes
else
  ac_cv_lib_extractor_EXTRACTOR_plugin_add_defaults=no
fi
[... so I will assume that ac_fn_c_try_link "$LINNO" actually tries to compile conftest.$ac_ext ...]
[... time to try my own version then ...]
$ cat - << EOF > hi.c
char EXTRACTOR_plugin_add_defaults();
int printf();
int main(int argc, char **argv) {
  printf("HI!\n");
  return EXTRACTOR_plugin_add_defaults();
}
EOF
$ gcc -c hi.c
$ gcc -L/usr/local/lib hi.o -l extractor 2>&1|less
[...]
/usr/local/lib/libextractor.a(libextractor_la-extractor.o)(.text+0x210): In function `get_path_from_PATH':
: warning: strcat() is almost always misused, please use strlcat()
[... blah ...]
/usr/local/lib/libextractor.a(libextractor_la-extractor.o)(.text+0x93d): In function `get_symbol_with_prefix':
: undefined reference to `lt_dlsym'
[... same for `lt_dlerror' `lt_dladvise_init' [...] `shm_open' `shm_unlink' [...] ...]
/usr/local/lib/libextractor.a(libextractor_la-extractor.o)(.text+0x2d7b): In function `EXTRACTOR_ltdl_fini':
: undefined reference to `lt_dlexit'
collect2: ld returned 1 exit status

$ gcc -L/usr/local/lib hi.o -l extractor -l ltdl -l STUPIDshm_openEMULATOR -l bz2 -l intl 2>&1|less
[... stuff about inflateInit2_ ...[[
$ find /usr/local/lib -exec grep -q -e inflateInit2 {} \; -print
[... curl or extractor ...]
[... hmmmmm I wonder... ...]
$ gcc -L/usr/local/lib hi.o -l extractor -l ltdl -l STUPIDshm_openEMULATOR -l bz2 -l intl -l curl 2>&1|less
[... woot! just 3 frivolus warnings ...]
$ ./a.out && echo "OH YEAH!"
HI!

no crash and burn! so I guess it worked! with the exception of libextractor being confused... I supose now it would help if I knew even the tiniest bit about how EXTRACTOR_plugin_add_defaults works.

as for why the configure script does not work I believe it would require knowledge of the ac_fn_c_try_link shell function.

$ grep -n -e ac_fn_c_try_link configure|head
1960: [...]
[...]
$ vi configure
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
[... well the description makes some sense (except LINENO) ...]
[... ?!?! ...]
[... it is so obfuscated I am almost totally at a loss to explain the function ...]
[... lineno's stack's ??? ...]
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
[... ??? ...]

Well I'm done!
At this point I don't know what I'm doing.

HELP MEEEEEEEeeeeeeeeeeee!!!!!!!.!!!!!..!!!...!!.....!....... ... .

c89_nerd

2010-08-03 04:31

reporter   ~0004102

>> [... that's it; it just dies for seemingly no reason ...]

sigh... now I see the same gcc output with undefined references in the config.log. Just have to look up a little bit from the end... sigh...

so it should be a matter of turning:
configure:19724: gcc -o conftest -fno-strict-aliasing -Wall -g -O2 -I/usr/local/include -L/usr/local/lib conftest.c -lextractor -lkvm -lm >&5
into
configure:19724: gcc -o conftest -fno-strict-aliasing -Wall -g -O2 -I/usr/local/include -L/usr/local/lib conftest.c -lextractor -lkvm -lm -l ltdl -l bz2 -l intl -l curl >&5

and adding a check for the shm_open shm_unlink functions...

or now that I know how to use the config.log file I could just env LIBS=${LIBS}" -lltdl -lbz2 -lintl -lcurl -lSTUPIDshm_openEMULATOR" ./configure

thanks!

$ env LIBS=${LIBS}" -lltdl -lbz2 -lintl -lcurl -lSTUPIDshm_openEMULATOR" LDFLAGS=${LDFLAGS}" -L/usr/local/lib" ./configure --with-extractor=/usr/local 2>&1|less
[...]
checking for EXTRACTOR_plugin_add_defaults in -lextractor... yes
[... sigh... nevermind... problem solved ...]

You can delete this bug/Status: closed.
Sorry for wasting your time.

Christian Grothoff

2010-08-03 16:15

manager   ~0004103

Hmm. That's strange. LE links against ltdl, bz2, intl, so those should be automatically added by your linker as dependencies of LE, we should not have to add them again.

Also, how did you get LE to compile if you don't have shm_open/shm_unlink? Maybe that's where another key problem here is (and likely one to fix first?).

Matthias Wachs

2010-08-05 13:57

reporter   ~0004105

Last edited: 2010-08-05 13:58

Had the same issue on a clean, just installed Ubuntu 10.4 TLS
I built libextractor from svn.

Gnunet configure told me:

checking for extractor.h... yes
checking for EXTRACTOR_plugin_add_defaults in -lextractor... no
configure: error: GNUnet requires libextractor

Please be sure that all libextractor packages are uninstalled:

- libextractor-plugins
- libextractor-dev
- libextractor1c2a

The last package was not completely removed on my system, that caused the error.
Now everything works fine

Christian Grothoff

2010-08-06 21:52

manager   ~0004109

Ok, I'll close this one as "user error" then ;-).

Issue History

Date Modified Username Field Change
2010-07-27 23:55 c89_nerd New Issue
2010-07-28 22:15 Christian Grothoff Note Added: 0004090
2010-07-28 22:16 Christian Grothoff Status new => feedback
2010-08-03 04:05 c89_nerd Note Added: 0004101
2010-08-03 04:08 c89_nerd File Added: config.log
2010-08-03 04:31 c89_nerd Note Added: 0004102
2010-08-03 16:15 Christian Grothoff Note Added: 0004103
2010-08-05 13:57 Matthias Wachs Note Added: 0004105
2010-08-05 13:58 Matthias Wachs Note Edited: 0004105
2010-08-06 21:52 Christian Grothoff Note Added: 0004109
2010-08-06 21:52 Christian Grothoff Assigned To => Christian Grothoff
2010-08-06 21:52 Christian Grothoff Reproducibility always => sometimes
2010-08-06 21:52 Christian Grothoff Status feedback => closed
2010-08-06 21:52 Christian Grothoff Resolution open => no change required
2010-08-06 21:52 Christian Grothoff Description Updated