Construction GCC exige GMP 4.2+, MPFR 2.3.1+ et MPC 0.8.0+

j'ai téléchargé GCC 4.5 à partir de http://www.netgull.com/gcc/releases/gcc-4.5.0/ mais quand j'essaie d'installation / construction, je suis d'erreur ci-dessous:

Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1040> /x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0/configure CC="gcc -m64" --prefix=/x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0 --with-gmp-lib=/usr/lib64 --with-mpfr-lib=/usr/lib64 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... gcc -m64
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.
Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1041>

les lib suivantes sont présentes dans les répertoires respectifs

/usr/lib/libgmp.a
/usr/lib64/libgmp.a

/usr/lib/libmpfr.a
/usr/lib64/libmpfr.a

je n'ai pas libmpc.une bibliothèque installée n'importe où dans des boîtes.

Basée sur l'erreur comment puis-je savoir :

a) quelle est la version actuelle de libgmp.un et libmpfr.une sont installés.

b) Si Comment puis-je déployer ma propre version sans déranger la version actuelle?

40
demandé sur Trevor Hickey 2012-02-13 03:24:47

4 réponses

Dans le répertoire où j'ai ces bibliothèques installées (/usr/gnu64/lib), j'ai aussi un libgmp.la fichier (et libmpc.la et libmpfr.la fichiers), qui contiennent le texte lisible. Les informations de version SO sont là, mais ce n'est pas tout à fait la même chose que la "version produit". Il parle plutôt de la compatibilité des liens.

j'essayais d'étudier quelle version j'avais, et la solution bizarre que j'ai trouvée était d'exécuter le GCC (4.6.1) que j'ai construit avec le -v option. En partie, il dit:

GNU C (GCC) version 4.6.1 (x86_64-apple-darwin11.1.0)
    compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.8.2
warning: GMP header version 5.0.1 differs from library version 5.0.2.
warning: MPFR header version 3.0.0 differs from library version 3.1.0.
warning: MPC header version 0.8.2 differs from library version 0.9.

donc, il semble que j'ai installé GMP 5.0.2 (mais j'ai construit GCC avec 5.0.1), et MPFR 3.1.0 (mais j'ai construit GCC avec 3.0.0) et MPC 0.9 (mais j'ai construit GCC avec 0.8.2). L'inadéquation se produit parce que j'ai essayé de compiler et d'installer GCC 4.6.2 et il a probablement eu besoin des nouvelles versions. (Je n'ai pas réussi, mais c'est une autre histoire.)

j'installe mes bibliothèques sur mesure dans /usr/gnu64/lib, et ensuite dire à GCC que c'est où les trouver avec le configurer les options --with-mpfr=/usr/gnu64/lib,--with-gmp=/usr/gnu64/lib,--with-mpc=/usr/gnu/64/lib. Ces chemins sont câblés dans GCC et cela fonctionne à partir de là.

7
répondu Jonathan Leffler 2012-02-12 23:58:03

dans le répertoire gcc, faites cette commande:

./contrib/download_prerequisites

après ce script, GMP, MPFR, et MPC seront prêts à l'emploi. Continuer avec ./configure.

66
répondu Joseph Hansen 2016-07-19 13:56:37

j'ai eu le même problème en essayant d'installer/compiler GCC 4.8.1. Voici comment j'ai résolu:

dans Debian, exécutez juste ces deux commandes:

apt-get install libmpc-dev
./configure
49
répondu Damico 2013-06-17 17:01:24

j'ai eu le même problème en compilant la branche 4.9 de GCC.

Red Hat et Fedora systèmes basés, exécutez la commande suivante:

sudo yum install gmp gmp-devel mpfr mpfr-devel libmpc libmpc-devel

ceci installera les bibliothèques GNU multi-precision (MP) pour les nombres entiers, les nombres flottants et les nombres complexes.

13
répondu etherice 2014-11-14 04:55:50