[ntl] ld error during "make check"
sana qadir
q57sana at yahoo.com
Wed Jun 8 23:48:23 CDT 2011
Hello,
I am installing NTL on debian. The installation is ok until the "make check" command:
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo ./configure PREFIX=/usr/local/
writing makefile
writing ../include/NTL/config.h
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo ./configure PREFIX=/usr/local/lib
writing makefile
writing ../include/NTL/config.h
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo ./configure NTL_GMP_LIP=on GMP_PREFIX=/usr
writing makefile
writing ../include/NTL/config.h
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo ./configure NTL_GF2X_LIB=on GF2X_PREFIX=/usr/local
writing makefile
writing ../include/NTL/config.h
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo make
make: `all' is up to date.
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo make check
sh RemoveProg QuickTest BerlekampTest CanZassTest ZZXFacTest MoreFacTest LLLTest BitMatTest MatrixTest CharPolyTest RRTest QuadTest GF2XTest GF2EXTest subset ZZ_pEXTest lzz_pEXTest
make QuickTest
make[1]: Entering directory `/usr/lib/ntl-5.5.2/src'
g++ -I../include -I. -O2 -o QuickTest QuickTest.c ntl.a -L/usr/local/lib -lgf2x -lm #LSTAT
/tmp/ccSg27mb.o: In function `main':
QuickTest.c:(.text+0x811): undefined reference to `_ntl_ziszero'
QuickTest.c:(.text+0x9df): undefined reference to `_ntl_zfree'
QuickTest.c:(.text+0xa35): undefined reference to `_ntl_zfree'
QuickTest.c:(.text+0xbeb): undefined reference to `_ntl_zmul'
QuickTest.c:(.text+0xc18): undefined reference to `_ntl_zmul'
QuickTest.c:(.text+0xca3): undefined reference to `_ntl_zmul'
QuickTest.c:(.text+0xcd0): undefined reference to `_ntl_zmul'
QuickTest.c:(.text+0xd5c): undefined reference to `_ntl_zmod'
QuickTest.c:(.text+0xd82): undefined reference to `_ntl_zmod'
QuickTest.c:(.text+0xe07): undefined reference to `_ntl_zmod'
QuickTest.c:(.text+0xe2a): undefined reference to `_ntl_zmod'
QuickTest.c:(.text+0xed8): undefined reference to `_ntl_ziszero'
QuickTest.c:(.text+0xee7): undefined reference to `_ntl_zone'
QuickTest.c:(.text+0xefd): undefined reference to `_ntl_zinvmod'
QuickTest.c:(.text+0xf22): undefined reference to `_ntl_zinvmod'
QuickTest.c:(.text+0xfa7): undefined reference to `_ntl_zinvmod'
QuickTest.c:(.text+0xfd2): undefined reference to `_ntl_zinvmod'
QuickTest.c:(.text+0x1288): undefined reference to `_ntl_zfree'
QuickTest.c:(.text+0x1296): undefined reference to `_ntl_zfree'
QuickTest.c:(.text+0x129e): undefined reference to `_ntl_zfree'
QuickTest.c:(.text+0x12a9): undefined reference to `_ntl_zfree'
QuickTest.c:(.text+0x1300): undefined reference to `_ntl_zfree'
/tmp/ccSg27mb.o:QuickTest.c:(.text+0x130e): more undefined references to `_ntl_zfree' follow
ntl.a(lip.o): In function `redc':
lip.c:(.text+0xa45): undefined reference to `__gmpn_addmul_1'
lip.c:(.text+0xb22): undefined reference to `__gmpn_sub_n'
ntl.a(lip.o): In function `_ntl_gsmod':
lip.c:(.text+0xc04): undefined reference to `__gmpn_mod_1'
ntl.a(lip.o): In function `_ntl_gsqrts':
lip.c:(.text+0x11e4): undefined reference to `__gmpn_sqrtrem'
ntl.a(lip.o): In function `_ntl_gsmul':
lip.c:(.text+0x1600): undefined reference to `__gmpn_mul_1'
lip.c:(.text+0x1692): undefined reference to `__gmpn_lshift'
ntl.a(lip.o): In function `gmod_simple':
lip.c:(.text+0x1bcf): undefined reference to `__gmpn_tdiv_qr'
ntl.a(lip.o): In function `_ntl_grem_struct_eval':
lip.c:(.text+0x1cfb): undefined reference to `__gmpn_mod_1'
lip.c:(.text+0x1fc2): undefined reference to `__gmpn_mod_1'
lip.c:(.text+0x2162): undefined reference to `__gmpn_mod_1'
ntl.a(lip.o): In function `_ntl_gsqrt':
lip.c:(.text+0x2261): undefined reference to `__gmpn_sqrtrem'
ntl.a(lip.o): In function `_ntl_gmul':
lip.c:(.text+0x23cd): undefined reference to `__gmpn_mul'
lip.c:(.text+0x2424): undefined reference to `__gmpn_mul'
ntl.a(lip.o): In function `_ntl_gsubpos':
lip.c:(.text+0x3561): undefined reference to `__gmpn_sub_n'
ntl.a(lip.o): In function `_ntl_gsub':
lip.c:(.text+0x3979): undefined reference to `__gmpn_add_n'
lip.c:(.text+0x3a94): undefined reference to `__gmpn_sub_n'
lip.c:(.text+0x3af4): undefined reference to `__gmpn_sub_n'
ntl.a(lip.o): In function `_ntl_gadd':
lip.c:(.text+0x3d2e): undefined reference to `__gmpn_sub_n'
lip.c:(.text+0x3e95): undefined reference to `__gmpn_add_n'
lip.c:(.text+0x3fb1): undefined reference to `__gmpn_sub_n'
ntl.a(lip.o): In function `_ntl_gaorsmul_1':
lip.c:(.text+0x441e): undefined reference to `__gmpn_addmul_1'
lip.c:(.text+0x4457): undefined reference to `__gmpn_mul_1'
lip.c:(.text+0x455c): undefined reference to `__gmpn_submul_1'
lip.c:(.text+0x4630): undefined reference to `__gmpn_mul_1'
ntl.a(lip.o): In function `_ntl_gdiv':
lip.c:(.text+0x4b76): undefined reference to `__gmpn_tdiv_qr'
ntl.a(lip.o): In function `_ntl_gcrt_struct_eval':
lip.c:(.text+0x4e59): undefined reference to `__gmpn_addmul_1'
lip.c:(.text+0x50c9): undefined reference to `__gmpn_addmul_1'
ntl.a(lip.o): In function `_ntl_ginv':
lip.c:(.text+0x53c8): undefined reference to `__gmpn_gcdext'
ntl.a(lip.o): In function `_ntl_gsdiv':
lip.c:(.text+0x565b): undefined reference to `__gmpn_divrem_1'
lip.c:(.text+0x56f2): undefined reference to `__gmpn_rshift'
ntl.a(lip.o): In function `_ntl_gcrt_struct_init':
lip.c:(.text+0x5c80): undefined reference to `__gmpn_mod_1'
ntl.a(lip.o): In function `_ntl_grshift':
lip.c:(.text+0x5fb8): undefined reference to `__gmpn_rshift'
ntl.a(lip.o): In function `_ntl_glshift':
lip.c:(.text+0x61b8): undefined reference to `__gmpn_lshift'
ntl.a(lip.o): In function `_ntl_gexteucl':
lip.c:(.text+0x7147): undefined reference to `__gmpn_gcdext'
ntl.a(lip.o): In function `_ntl_ggcd':
lip.c:(.text+0x798f): undefined reference to `__gmpn_gcd'
collect2: ld returned 1 exit status
make[1]: *** [QuickTest] Error 1
make[1]: Leaving directory `/usr/lib/ntl-5.5.2/src'
make: *** [check] Error 2
sana at debian:/usr/lib/ntl-5.5.2/src$
I have looked for the libraries and they are all there:
libgf2x.a and libntl.a in /usr/local/lib
libgmp.a in /usr/lib
Any feedback on how to resolve this problem is welcome
Regards
Sana
p.s. not sure if the following information will help:
After getting stuck with the error above, I continued with:
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo make install
mkdir -p -m 755 /usr/local/include
rm -rf /usr/local/include/NTL
mkdir -m 755 /usr/local/include/NTL
cp -p ../include/NTL/*.h /usr/local/include/NTL
chmod -R a+r /usr/local/include/NTL
mkdir -p -m 755 /usr/local/share/doc
rm -rf /usr/local/share/doc/NTL
mkdir -m 755 /usr/local/share/doc/NTL
cp -p ../doc/*.txt /usr/local/share/doc/NTL
cp -p ../doc/*.html /usr/local/share/doc/NTL
cp -p ../doc/*.gif /usr/local/share/doc/NTL
chmod -R a+r /usr/local/share/doc/NTL
mkdir -p -m 755 /usr/local/lib
cp -p ntl.a /usr/local/lib/libntl.a #LSTAT
chmod a+r /usr/local/lib/libntl.a #LSTAT
sana at debian:/usr/lib/ntl-5.5.2/src$
I then tried the first example at http://www.shoup.net/ntl/doc/tour-ex1.html:
sana at debian:/usr/lib/ntl-5.5.2/src$ sudo g++ -I../include foo.c -o foo -L/usr/local/lib -lntl -L/usr/lib -lgmp -L/usr/local/lib -lgf2x -lm
/tmp/ccLabAMg.o: In function `NTL::add(NTL::ZZ&, NTL::ZZ const&, long)':
foo.c:(.text._ZN3NTL3addERNS_2ZZERKS0_l[NTL::add(NTL::ZZ&, NTL::ZZ const&, long)]+0x1d): undefined reference to `_ntl_zsadd'
/tmp/ccLabAMg.o: In function `NTL::mul(NTL::ZZ&, NTL::ZZ const&, NTL::ZZ const&)':
foo.c:(.text._ZN3NTL3mulERNS_2ZZERKS0_S3_[NTL::mul(NTL::ZZ&, NTL::ZZ const&, NTL::ZZ const&)]+0x1f): undefined reference to `_ntl_zmul'
/tmp/ccLabAMg.o: In function `NTL::ZZ::operator=(NTL::ZZ const&)':
foo.c:(.text._ZN3NTL2ZZaSERKS0_[NTL::ZZ::operator=(NTL::ZZ const&)]+0x16): undefined reference to `_ntl_zcopy1'
/tmp/ccLabAMg.o: In function `NTL::ZZ::~ZZ()':
foo.c:(.text._ZN3NTL2ZZD1Ev[NTL::ZZ::~ZZ()]+0xd): undefined reference to `_ntl_zfree'
collect2: ld returned 1 exit status
sana at debian:/usr/lib/ntl-5.5.2/src$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shoup.net/pipermail/ntl_shoup.net/attachments/20110608/e2d26003/attachment.html>
More information about the ntl
mailing list