Il giorno Thu, 31 Jan 2008 15:38:58 +0200
Yavor Doganov <[EMAIL PROTECTED]> ha scritto:

> On Thu, Jan 31, 2008 at 12:33:32PM +0100, David Paleino wrote:
> > Have you got any idea why configure fails? 
> 
> Try looking at config.log.
> It doesn't fail for me (although I didn't try in a chroot).

Here's what happens (relevant part): <http://pastebin.com/f3b94f132>

Here's the relevant bit of the paste:

configure:20303: checking for gsl_multifit_fdfsolver_iterate in -lgsl
configure:20338: i486-linux-gnu-g++ -o conftest  -O2 -g -Wall -Wl,--as-needed 
conftest.cpp -lgsl -lgslcblas -lz -lpthread -ldl -lm >&5
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libgsl.so: undefined 
reference to `cblas_ctrmv'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libgsl.so: undefined 
reference to `cblas_zswap'
...
collect2: ld returned 1 exit status
configure:20344: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "odin"
| #define VERSION "1.6.5"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char gsl_multifit_fdfsolver_iterate ();
| int
| main ()
| {
| return gsl_multifit_fdfsolver_iterate ();
|   ;
|   return 0;
| }
configure:20362: result: no
...

It seems like the -lgslcblas flag doesn't get counted :s

After some tests, here's the guilty: -Wl,--as-needed.

(foo.cc is the same snippet of code in config.log)

$ g++ foo.cc -Wall -Wl,-z,defs -lgsl -lgslcblas &>/dev/null
$ echo $?
0
$ g++ foo.cc -Wall -Wl,-z,defs -Wl,--as-needed -lgsl -lgslcblas &>/dev/null
$ echo $?
1
$ g++ foo.cc -Wall -Wl,-z,defs -Wl,--as-needed -lgsl -lgslcblas &>/dev/null
$ echo $?
0
$

This is non-sense to me. Does the position of compiler/linker flags have any
importance?

Kindly,
David

P.S.: thanks for helping me in spotting the problem! :)

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174

Attachment: signature.asc
Description: PGP signature

Reply via email to