Dear nettle community
I am triyng to install nettle2.7.1 (because I want to install gnutls-cli but it doesn't support nettle3.0) on my
Ubuntu 12.04 i686 architecture
but I always get this result on
make check
zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$ make check make check-here make[1]: ingresso nella directory "/home/zaamus/Dependencies/nettle-2.7.1" true make[1]: uscita dalla directory "/home/zaamus/Dependencies/nettle-2.7.1" set -e; for d in tools testsuite examples; do \ echo "Making check in $d" ; (cd $d && make check); done Making check in tools make[1]: ingresso nella directory "/home/zaamus/Dependencies/nettle-2.7.1/tools" true make[1]: uscita dalla directory "/home/zaamus/Dependencies/nettle-2.7.1/tools" Making check in testsuite make[1]: ingresso nella directory "/home/zaamus/Dependencies/nettle-2.7.1/testsuite" LD_LIBRARY_PATH=../.lib PATH="../.lib:$PATH" srcdir="." \ EMULATOR="" NM="nm" EXEEXT="" \ ../run-tests aes-test arcfour-test arctwo-test blowfish-test cast128-test base16-test base64-test camellia-test des-test des3-test des-compat-test md2-test md4-test md5-test md5-compat-test memxor-test gosthash94-test ripemd160-test salsa20-test sha1-test sha224-test sha256-test sha384-test sha512-test sha3-permute-test sha3-224-test sha3-256-test sha3-384-test sha3-512-test serpent-test twofish-test knuth-lfib-test cbc-test ctr-test gcm-test hmac-test umac-test meta-hash-test meta-cipher-test meta-armor-test buffer-test yarrow-test pbkdf2-test sexp-test sexp-format-test rsa2sexp-test sexp2rsa-test bignum-test random-prime-test pkcs1-test rsa-test rsa-encrypt-test rsa-keygen-test dsa-test dsa-keygen-test ecc-mod-test ecc-modinv-test ecc-redc-test ecc-mul-g-test ecc-mul-a-test ecdsa-sign-test ecdsa-verify-test ecdsa-keygen-test cxx-test sexp-conv-test pkcs1-conv-test symbols-test PASS: aes PASS: arcfour PASS: arctwo PASS: blowfish PASS: cast128 PASS: base16 PASS: base64 PASS: camellia PASS: des PASS: des3 PASS: des-compat PASS: md2 PASS: md4 PASS: md5 PASS: md5-compat PASS: memxor PASS: gosthash94 PASS: ripemd160 PASS: salsa20 PASS: sha1 PASS: sha224 PASS: sha256 PASS: sha384 PASS: sha512 PASS: sha3-permute PASS: sha3-224 PASS: sha3-256 PASS: sha3-384 PASS: sha3-512 PASS: serpent PASS: twofish PASS: knuth-lfib PASS: cbc PASS: ctr PASS: gcm PASS: hmac PASS: umac PASS: meta-hash PASS: meta-cipher PASS: meta-armor PASS: buffer PASS: yarrow PASS: pbkdf2 PASS: sexp PASS: sexp-format PASS: rsa2sexp PASS: sexp2rsa PASS: bignum PASS: random-prime PASS: pkcs1 PASS: rsa PASS: rsa-encrypt PASS: rsa-keygen PASS: dsa PASS: dsa-keygen ./ecc-mod-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpz_limbs_read FAIL: ecc-mod ./ecc-modinv-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpz_limbs_read FAIL: ecc-modinv ./ecc-redc-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpz_limbs_read FAIL: ecc-redc ./ecc-mul-g-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpn_cnd_add_n FAIL: ecc-mul-g ./ecc-mul-a-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpn_cnd_add_n FAIL: ecc-mul-a ./ecdsa-sign-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpz_limbs_modify FAIL: ecdsa-sign ./ecdsa-verify-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpz_limbs_read FAIL: ecdsa-verify ./ecdsa-keygen-test: symbol lookup error: ../.lib/libhogweed.so.2: undefined symbol: __gmpn_cnd_add_n FAIL: ecdsa-keygen PASS: cxx PASS: sexp-conv PASS: pkcs1-conv PASS: symbols ==================== 8 of 67 tests failed ==================== make[1]: *** [check] Errore 1 make[1]: uscita dalla directory "/home/zaamus/Dependencies/nettle-2.7.1/testsuite" make: *** [check] Errore 2
I have libgcrypt1.6.2, libgpg-error1.17, m4 macro processor and gmp6.0.0 installed. Library lgmp is correctly found when I compile some random c source. Can you help me? Do you need other information?
Thanks, Vittorio
braga Vittorio.Braga@roma2.infn.it writes:
[...]
I have libgcrypt1.6.2, libgpg-error1.17, m4 macro processor and gmp6.0.0 installed.
Note that libgcrypt and libgpg-error are not used by nettle.
Library lgmp is correctly found when I compile some random c source. Can you help me? Do you need other information?
It looks like you found gmp-6.0 header files, but link with an older version of gmp at runtime.
Can you try ldd on some of the failing test programs? E.g.,
LD_LIBRARY_PATH=.lib ldd testsuite/dsa-keygen-test
Regards, /Niels
Dear Niels, thanks for your immediate answer. Here is what I found on 3 of the failing tests (dsa-keygen-test does not failing, anyway the result is the same)..
zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$ LD_LIBRARY_PATH=.lib ldd testsuite/ecc-mul-g-test linux-gate.so.1 => (0x40022000) libhogweed.so.2 => .lib/libhogweed.so.2 (0x40026000) libnettle.so.4 => .lib/libnettle.so.4 (0x40054000) libgmp.so.10 => /usr/lib/i386-linux-gnu/libgmp.so.10 (0x400a5000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x40124000) /lib/ld-linux.so.2 (0x40000000) zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$ LD_LIBRARY_PATH=.lib ldd testsuite/ecdsa-sign-test linux-gate.so.1 => (0x40022000) libhogweed.so.2 => .lib/libhogweed.so.2 (0x40026000) libnettle.so.4 => .lib/libnettle.so.4 (0x40054000) libgmp.so.10 => /usr/lib/i386-linux-gnu/libgmp.so.10 (0x400a5000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x40124000) /lib/ld-linux.so.2 (0x40000000) zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$ LD_LIBRARY_PATH=.lib ldd testsuite/ecc-mul-a-test linux-gate.so.1 => (0x40022000) libhogweed.so.2 => .lib/libhogweed.so.2 (0x40026000) libnettle.so.4 => .lib/libnettle.so.4 (0x40054000) libgmp.so.10 => /usr/lib/i386-linux-gnu/libgmp.so.10 (0x400a5000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x40124000) /lib/ld-linux.so.2 (0x40000000)
Il 2014-11-09 12:22 nisse@lysator.liu.se ha scritto:
braga Vittorio.Braga@roma2.infn.it writes:
Dear Niels, thanks for your immediate answer. Here is what I found on 3 of the failing tests
Good.
Is the file /usr/lib/i386-linux-gnu/libgmp.so.10 really gmp-6.0? I suspect it's an older version. On my system (which is x86_64, not i386 like yours), /usr/lib/x86_64-linux-gnu/libgmp.so.10 is a symlink to /usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0, and if I examine the symbol table, I get
$ objdump -tT /usr/lib/x86_64-linux-gnu/libgmp.so.10 |grep limbs 0000000000020210 g DF .text 0000000000000015 Base __gmpz_limbs_write 00000000000201a0 g DF .text 000000000000003c Base __gmpz_limbs_finish 000000000001bd40 g DF .text 0000000000000253 Base __gmpz_prodlimbs 0000000000020200 g DF .text 0000000000000005 Base __gmpz_limbs_read 00000000000201e0 g DF .text 0000000000000015 Base __gmpz_limbs_modify
Do you have those symbols?
I think you can double check with
dpkg -S /usr/lib/i386-linux-gnu/libgmp.so.10
(should give package name libgmp10), and check the version with
dpkg -l libgmp10
In my (debian) system the package versino is "2:6.0.0+dfsg-6".
Regards, /Niels
I am sure I have installed gmp6.0.0: I have done it right before trying to install nettle.
However, this is what I get with your tests
zaamus@zaamuspc:/usr/local/itt/idl70/lib$ dpkg -S /usr/lib/i386-linux-gnu/libgmp.so.10 libgmp10: /usr/lib/i386-linux-gnu/libgmp.so.10 zaamus@zaamuspc:/usr/local/itt/idl70/lib$ dpkg -l libgmp10 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Nome Versione Descrizione +++-=====================-=====================-========================================================== ii libgmp10 2:5.0.2+dfsg-2ubuntu1 Multiprecision arithmetic library
Il 2014-11-09 20:12 nisse@lysator.liu.se ha scritto:
braga Vittorio.Braga@roma2.infn.it writes:
I am sure I have installed gmp6.0.0: I have done it right before trying to install nettle.
Using apt-get, or compiling from source (and then typically installing under /usr/local)?
This shows that the version installed under /usr/lib is *not* version 6.0. So if you have installed gmp-6, it's located somewhere else on the system. I'm going to assume it's under /usr/local.
You need to tweak the invocation of nettle's configure script to pick it up (or, alternatively, edit /etc/ld.so.conf to include /usr/local/lib by default, and run ldconfig, but that might have undesirable side effects).
What probably happened, is that you got header files for gmp-6 in /usr/local/include, and gcc searches that directory by default. And you got the corresponding library installed under /usr/local/lib, which might be searched by default during link time, but *not* during runtime.
Try rerunning nettle's ./configure as
./configure LDFLAGS="-L/usr/local/lib -Wl,rpath,/usr/local/lib"
Or as a quick test to see if this really is the problem, try setting LD_LIBRARY_PATH, and run
LD_LIBRARY_PATH=.lib:/usr/local/lib ldd testsuite/ecc-mul-g-test LD_LIBRARY_PATH=.lib:/usr/local/lib ./testsuite/ecc-mul-g-test
Regards, /Niels
First of all, thanks for your patience
Il 2014-11-09 22:21 nisse@lysator.liu.se ha scritto:
I will check... for now I will simply send you the results of your check
zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$ ./configure LDFLAGS="-L/usr/local/lib -Wl,rpath,/usr/local/lib" checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for -R flag... using -Wl,-rpath, Searching for libraries checking /usr/local/lib/lib... not found checking /usr/local/lib... added checking /sw/local/lib... not found checking /sw/lib... not found checking /usr/gnu/lib... not found checking /opt/gnu/lib... not found checking /sw/gnu/lib... not found checking /usr/freeware/lib... not found checking /usr/pkg/lib... not found checking for gcc... gcc checking whether the C compiler works... no configure: error: in `/home/zaamus/Dependencies/nettle-2.7.1': configure: error: C compiler cannot create executables See `config.log' for more details
zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$ LD_LIBRARY_PATH=.lib:/usr/local/lib ldd testsuite/ecc-mul-g-test linux-gate.so.1 => (0x40022000) libhogweed.so.2 => .lib/libhogweed.so.2 (0x40026000) libnettle.so.4 => .lib/libnettle.so.4 (0x40054000) libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x40087000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x40119000) /lib/ld-linux.so.2 (0x40000000) zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$ LD_LIBRARY_PATH=.lib:/usr/local/lib ./testsuite/ecc-mul-g-test zaamus@zaamuspc:~/Dependencies/nettle-2.7.1$
Regards, /Niels
braga Vittorio.Braga@roma2.infn.it writes:
Ok, then the flags I gave you aren't quite right. You have to follow the suggestion to look in config.log to see what went wrong. But I think I made a typo, it should probably be "-rpath", not "rpath".
If this is confusing, you may also want to read up on how the runtime linker locates libraries.
This indicates that your nettle build works fine, if you only get it to link with the right libgmp.so file at runtime (/usr/local/lib/libgmp.so.10 above).
Regards, /Niels
At the very last I managed to correctly install it thanks to your suggestions. I truly don't remember how, but I think I had to run nettle installation two times before it worked correctly
Best regards, Vittorio
Il 2014-11-10 09:00 nisse@lysator.liu.se ha scritto:
When I do make check on gmp all tests are PASSed and make install does not give me any error.. do you suggest me to reinstall something? I have tried now to install again GMP but the result is the same. Should I remove something before trying reinstalling?
Il 2014-11-09 21:13 braga ha scritto:
braga Vittorio.Braga@roma2.infn.it writes:
When I do make check on gmp all tests are PASSed and make install does not give me any error..
I don't think there's any problem with your gmp install, it's just that the nettle build gets messed up a bit with headerfiles from /usr/local/include and libgmp.so from /usr/lib. What's needed is to make sure that nettle picks up the same gmp version at compile time, link time and runtime. (I'm going to reply to your other mail in a little while).
That said, it would make things a bit simpler if you had only a single version of gmp installed. So if you don't need gmp-6 for some other reason, you could try uninstalling the gmp-6 you have in /usr/local (and make sure you get rid if its header files), and install ubuntu's libgmp-dev package instead. Then for nettle, do a make distclean and then start over with configure.
Regards, /Niels
nettle-bugs@lists.lysator.liu.se