Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot configure gcc - mpfr not found

I'm installing gcc 4.5.2 with mpc 0.8.2, mpfr 3.1.0, and gmp 5.0.2. I've copied each of the mpc, mpfr, and gmp directories into the gcc-4.5.2 directory (removing the version tags). GCC successfully configures. When I run make, however, I get:

checking for MPFR... no
configure: error: libmpfr not found or uses a different ABI.
make[1]: *** [configure-mpc] Error 1
make[1]: leaving directory cross/build/gcc
make: *** [all] Error 2

MPFR is located in cross/src/gcc-4.5.2/mpfr. MPFR already was built successfully. Anyone know why mpc is unable to configure?

I think the problem may partially have to do with the libs/headers for MPFR being in cross/src/gcc-4.5.2/mpfr/src and not in cross/src/gcc-4.5.2/mpfr. All I did was extract and copy though- this is the default directory structure.

like image 679
Robert Mason Avatar asked Feb 15 '12 17:02

Robert Mason


2 Answers

I was having the same issue. But it seems this happens because latest version of MPFR (in your case 3.1.0) changed the directory hierarchy.

Instead, before configuring, run the following when you are inside gcc's source directory (may only work for gcc4.5.2 or later):

./contrib/download_prerequisites

It will download the necessary MPFR, GMP and MPC versions (but probably not the latest versions) and unpack those for gcc installation.

After that, you can continue with your configure, make and make install.

Hope this helps.

-Rakib

like image 165
Rakib Avatar answered Oct 05 '22 19:10

Rakib


I found that if I ran export C_INCLUDE_PATH=/cross/gcc-4.5.2/mpfr/src then export LD_LIBRARY_PATH=/cross/build-gcc-4.5.2/mpfr/src/.libs and finally export LIBRARY_PATH=$LD_LIBRARY_PATH everything worked as expected.

The nagging question is why gcc's own configure scripts set the flags wrong. It should know that mpfr's libs are not in mpfr/.libs but in mpfr/src/.libs, however it passes the former to mpc/configure.

like image 39
Robert Mason Avatar answered Oct 05 '22 20:10

Robert Mason