This is the mail archive of the
mailing list for the GCC project.
RE: gfortan requires old directory in LD_LIBRARY_PATH or else gmp error
- From: "Poor Yorick" <org dot gnu dot gcc dot help at pooryorick dot com>
- To: gcc-help at gnu dot org
- Date: Thu, 22 Nov 2007 15:07:28 +0000
- Subject: RE: gfortan requires old directory in LD_LIBRARY_PATH or else gmp error
- Reply-to: "Poor Yorick" <org dot gnu dot gcc dot help at pooryorick dot com>
> From: Rupert Wood <firstname.lastname@example.org>
> Poor Yorick wrote:
> > Why does the newly-compiled gfortran need this old path in
> > LD_LIBRARY_PATH to function?
> It looks like it's because you built shared-library-only versions of GMP and MPFR with the old compiler which now depend on the old compiler's runtime libraries. gfortran depends on GMP and MPFR and so you must have the old compiler's runtime libraries in your path to run gfortran.
> One solution might be to replace your GMP and MPFR .sos with new versions built with your new compiler. Alternatively you could make sure you have static versions of them and rebuild GCC 4.2, checking it picks up the static versions not the shared libraries which should not have the dependence.
I have gmp and mpfr built as both static and dynamic libraries, and those libraries reside in the same directory. So far, the only way I can get a clean (no LD_LIBRARY_PATH dependency on preexisting gcc) build of gcc is if I remove the dynamic libraries of gmp and mpfr. Short of not building the shared objects, is there some other way to tell gcc to pull in gmp.a and mpfr.a? Otherwise, it sounds like the following is the way to go:
1. build gmp and mpfr static only
2. build gcc
3. remove gmp and mpfr
4. build gmp and mpfr this time with new gcc, shared and static