LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-14-2011, 06:36 AM   #1
KeiNivky
LQ Newbie
 
Registered: Dec 2010
Posts: 12

Rep: Reputation: 0
gmp error while compiling mpfr on ubuntu


I am trying to compile mpfr on ubuntu. I am getting the following error when running make check:

Code:
[tversion] GMP: header 5.0.2, library 4.3.2
[tversion] MPFR tuning parameters from src/x86_64/core2/mparam.h
ERROR! The versions of gmp.h (5.0.2) and libgmp (4.3.2) do not match.
The possible causes are:
  * A bad configuration in your include/library search paths.
  * An inconsistency in the include/library search paths of
    your development environment; an example:
      http://gcc.gnu.org/ml/gcc-help/2010-11/msg00359.html
  * GMP has been upgraded after the first "make check".
    In such a case, try again after a "make clean".
  * A new or non-standard version naming is used in GMP.
    In this case, a patch may already be available on the
    MPFR web site.  Otherwise please report the problem.
In the first two cases, this may lead to errors, in particular with MPFR.
If some other tests fail, please solve that problem first.
FAIL: tversion
Ealier I compiled gmp 5.0.2, and now it seems that there is some kind of inconsistency with the header file and the library itself. Any idea how to fix this?
 
Old 12-14-2011, 09:30 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Did you install gmp-5.0.2 or just build it? Did you uninstall the previous version of gmp? Did you tell mpfr where to look for the 5.0.2 libraries if you installed them in a non-standard location? Did you look into the four possible causes provided by mpfr, especially the third one?
 
Old 12-14-2011, 11:14 PM   #3
KeiNivky
LQ Newbie
 
Registered: Dec 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Did you install gmp-5.0.2 or just build it?
I installed, I guess... I executed the commands the README specified: ./configure; make; make check; sudo install;

Quote:
Did you uninstall the previous version of gmp?
No. How can I do this?

Quote:
Did you tell mpfr where to look for the 5.0.2 libraries if you installed them in a non-standard location?
Well. I didn't specified the path in the installation script, so I suppose it was put in the standard directory. I didn't tell mpfr to look for it in a specific directory.

Quote:
Did you look into the four possible causes provided by mpfr, especially the third one?
I tried the third one, didn't work. The others I had no clue how to work out.
 
Old 12-15-2011, 09:51 AM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by KeiNivky View Post
I installed, I guess... I executed the commands the README specified: ./configure; make; make check; sudo install;
If this is exactly how you did it, then the v5 gmp should be installed in /usr/local. What is the output from these two commands?
Code:
ls -l /usr/lib/libgmp*
ls -l /usr/local/lib/libgmp*
Quote:
Originally Posted by KeiNivky View Post
No. How can I do this?
Did you install the previous gmp from source or using your package manager? If you installed using your package manager, use your package manager to uninstall it. If you installed from source, then execute make uninstall from the source directory for v4 gmp. If you don't have the source directory any more, then you will need to hunt down each file installed by v4 gmp and manually remove it.

Quote:
Originally Posted by KeiNivky View Post
Well. I didn't specified the path in the installation script, so I suppose it was put in the standard directory. I didn't tell mpfr to look for it in a specific directory.
What installation script? You should be able to pass an option to the mpfr configure script telling it explicitly where to look for the gmp headers and libraries. I suspect these are in /usr/local/include and /usr/local/lib(64) if you didn't pass --prefix to the gmp configure script.
 
Old 12-15-2011, 06:16 PM   #5
KeiNivky
LQ Newbie
 
Registered: Dec 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Apparently there are remnants of an even older gmp installation:

