Re: installation problem.

Dear Roberto, good to hear from you again. i checked the contents of /usr/local/lib for gmp libraries and got to know that though the file names that you mentioned the names on my machine, their sizes did not match. let me print the sizes of the different files here.
$ ls -l /usr/local/lib/libgmp* -rw-r--r-- 1 root root 2945824 Aug 18 04:29 /usr/local/lib/libgmp.a -rwxr-xr-x 1 root root 693 Aug 18 04:29 /usr/local/lib/libgmp.la lrwxrwxrwx 1 root root 15 Aug 18 04:29 /usr/local/lib/libgmp.so -> libgmp.so.3.3.2 lrwxrwxrwx 1 root root 15 Aug 18 04:29 /usr/local/lib/libgmp.so.3 -> libgmp.so.3.3.2 -rwxr-xr-x 1 root root 686921 Aug 18 04:29 /usr/local/lib/libgmp.so.3.3.2 -rw-r--r-- 1 root root 504116 Aug 18 04:29 /usr/local/lib/libgmpxx.a -rwxr-xr-x 1 root root 854 Aug 18 04:29 /usr/local/lib/libgmpxx.la lrwxrwxrwx 1 root root 17 Aug 18 04:29 /usr/local/lib/libgmpxx.so -> libgmpxx.so.3.0.4 lrwxrwxrwx 1 root root 17 Aug 18 04:29 /usr/local/lib/libgmpxx.so.3 -> libgmpxx.so.3.0.4 -rwxr-xr-x 1 root root 176177 Aug 18 04:29 /usr/local/lib/libgmpxx.so.3.0.4
the sizes of the header files in the /usr/local/include directory match those that you had mentioned.
also the linker picks the correct libgmpxx.so (i.e from /usr/local/lib). i am attaching the output of this command with this mail.
Best wishes, Nitin Kulkarni.
On Mon, 18 Aug 2003, Roberto Bagnara wrote:
Dear Nitin,
we have had network problems during the last few days. Having not heard from you, I wonder if you received my message of August 14th and I am resending it just in case. Please let us know how things go. Cheers
Roberto
nitinsk@cfdvs.iitb.ac.in wrote:
following your instructions, i compiled the code snippet that you had
sent. and as you had guessed, it did not compile. i am attaching a file containing the output of the compile command.
Dear Nitin,
the output you sent shows nothing wrong. I am now convinced that you should have, in your system, a (old) version of GMP compiled with a different (version of the) C++ compiler. If you installed GMP 4.1.2 compiled with GCC 3.3 in /usr/local you should see something like the following
$ ls -l /usr/local/include/gmp* -rw-r--r-- 1 root root 79571 Jun 30 15:32 /usr/local/include/gmp.h -rw-r--r-- 1 root root 182330 Jun 30 15:32 /usr/local/include/gmpxx.h $ ls -l /usr/local/lib/libgmp* -rw-r--r-- 1 root root 2863428 Jun 30 15:32 /usr/local/lib/libgmp.a -rwxr-xr-x 1 root root 693 Jun 30 15:32 /usr/local/lib/libgmp.la lrwxrwxrwx 1 root root 15 Jun 30 15:32 /usr/local/lib/libgmp.so -> libgmp.so.3.3.2 lrwxrwxrwx 1 root root 15 Jun 30 15:32 /usr/local/lib/libgmp.so.3 -> libgmp.so.3.3.2 -rwxr-xr-x 1 root root 1409013 Jun 30 15:32 /usr/local/lib/libgmp.so.3.3.2 -rw-r--r-- 1 root root 1337872 Jun 30 15:32 /usr/local/lib/libgmpxx.a -rwxr-xr-x 1 root root 1161 Jun 30 15:32 /usr/local/lib/libgmpxx.la lrwxrwxrwx 1 root root 17 Jun 30 15:32 /usr/local/lib/libgmpxx.so -> libgmpxx.so.3.0.4 lrwxrwxrwx 1 root root 17 Jun 30 15:32 /usr/local/lib/libgmpxx.so.3 -> libgmpxx.so.3.0.4 -rwxr-xr-x 1 root root 629220 Jun 30 15:32 /usr/local/lib/libgmpxx.so.3.0.4
And this should be the only version of GMP's libgmpxx.* files you have in the system. If, for example, you have another instance of the GMP C++ interface installed in a place that your compiler looks into _before_ looking into /usr/local/lib, this may be the cause of your problem.
Try passing the --verbose option to the linker, i.e., use the command
g++ -v -I/usr/local/include tgmp.cc -L/usr/local/lib -lgmpxx -lgmp -Xlinker --verbose
and check where the linker picks libgmpxx.so from. For instance, here is what I see in the output of the above command:
attempt to open /usr/local/lib/libgmpxx.so succeeded -lgmpxx (/usr/local/lib/libgmpxx.so)
This tells me that the linker is picking up the right version of the library. Keep us informed. Cheers
Roberto
-- Prof. Roberto Bagnara Computer Science Group Department of Mathematics, University of Parma, Italy http://www.cs.unipr.it/~bagnara/ mailto:bagnara@cs.unipr.it
----------------------------------------- Nitin Kulkarni Graduate Student Computer Science and Engineering Dept., IIT Bombay, Mumbai, India. -----------------------------------------

