Re: completely unable to get Gcc 4.4.5 to build with local Gmp/Mpfr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Dec 28, 2010 at 12:50:58PM +0000, Philip Herron wrote:
> Hey
> 
> I would reccomend doing:
> 
> $ wget -c ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.bz2
> $ tar jxvf gmp-5.0.1.tar.bz2
> $ cd gmp
> $ ./configure --prefix=$HOME/lib
> $ make
> $ make install
> $ cd ../
> 
> $ wget -c http://www.mpfr.org/mpfr-current/mpfr-3.0.0.tar.bz2
> $ tar jxvf ....
> $ CFLAGS="$CFLAGS -I$HOME/lib/include -L$HOME/lib/lib"
> $ ./configure --prefix=$HOME/lib
> ... That should hopefully work if not i will test it out
> 

Should work; but that's not a problem, we install Gmp and Mpfr for our
own library ("platform", a bit like Sage, but (of course) much bigger ;-)),
and that all works fine.

The problem is the gcc-build.

> Get the gcc sources:
> 
> $ wget -c ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.4.5/gcc-4.4.5.tar.bz2
> $ tar jxvf gcc-4.4.5.tar.bz2
> $ mkdir gcc-build
> $ cd gcc-build
> $ ../gcc-4.4.5/configure --with-gmp-include=$HOME/lib/include
> --with-gmp-lib=$HOME/lib/lib --with-mpfr-include=$HOME/lib/include
> --with-mpfr-lib=$HOME/lib/lib
> $ make
> 

This doesn't work, since when running gcc (or gfortran, which also with e.g. 4.2.4
depends on Gmp/Mpfr) then it doesn't have the linking information, and the gcc-build
runs the internally build gcc/gfortran for building libraries itself --- one could imagine that
gcc sets the dynamic linker paths itself (since it knows about gmp/mpfr), but it doesn't.

We tried all form of environment variables to pass linker-information to the gcc-build,
but that seems all to be ignored when gcc builds its libraries (to find out about that,
one shouldn't forget to disable the system gmp and mpfr which are often (but not always!)
available).

As Jonathan pointed out, forcing static libraries when building gmp, mpfr should 
solve these problems.

> And see what happens. I know you can chuck the gmp and mpfr sources
> into the gcc dir but the gcc build system is sometimes picky :)
> 

This seems to work now (didn't complete it yet due to these command-line-length problems,
but it looks otherwise alright).

Thanks!

Oliver



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux