[ntl] problems installing NTL with GF2X (NTL does not seem to find GF2X)

Peter Sebastian Nordholt peter.s.nordholt at alexandra.dk
Thu Sep 26 02:22:26 CDT 2013


Thank you Patrick, that was exactly what was wrong :).

Btw. Victor actually answered earlier, so I guess he does read the list.

/Peter

From: Patrick Horgan <phorgan1 at gmail.com<mailto:phorgan1 at gmail.com>>
Reply-To: "patrick at dbp-consulting.com<mailto:patrick at dbp-consulting.com>" <patrick at dbp-consulting.com<mailto:patrick at dbp-consulting.com>>
Date: Thursday, September 26, 2013 03:37
To: "ntl at shoup.net<mailto:ntl at shoup.net>" <ntl at shoup.net<mailto:ntl at shoup.net>>
Subject: Re: [ntl] problems installing NTL with GF2X (NTL does not seem to find GF2X)

On 09/02/2013 05:30 AM, Peter Sebastian Nordholt wrote:
Hi,

I am trying to install NTL with GMP and GF2X, but am having some problems that I am stuck trying to solve, so I am hoping this mailing list may have some tips on how to proceed.

The problem seems to be that NTL cannot find the GF2X libraries. More specifically what happens is  as follows: I first install GMP and GF2X (as described on the NTL website http://www.shoup.net/ntl/index.html). To install NTL I first run "make" which seems to go well, but when I run "make check" I get the following error:

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 `/home/ubuntu/temp/NTL/ntl-6.0.0/src'
g++ -I../include -I.  -O2 -m64  -o QuickTest QuickTest.c ntl.a  -lgmp   -lgf2x  -lm #LSTAT
make[1]: Leaving directory `/home/ubuntu/temp/NTL/ntl-6.0.0/src'
./QuickTest
./QuickTest: error while loading shared libraries: libgf2x.so.1: cannot open shared object file: No such file or directory
Normally on unix the system does not look in /usr/local/lib for libraries by default.  If your system is already set up to do that, then you merely have to do

sudo ldconfig


to get the autoloading library loader (ld.so) to know about new installed libraries.  If you don't have it set up to do that, then you have some choices.  The easiest, is to tell the loader to look into /usr/local/lib.  I'm going to tell you how I do it on fedora, because I don't have an Ubuntu box to check right now, but the task will be similar.  The loader, ld.so looks in a file /etc/ld.so.conf to see where to look for libraries other than the default /lib and /usr/lib.  On fedora, that file only has one line:

include ld.so.conf.d/*.conf


The just includes all the files that end with conf in the directory /etc/ld.so.conf.d/  Your job, would be to add a file, or modify a file.  (Of course you either have to be root or use sudo to do all of these things I'm telling you.)  On my machine, I've added a file to that directory which I cleverly named local.conf.  In the file, it has one line,

/usr/local/lib


After adding that, and whenever the contents of /usr/local/lib change, you have to re-run

sudo ldconfig


There are things that can go wrong because you have local libraries and it goes wrong this way:  If you put your own versions of libraries in /usr/local/lib that ALSO exist in /usr/lib or /lib, and when you update something needs a new version of that library and installs it, it may break.   It will break because your library in /usr/local/lib is used first.  Their new library is not used.  If it was a major revision change, and has new methods the new software tries to use, it will segfault.   That may even result in gui login failing.  To get in you'd have to log in textually, sudo rm the offending library, reboot, then go in and get the source of the new library (if you really needed your own copy, and rebuild your software that used it.  That won't be a program with ntl or gmp or gf2x since they would not normally be used by the operating system for anything.

The alternative is to change how things are built.  You surely know the -L flag tells the compiler/compile time loader where to look for libraries.  There is a corresponding -rpath flag lets you have a run time library search path added to the executable, so it will know to look in /usr/local/lib as well.  man ld will tell you more.  If you do this, you will have to muck around with other software's Makefiles/configurations since they didn't do it.  For example in the error you have above, you can see that QuickTest was not build with -rpath=/usr/local/lib as part of the compile command.  You might be able to add it to configure lines, although I haven't tried it, being lazy and risk taking and going with the /etc/ld.so.conf.d/local.conf trick.  (I also build a LOT of local software because I often want a newer version of something because it has a bug fix or a feature I need and it won't be in updates for a year.  It was cool having what became gimp 2.8 long before it was available from any of the distributions.)

Hope that helps.  I have gotten the distinct impression that no one reads this list, certainly not Victor.  If you want, you can email me directly if you have any more questions.  I'm patrick at dbp-consulting.com

Patrick
make: *** [check] Error 127

Which is odd because I can check that the GF2X library is right in "/usr/local" where I suppose NTL should be looking for it (in particular "libgf2x.so.1" is at "/usr/local/lib/libgf2x.so.1").

I am installing this on an Ubuntu 12.04.3 LTS machine with a Intel Xeon E5-2650 CPU (not sure that makes any difference, but let me know if there is more/other information that is relevant).

Here are the steps I do to install GF2X, GMP and NTL respectively:

wget https://gforge.inria.fr/frs/download.php/30873/gf2x-1.1.tar.gz
tar -xzf gf2x-1.1.tar.gz
cd gf2x-1.1
sudo ./configure ABI=64 CFLAGS="-O2 -m64"
sudo make
sudo make check
sudo make install

wget ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2
tar xvjf gmp-5.1.2.tar.bz2
cd gmp-5.1.2
sudo ./configure CFLAGS="-O2 -m64"
sudo make
sudo make check
sudo make install

wget http://www.shoup.net/ntl/ntl-6.0.0.tar.gz
tar -xzf ntl-6.0.0.tar.gz
cd ntl-6.0.0/src
sudo ./configure NTL_GMP_LIP=on NTL_GF2X_LIB=on CFLAGS="-O2 -m64"
sudo make
sudo make check

I really hope you have an idea what might be wrong, because I am puzzled.

Best regards,
Peter



_______________________________________________
ntl mailing list
ntl at shoup.net<mailto:ntl at shoup.net>http://shoup.net/mailman/listinfo/ntl_shoup.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shoup.net/pipermail/ntl_shoup.net/attachments/20130926/c59e7134/attachment-0001.html>


More information about the ntl mailing list