Code:
ls -l /usr/lib/libgmp*
-rw-r--r-- 1 root root 1039394 2011-03-10 21:58 /usr/lib/libgmp.a
-rw-r--r-- 1 root root     923 2011-03-10 21:54 /usr/lib/libgmp.la
lrwxrwxrwx 1 root root      15 2011-12-05 04:12 /usr/lib/libgmp.so -> libgmp.so.3.5.2
lrwxrwxrwx 1 root root      15 2011-08-11 14:29 /usr/lib/libgmp.so.3 -> libgmp.so.3.5.2
-rw-r--r-- 1 root root  380736 2011-03-10 21:58 /usr/lib/libgmp.so.3.5.2
-rw-r--r-- 1 root root   34660 2011-03-10 21:58 /usr/lib/libgmpxx.a
-rw-r--r-- 1 root root     956 2011-03-10 21:54 /usr/lib/libgmpxx.la
lrwxrwxrwx 1 root root      17 2011-12-05 04:12 /usr/lib/libgmpxx.so -> libgmpxx.so.4.1.2
lrwxrwxrwx 1 root root      17 2011-08-11 14:29 /usr/lib/libgmpxx.so.4 -> libgmpxx.so.4.1.2
-rw-r--r-- 1 root root   14616 2011-03-10 21:58 /usr/lib/libgmpxx.so.4.1.2
Code:
ls -l /usr/local/lib/libgmp*
-rw-r--r-- 1 root root 1183232 2011-12-07 00:22 /usr/local/lib/libgmp.a
-rwxr-xr-x 1 root root     917 2011-12-07 00:22 /usr/local/lib/libgmp.la
lrwxrwxrwx 1 root root      16 2011-12-07 00:22 /usr/local/lib/libgmp.so -> libgmp.so.10.0.2
lrwxrwxrwx 1 root root      16 2011-12-07 00:22 /usr/local/lib/libgmp.so.10 -> libgmp.so.10.0.2
-rwxr-xr-x 1 root root  491382 2011-12-07 00:22 /usr/local/lib/libgmp.so.10.0.2
What about this 10.0.2 version? I thought the newer was 5.0.2

I am not sure about how any of the previous version was installed, but it was not me. Maybe they came with the standard installation of ubuntu, or maybe they were installed as a dependency for another package. Either way, there are some some gmp entries in the installed packages table:

Code:
dpkg --list | grep gmp
ii  libgmp-ocaml                          20021123-17                                OCaml bindings for the GNU multiprecision arithmetic library
ii  libgmp-ocaml-dev                      20021123-17                                OCaml bindings for the GNU multiprecision arithmetic library
ii  libgmp3-dev                           2:4.3.2+dfsg-1ubuntu3                      Multiprecision arithmetic library developers tools
ii  libgmp3c2                             2:4.3.2+dfsg-1ubuntu3                      Multiprecision arithmetic library
ii  libgmpxx4ldbl                         2:4.3.2+dfsg-1ubuntu3                      Multiprecision arithmetic library (C++ bindings)
Should I remove the last three?

And about the "install script", I was referring to "make install".
 
Old 12-16-2011, 07:05 AM   #6
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
The first thing I would do is uninstall v5 by executing make uninstall in the source directory. Then I would use my package manager to update GMP to the latest version available in the repositories. I would also install MPFR from the repositories. Why do you need to build MPFR from source anyway?

If I needed to build MPFR from source, I wouldn't install it or it's dependencies system-wide...especially if I didn't understand what I was doing. I would create a directory in my $HOME to install things so I didn't pollute my system directories. For example, I might create a directory called MySystem in my $HOME. Then I would pass --prefix=$HOME/MySystem/usr to the configure script for anything I built from source. That way, when I executed make install, nothing could get installed system-wide because I wouldn't be root. Finally, I would add $HOME/MySystem/usr/bin:$HOME/MySystem/bin to my $PATH so I could access the applications I install in MySystem. But that's just me.

Also, the 10.0.2 libraries are the ones you installed from 5.0.2. The numbers on the end of the shared libraries themselves don't necessarily correspond to the version of the package.

Last edited by weibullguy; 12-16-2011 at 07:12 AM.
 
Old 12-16-2011, 09:53 AM   #7
KeiNivky
LQ Newbie
 
Registered: Dec 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for all the help. I will probably use your advice and install them in my home.

gmp and mpfr are not updated in the repositories, that's why I am building them.

Just for curiosity. If keep the libs in my own home, then how would I include them in C programs? Is there a way of configuring where the compiler should look for headers and libs? Or I would always have to specify the full path?
 
Old 12-16-2011, 10:35 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
... where the compiler should look for headers and libs ?
The compiler will usually not use any gmp, mpfr, mpc headers.
The functions are compiled into the binary gcc / g++.

And : Any gcc/g++ will look for a particular version of libgmp**,
like libgmp.so.3 , libgmpxx.so.3 , libgmpxx.so.4 .

..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i have an error Building GCC: requires GMP 4.1+ and MPFR 2.3.0+. robineecc1 Linux From Scratch 17 03-05-2018 05:57 AM
Finding path of GMP and MPFR for gcc upgrade drosselmeyer Linux - Newbie 2 08-03-2011 07:15 AM
what is the use of mpfr and gmp is they are not used ? Manual error ? centguy Linux From Scratch 8 01-25-2010 05:57 AM
[SOLVED] gcc in CLFS section 5.8.1 does not compile without the omitted mpfr and gmp Openumerix Linux From Scratch 4 11-20-2009 01:35 PM
Why install MPFR and GMP in GCC as opposed to separately? GuyWhoKilledBear Linux - Software 1 08-12-2009 12:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration