[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gmp-bugs
Subject:    problem with using shared library of GMP 5.0.1
From:       Paul.Zimmermann () loria ! fr (Paul Zimmermann)
Date:       2010-09-03 8:00:37
Message-ID: E1OrRCP-0001d7-GH () tarte ! loria ! fr
[Download RAW message or body]

       Torbj?rn,

> If you are building a MPFR shared library, you need to use -fPIC (or
> -fpic) with GCC when compiling MPFR.  GMP uses -fPIC, as you can see
> from a GMP build log.  You also need to link to GMP's shared library,
> not the static library.
> 
> If you add -fPIC to CFLAGS when compiling GMP, you will compile also the
> static library with PIC code, which is harmless except that it will slow
> things down.  (The shared library will then be compiled with -fPIC
> -fPIC.)

sorry for the false alarm. The problem only occurs when I configure GMP with
--disable-shared, and MPFR without any shared/static option:

cd /tmp
/bin/rm -fr gmp-5.0.1*
/bin/rm -fr /tmp/include /tmp/lib
tar jxf ~/download/gmp-5.0.1.tar.bz2
cd gmp-5.0.1
./configure --prefix=/tmp --disable-shared
make -j
make install
cd /tmp
/bin/rm -fr mpfr-3.0.0*
tar jxf ~/download/mpfr-3.0.0.tar.bz2
cd mpfr-3.0.0
./configure --with-gmp=/tmp
make -j

It seems the MPFR configure tries to still build a shared library, even if no
shared GMP library exists. I will report this bug to the MPFR developers :-)

Paul

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic