?

Log in

No account? Create an account

FIXED (was: Why isn't this working?)

« previous entry | next entry »
Sep. 14th, 2011 | 03:24 am
mood: sleepysleepy

EDIT: fixed, see below.

Maybe it's just too late early, but does anyone have ANY idea why this isn't working? I'm attempting to compile yafu on Cygwin, BTW, in case it's not obvious:

$ make x86 GMPECM=1 NFS=1
gcc -v -m32 -march=core2 -mtune=core2 -DHAVE_GMP_ECM -DHAVE_GMP -DUSE_NFS -DHAVE_GMP -DHAVE_GMP_ECM -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I../gmp/include -I../gmp-ecm/include -I../gmp/include -I../gmp-ecm/include -m32 arith/tfm/fp_mul_comba.o arith/tfm/fp_mul_comba_small_set.o arith/tfm/fp_sqr_comba.o arith/tfm/fp_sqr_comba_small_set.o arith/tfm/fp_sqr_comba_generic.o arith/tfm/fp_2expt.o arith/tfm/fp_cmp_mag.o arith/tfm/fp_mont_small.o arith/tfm/fp_montgomery_calc_normalization.o arith/tfm/fp_montgomery_reduce.o arith/tfm/fp_montgomery_setup.o arith/tfm/fp_mul_2.o arith/tfm/s_fp_sub.o factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos_matmul0.o factor/qs/msieve/lanczos_matmul1.o factor/qs/msieve/lanczos_matmul2.o factor/qs/msieve/lanczos_pre.o factor/qs/msieve/sqrt.o factor/qs/msieve/savefile.o factor/qs/msieve/gf2.o top/driver.o top/utils.o top/stack.o top/calc.o top/test.o factor/factor_common.o factor/rho.o factor/squfof.o factor/trialdiv.o factor/tune.o factor/qs/filter.o factor/qs/tdiv.o factor/qs/tdiv_small.o factor/qs/tdiv_med.o factor/qs/tdiv_large.o factor/qs/tdiv_scan.o factor/qs/sieve.o factor/qs/new_poly.o factor/qs/poly_roots.o factor/qs/update_poly_roots.o factor/qs/siqs_test.o factor/qs/siqs_aux.o factor/qs/smallmpqs.o factor/qs/SIQS.o factor/gmp-ecm/ecm.o factor/gmp-ecm/pp1.o factor/gmp-ecm/pm1.o factor/nfs/nfs.o arith/arith0.o arith/arith1.o arith/arith2.o arith/arith3.o top/eratosthenes/count.o top/eratosthenes/offsets.o top/eratosthenes/primes.o top/eratosthenes/roots.o top/eratosthenes/linesieve.o top/eratosthenes/soe.o top/eratosthenes/tiny.o top/eratosthenes/worker.o top/eratosthenes/wrapper.o -o yafu -L../gmp/lib/linux -L../gmp-ecm/lib/linux -lecm -lgmp -L/usr/local/lib -L../msieve/lib/linux -L../msieve -lz -L../gmp/lib/linux -L../gmp-ecm/lib/linux -lecm -lmsieve -lgmp -lm -lpthread
Using built-in specs.
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.3.4-4/gcc4-4.3.4-4/src/gcc-4.3.4/configure --srcdir=/gnu/gcc/releases/respins/4.3.4-4/gcc4-4.3.4-4/src/gcc-4.3.4 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man -C --datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --with-slibdir=/usr/bin --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.3.4 20090804 (release) 1 (GCC)
COMPILER_PATH=/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ LIBRARY_PATH=/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-march=core2' '-mtune=core2' '-DHAVE_GMP_ECM' '-DHAVE_GMP' '-DUSE_NFS' '-DHAVE_GMP' '-DHAVE_GMP_ECM' '-O3' '-fomit-frame-pointer' '-Wall' '-I.' '-Iinclude' '-I../gmp/include' '-I../gmp-ecm/include' '-I../gmp/include' '-I../gmp-ecm/include' '-m32' '-o' 'yafu.exe' '-L../gmp/lib/linux' '-L../gmp-ecm/lib/linux' '-L/usr/local/lib' '-L../msieve/lib/linux' '-L../msieve' '-L../gmp/lib/linux' '-L../gmp-ecm/lib/linux'
/usr/lib/gcc/i686-pc-cygwin/4.3.4/collect2.exe -tsaware --wrap _Znwj --wrap _Znaj --wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-search-prefix=cyg -u ___register_frame_info -u ___deregister_frame_info -o yafu.exe /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../crt0.o /usr/lib/gcc/i686-pc-cygwin/4.3.4/crtbegin.o -L../gmp/lib/linux -L../gmp-ecm/lib/linux -L/usr/local/lib -L../msieve/lib/linux -L../msieve -L../gmp/lib/linux -L../gmp-ecm/lib/linux -L/usr/lib/gcc/i686-pc-cygwin/4.3.4 -L/usr/lib/gcc/i686-pc-cygwin/4.3.4 -L/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../.. arith/tfm/fp_mul_comba.o arith/tfm/fp_mul_comba_small_set.o arith/tfm/fp_sqr_comba.o arith/tfm/fp_sqr_comba_small_set.o arith/tfm/fp_sqr_comba_generic.o arith/tfm/fp_2expt.o arith/tfm/fp_cmp_mag.o arith/tfm/fp_mont_small.o arith/tfm/fp_montgomery_calc_normalization.o arith/tfm/fp_montgomery_reduce.o arith/tfm/fp_montgomery_setup.o arith/tfm/fp_mul_2.o arith/tfm/s_fp_sub.o factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos_matmul0.o factor/qs/msieve/lanczos_matmul1.o factor/qs/msieve/lanczos_matmul2.o factor/qs/msieve/lanczos_pre.o factor/qs/msieve/sqrt.o factor/qs/msieve/savefile.o factor/qs/msieve/gf2.o top/driver.o top/utils.o top/stack.o top/calc.o top/test.o factor/factor_common.o factor/rho.o factor/squfof.o factor/trialdiv.o factor/tune.o factor/qs/filter.o factor/qs/tdiv.o factor/qs/tdiv_small.o factor/qs/tdiv_med.o factor/qs/tdiv_large.o factor/qs/tdiv_scan.o factor/qs/sieve.o factor/qs/new_poly.o factor/qs/poly_roots.o factor/qs/update_poly_roots.o factor/qs/siqs_test.o factor/qs/siqs_aux.o factor/qs/smallmpqs.o factor/qs/SIQS.o factor/gmp-ecm/ecm.o factor/gmp-ecm/pp1.o factor/gmp-ecm/pm1.o factor/nfs/nfs.o arith/arith0.o arith/arith1.o arith/arith2.o arith/arith3.o top/eratosthenes/count.o top/eratosthenes/offsets.o top/eratosthenes/primes.o top/eratosthenes/roots.o top/eratosthenes/linesieve.o top/eratosthenes/soe.o top/eratosthenes/tiny.o top/eratosthenes/worker.o top/eratosthenes/wrapper.o -lecm -lgmp -lz -lecm -lmsieve -lgmp -lm -lpthread -lgcc_s -lgcc -lgcc_eh -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc_s -lgcc -lgcc_eh /usr/lib/gcc/i686-pc-cygwin/4.3.4/crtend.o
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x3b): undefined reference to `_gzputs'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x104): undefined reference to `_gzclose'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x1c5): undefined reference to `_gzopen'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x2c8): undefined reference to `_gzopen'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x301): undefined reference to `_gzopen'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x4b3): undefined reference to `_gzputs'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x11): undefined reference to `_gzrewind'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0x8b): undefined reference to `_gzgets'
../msieve/libmsieve.a(savefile.o):savefile.c:(.text+0xe7): undefined reference to `_gzeof'
collect2: ld returned 1 exit status
make: *** [x86] Error 1

This seems obvious at first glance: symbols from libz aren't being found. But libz IS being linked in (-lz), and is indeed present in /usr/lib (which, just for the sake of completeness, is indeed present in the linker's search path), so WHY the heck isn't the linker finding it and using it?

Little help?

EDIT: apparently, the order on which libraries are given on the command line matters, so since -lz appeared before -lmsieve, everything blew up. Fixing this in the Makefile caused the problem to go away; I'll be leaving this post up in case anyone runs into similar issues.

Link | Leave a comment | Share

Comments {0}