La construcción de GCC requiere GMP 4.2+, MPFR 2.3.1 + y MPC 0.8.0+


He descargado GCC 4.5 desde http://www.netgull.com/gcc/releases/gcc-4.5.0 / pero cuando intento configurar / compilar, obtengo el siguiente error:

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>

Las siguientes libs están presentes en los respectivos directorios

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

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

No tengo libmpc.una biblioteca instalada en cualquier lugar en cajas.

Basado en el error cómo puedo saber :

A) cuál es la versión actual de libgmp.a y libmpfr.a están instalados.

B) Si son de versión incorrecta ¿cómo puedo ¿desplegar mi propia versión sin alterar la actual?

Author: Trevor Hickey, 2012-02-13

4 answers

En el directorio donde tengo esas bibliotecas instaladas (/usr/gnu64/lib), también tengo un archivo libgmp.la (y archivos libmpc.la y libmpfr.la), que contienen texto legible. La información de la versión SO está ahí, pero eso no es exactamente lo mismo que la 'versión del producto'. En su lugar, habla sobre la compatibilidad de enlaces.

Estaba tratando de investigar qué versión tenía, y la solución extraña que se me ocurrió fue ejecutar el GCC (4.6.1) que construí con la opción -v. En parte, se dijo:

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.

Por lo tanto, parece que tengo instalado GMP 5.0.2 (pero construí GCC con 5.0.1), y MPFR 3.1.0 (pero construí GCC con 3.0.0) y MPC 0.9 (pero construí GCC con 0.8.2). El desajuste se produce porque traté de compilar e instalar GCC 4.6.2 y presumiblemente necesitaba las versiones más nuevas. (No tuve éxito, pero esa es una historia diferente.)

Instalo mis bibliotecas personalizadas en /usr/gnu64/lib, y luego le digo a GCC que es dónde encontrarlas con las opciones de configuración --with-mpfr=/usr/gnu64/lib, --with-gmp=/usr/gnu64/lib, --with-mpc=/usr/gnu/64/lib. Estos caminos están cableados en GCC y funciona desde allí.

 7
Author: Jonathan Leffler,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-02-12 23:58:03

Dentro del directorio gcc, haga este comando:

./contrib/download_prerequisites

Después de ese script, GMP, MPFR y MPC estarán listos para usar. Continuar con ./configure.

 66
Author: Joseph Hansen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-07-19 13:56:37

Tuve el mismo problema al intentar instalar/compilar GCC 4.8.1. Así es como resolví:

En Debian, simplemente ejecute estos dos comandos:

apt-get install libmpc-dev
./configure
 49
Author: Damico,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-06-17 17:01:24

Tuve el mismo problema compilando la rama GCC 4.9.

Para los sistemas basados en Red Hat y Fedora, ejecute el siguiente comando:

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

Esto instalará las bibliotecas de precisión múltiple (MP) de GNU para números enteros, coma flotante y complejos.

 13
Author: etherice,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-11-14 04:55:50