nitinsk@cfdvs.iitb.ac.in wrote:
good to hear from you again. i checked the contents of /usr/local/lib for gmp libraries and got to know that though the file names that you mentioned the names on my machine, their sizes did not match. let me print the sizes of the different files here.
Hello Nitin,
the sizes do not matter. The GMP's configuration mechanism tries to figure out which CPU is used on the host on which compilation takes place (when not cross-compiling, of course) and causes the use of specialized code for that CPU. So, if you have, say, a Pentium III the sizes will be different from mine, since I have an Athlon.
[...]
also the linker picks the correct libgmpxx.so (i.e from /usr/local/lib). i am attaching the output of this command with this mail.
You forgot to attach the output. And it is important because the next suspect is failure to link with the right libstdc++. Cheers
Roberto

Sorry for the mistake. i forgot to attach the output file. i will attach it here. about the sizes, i tried installation on another machine(to which i dont have frequent access) that too a pentium-3. there i have mandrake linux 9.1. and the installation completed without any problem. and the sizes of the files were close to what you have on your system. but my machine - a pentium 3 having redhat linux 7.1, is the one that is giving me problems.
Best wishes, Nitin Kulkarni.
On Tue, 19 Aug 2003, Roberto Bagnara wrote:
nitinsk@cfdvs.iitb.ac.in wrote:
good to hear from you again. i checked the contents of /usr/local/lib for gmp libraries and got to know that though the file names that you mentioned the names on my machine, their sizes did not match. let me print the sizes of the different files here.
Hello Nitin,
the sizes do not matter. The GMP's configuration mechanism tries to figure out which CPU is used on the host on which compilation takes place (when not cross-compiling, of course) and causes the use of specialized code for that CPU. So, if you have, say, a Pentium III the sizes will be different from mine, since I have an Athlon.
[...]
also the linker picks the correct libgmpxx.so (i.e from /usr/local/lib). i am attaching the output of this command with this mail.
You forgot to attach the output. And it is important because the next suspect is failure to link with the right libstdc++. Cheers
Roberto
-- Prof. Roberto Bagnara Computer Science Group Department of Mathematics, University of Parma, Italy http://www.cs.unipr.it/~bagnara/ mailto:bagnara@cs.unipr.it
----------------------------------------- Nitin Kulkarni Graduate Student Computer Science and Engineering Dept., IIT Bombay, Mumbai, India. -----------------------------------------

nitinsk@cfdvs.iitb.ac.in wrote:
Sorry for the mistake. i forgot to attach the output file. i will attach it here. about the sizes, i tried installation on another machine(to which i dont have frequent access) that too a pentium-3. there i have mandrake linux 9.1. and the installation completed without any problem. and the sizes of the files were close to what you have on your system. but my machine - a pentium 3 having redhat linux 7.1, is the one that is giving me problems.
Dear Nitin,
I could see nothing wrong in the output file you sent. I believe there is something wrong in the libstdc++ library on your Red Hat 7.1 system, but, without having access to the actual system, I can only conjecture it. Let us start from the beginning: please check whether you can compile and execute any C++ program on that system with that version of GCC. Try the classic "Hello world!" and see if it works. If it doesn't, then of course your GCC installation is faulty. If it works, the only suggestion I can give you is to reconfigure and rebuild GMP from scratch, then make, make check, and try again to compile the simple C++ program using gmpxx.h that I sent you. You may also want to ask for advice on the GMP mailing list. I hope this helps. Cheers
Roberto
participants (2)
-
nitinsk@cfdvs.iitb.ac.in
-
Roberto Bagnara