Problems installing gmp

Herve Pages hpages at
Tue Jul 25 18:32:58 CEST 2006

Hi Marc,

Thanks for the detailed explanation. I don't have any background either
on mix 32-bit/64-bit systems nor on Solaris (I was just asked to help to 
gcc 3.5 to 4.1.1 on our Solaris server). Therefore my inability to 
the ld issue I have with my 64-bit build of GMP.
I will re-read your email more carefully during the day, try what you 
and let you know if it worked.


Marc Glisse wrote:
> On Mon, 24 Jul 2006, Marc Glisse wrote:
>>>    /usr/local/bin/bash ../libtool --mode=link gcc  -O2 -m64 -mptr64
>>>    -mcpu=ultrasparc3   -o t-count_zeros  t-count_zeros.o
>>>    ../
>>>    gcc -O2 -m64 -mptr64 -mcpu=ultrasparc3 -o .libs/t-count_zeros
>>>    t-count_zeros.o  ./.libs/libtests.a
>>>    /usr/local/src/gmp-build/.libs/ ../.libs/
>>>    -R/usr/local/lib
>> Where is this -R/usr/local/lib coming from ? Very bad idea. It should be
>> /usr/local/lib/sparcv9 if anything.
> Ok more details. configure defaults PREFIX to /usr/local and libdir to 
> PREFIX/lib. This causes plenty of issues on biarch. It is a bad idea 
> (say forbidden) to mix 32 bits and 64 bits libraries in the same 
> directory. /usr/local/lib is for 32 bits libraries (at least that is 
> what your version of gcc decided), and this same version of gcc 
> probably uses /usr/local/lib/sparcv9 for 64 bits libraries. So from 
> now on, you should specify --libdir=/usr/local/lib/sparcv9 to 
> configure every time you build a 64 bits program that you want to 
> install directly in /usr/local. You could also install gmp elsewhere, 
> using --prefix=/opt/gmp-4.2.1-v9.
> Actually, the solaris runtime linker is clever enough to ignore 
> versions of a library that don't have the right class (say 32 bits 
> instead of 64), as long as it can find the right version. In your case 
> it cannot, which means your gcc installation has bad specs (it should 
> make sure the place where is installed is in a path that 
> is looked at at runtime). One way many people deal with this is by 
> using crle to add /usr/local/lib(/sparcv9) to the default library 
> path, although I would not recommand it.
>> set LD_LIBRARY_PATH_64 to the directory with the right, at
>> runtime.
> I believe this is the easiest solution (set this variable in the 
> environment), the cleanest solution being to have the right -R flags.
> Hope this helped,

Hervé Pagès
E-mail: hpages at
 Phone: (206) 667-5791
   Fax: (206) 667-1319

More information about the gmp-bugs mailing list