Problems installing gmp
Marc Glisse
marc.glisse at normalesup.org
Tue Jul 25 16:09:20 CEST 2006
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 libtests.la
>> ../libgmp.la
>> gcc -O2 -m64 -mptr64 -mcpu=ultrasparc3 -o .libs/t-count_zeros
>> t-count_zeros.o ./.libs/libtests.a
>> /usr/local/src/gmp-build/.libs/libgmp.so ../.libs/libgmp.so
>> -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 libgcc_s.so.1 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 libgcc_s.so.1, 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,
--
Marc Glisse
More information about the gmp-bugs
mailing list