Bug 49137 - build fails when gmp/mpfr already installed
Summary: build fails when gmp/mpfr already installed
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.5.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2011-05-24 10:45 UTC by Cezary Sliwa
Modified: 2022-01-08 10:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cezary Sliwa 2011-05-24 10:45:34 UTC
When gmp/mpfr are already installed _and_ their sources have been unpacked into the gcc source directory, building mpfr fails due to gmp.h not found.

I would expect such a scenario when building and using the supplied gmp/mpfr sources is preferred over the installed (system) libraries, which typically are outdated (but cannot be uninstalled due to dependencies).

FreeBSD 8.1 i386

the configure command line was

../gcc-4.5.3/configure --prefix=${HOME}/opt/gcc/4.5.3 --enable-languages=c,c++,fortran
Comment 1 Andrew Pinski 2011-12-16 00:35:49 UTC
Hmm, I already have gmp and mpfr already installed but I also use the sources inside the source directory, it works for me and uses the newly compiled ones too.
Comment 2 Cezary Sliwa 2011-12-16 12:17:18 UTC
tar jxf gcc-4.5.3.tar.bz2
tar jxf gmp-4.3.2.tar.bz2
tar jxf mpfr-3.0.0.tar.bz2
tar zxf mpc-0.9.tar.gz
patch -p1 -d mpfr-3.0.0 <mpfr-3.0.0-p8.diff
cd gcc-4.5.3
ln -s ../gmp-4.3.2 gmp
ln -s ../mpfr-3.0.0 mpfr
ln -s ../mpc-0.9 mpc
cd ..
mkdir objdir-4.5.3
cd objdir-4.5.3/
../gcc-4.5.3/configure --prefix=${HOME}/opt/gcc/4.5.3 --enable-languages=c,c++,fortran
gmake


fails with:


checking for gmp.h... no
configure: error: gmp.h can't be found, or is unusable.
gmake[2]: *** [configure-stage1-mpfr] Error 1
gmake[2]: Leaving directory `/usr/home/sliwa/src/gcc/objdir-4.5.3'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/usr/home/sliwa/src/gcc/objdir-4.5.3'
gmake: *** [all] Error 2


$ ls -l gmp/gmp.h
-rw-r--r--  1 sliwa  users  84253 Dec 16 14:12 gmp/gmp.h
$ ls -l gmp/.libs/
total 1778
-rw-r--r--  1 sliwa  users  1801182 Dec 16 14:13 libgmp.a
lrwxr-xr-x  1 sliwa  users       12 Dec 16 14:13 libgmp.la -> ../libgmp.la
-rw-r--r--  1 sliwa  users      752 Dec 16 14:13 libgmp.lai
Comment 3 Andrew Pinski 2022-01-08 10:28:01 UTC
mpfr-3.1.0 and above are required to build in source for GCC 4.5.2/4.5.3 which is why it is failing.  See PR 44455 for the details on why.

Anyways closing as works for me.