14
votes

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.

6

6 Answers

28
votes

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

9
votes

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.

3
votes

Try this while configuring:

./configure --prefix=<DIR YOU WANT TO INSTALL GCC> \
--with-gmp=<DIRECTORY YOU INSTALLED GMP> \
--with-mpc=<MPC DIR> --with-mpfr=<MPFR DIR>
3
votes

I've had the same problem for a few hours, but I solved it in another other way.

I've deleted all old folders like gcc-4.* and gcc-build, because there was an old configuration inside. After that, I checked out again with version-check.sh if everything was in the right location.

I used Debian and it was missing bison and gnu awk! Why whatever. I installed the two again and started with installing gcc. Now everything is OK.

Perhapse you have a similar problam which can be solved in the same manner. I have to check every time when I start vbox and maybe it is a problem with my vbox-image, so when I start vbox I run a versions-check.

2
votes

instead of --with-mpfr=, I used --with-mpfr-lib=your-mprf-dir/lib(64?) --with-mpfr-include=your-mprf-dir/include.

This works for me. PS: mprf-3.1.0 gmp-5.0.2 mpc-0.9

1
votes

No need you can try like this:

./configure \
--with-gmp=/opt/install/local\
--with-mpfr=/opt/install/local \
--with-mpc=/opt/install/local \
--with-gmp-include=/opt/install/build/gmp-6.0.0 \
--with-mpfr-include=/opt/install/build/mpfr-3.1.2/src \
--with-mpc-include=/opt/install/build/mpc-1.0.2/src --enable-languages=c,c++