Bug 18496 - Build fails with "libgmp.so.6 not found" error
Summary: Build fails with "libgmp.so.6 not found" error
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: build
Depends on:
Reported: 2004-11-15 06:26 UTC by Jim
Modified: 2005-11-04 17:55 UTC (History)
2 users (show)

See Also:
Host: alpha-unknown-netbsd1.6.2
Target: alpha-unknown-netbsd1.6.2
Build: alpha-unknown-netbsd1.6.2
Known to work:
Known to fail:
Last reconfirmed: 2005-05-01 14:32:10


Note You need to log in before you can comment on or make changes to this bug.
Description Jim 2004-11-15 06:26:18 UTC
I have libgmp and libmpfr installed with an atypical prefix (not /usr/local or
/usr) on the build machine because I do not have adminstrative rights.  I
invoked configure as

../gcc/configure --with-mpfr=/sys/sdf/sci --with-gmp=/sys/sdf/sci

The build progresses normally for a great while and then dies with the error

-B/sys/sdf/sci/alpha-unknown-netbsd1.6.2./lib/ -isystem
/sys/sdf/sci/alpha-unknown-netbsd1.6.2./include -isystem
/sys/sdf/sci/alpha-unknown-netbsd1.6.2./sys-include -DHAVE_CONFIG_H -I.
-I../../../gcc/libgfortran -I. -I../../../gcc/libgfortran/io -O2 -g -O2 -mieee
-std=gnu99 -O2 -g -O2 -mieee -c
../../../gcc/libgfortran/intrinsics/reshape_packed.c -o reshape_packed.o
>/dev/null 2>&1
Shared object "libgmp.so.6" not found
make[2]: *** [selected_int_kind.lo] Error 1
make[1]: *** [all] Error 2
make: *** [all-target-libgfortran] Error 2
/bin/sh ./libtool --mode=compile /sys/sdf/src/sci/gcc-cvs/gcc-build/gcc/gfortran
-B/sys/sdf/sci/alpha-unknown-netbsd1.6.2./lib/ -isystem
/sys/sdf/sci/alpha-unknown-netbsd1.6.2./include -isystem
/sys/sdf/sci/alpha-unknown-netbsd1.6.2./sys-include  -Wall -fno-repack-arrays
-fno-underscoring -c -o selected_int_kind.lo `test -f
'intrinsics/selected_int_kind.f90' || echo
-B/sys/sdf/sci/alpha-unknown-netbsd1.6.2./lib/ -isystem
/sys/sdf/sci/alpha-unknown-netbsd1.6.2./include -isystem
/sys/sdf/sci/alpha-unknown-netbsd1.6.2./sys-include -Wall -fno-repack-arrays
-fno-underscoring -c ../../../gcc/libgfortran/intrinsics/selected_int_kind.f90 
-fPIC -DPIC -o .libs/selected_int_kind.o
make[2]: Leaving directory
make[1]: Leaving directory

Examining the config.log in libgfortran, I found the following error

configure:4504:  /sys/sdf/src/sci/gcc-cvs/gcc-build/gcc/gfortran -B/sys/sdf/src/
sci/gcc-cvs/gcc-build/gcc/ -B/sys/sdf/sci/alpha-unknown-netbsd1.6.2./bin/ -B/sys
/sdf/sci/alpha-unknown-netbsd1.6.2./lib/ -isystem /sys/sdf/sci/alpha-unknown-net
bsd1.6.2./include -isystem /sys/sdf/sci/alpha-unknown-netbsd1.6.2./sys-include -
c   conftest.F >&5 
Shared object "libgmp.so.6" not found
configure:4510: $? = 1  
configure: failed program was:
|       program main
| #ifndef __GNUC__
|        choke me
| #endif
|       end
configure:4536: result: no
Comment 1 Andrew Pinski 2004-11-15 14:12:37 UTC
Does setting LD_LIBRARY_PATH to /sys/sdf/sci help?

I don't know if we can count this as a bug or not.
Comment 2 Jim 2004-11-15 21:55:33 UTC
Subject: Re:  Build fails with "libgmp.so.6 not found" error

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-15 14:12 -------
> Does setting LD_LIBRARY_PATH to /sys/sdf/sci help?

I tried setting LD_LIBRARY_PATH but it was after the configure step.  I
will try again with LD_LIBRARY_PATH set before I run configure.  I will
also check to see which version of libtool the system is running--that
might be a problem.

> I don't know if we can count this as a bug or not.

I guess it depends where the problem is.  If the configure script is not
properly setting the linker flags, I would think that is a bug.  I don't
think it is a bug inherent in gcc or libgfortran.


Comment 3 Jim 2004-11-16 02:41:41 UTC
I attempted the build again execpt that I set LD_LIBRARY_PATH=/sys/sdf/sci/lib
before the first configure and it now builds to completion.  Is this buggy
behaviour or the intended behaviour?  One part of the configure process uses the
path specified by --with-gmp= to resolve the libaries.  The configure process
for libgfortran does not.  My $0.02 is that it should be consistent, but I may
be missing a subtle point.
Comment 4 Tobias Schlüter 2004-12-02 21:08:44 UTC
I'm thinking that this is a real issue with gfortran's configury: if we're able
to link against gmp we should also be able to run the resulting binary.
Comment 5 Tobias Schlüter 2004-12-02 21:10:11 UTC
Um, since I didn't reproduce the failure myself I'm not sure if I should have
confirmed this bug. I don't see a way to set this back, so I'm going to have to
leave this as confirmed.
Comment 6 Francois-Xavier Coudert 2005-11-04 17:55:08 UTC
This was never confirmed with this exact error, and I've done quite some testing/debuging and did not experience that particular bug. I think this bug was "superseded" by PR21547, which I am currently fixing. Closing this one as WORKSFORME.