gmp w/ mpfr for gcc's f95

Alex Moore asmoore at
Tue Nov 29 18:41:50 CET 2005

On Tue, 29 Nov 2005 16:52:16 +0000 (WET)
Hugh Sasse <hgs at> wrote:

> configure --with-gmp=/usr/local gave:
> checking for gmp.h... yes
> checking for recent GMP... yes
> checking for gmp internal files... no
> checking for working alloca.h... yes
> checking for alloca... yes
> checking for __gmpz_init in -lgmp... no
> configure: error: libgmp not found
> neelix hgs 88 %>

That is confusing that he found part of gmp, but not the library.  If
you do the following, replacing /opt/csw with /usr/local, then it still
does not make sense.  But at least, would look correct.

[asmoore at ra ~]$ nm -D /opt/csw/lib/sparcv9/ |grep
[287]   |        118872|         128|FUNC |GLOB |0 |9      |__gmpz_init 

Both of the above lines should be on one line.

For some reason, I build mpfr and gmp with LD_OPTIONS containing
part of what I normally define in LDFLAGS, i.e., '-L /opt/csw/lib'.  So
you might try that.  On Solaris, LDFLAGS with '-L<lib directory>' is
normally for the compiler to search for libraries.  LD_OPTIONS is
normally the run-time library search path beyond the normal system
search path.  LD_OPTIONS is '-R<lib directory>:<lib directory>...'  See
man ld

For gmp and mpfr on sparcv9, I use:
LD_OPTIONS='-R/opt/csw/lib/sparcv9 -L/opt/csw/lib/sparcv9' ; export
Again on one line.  I use ksh or bash.

I will patch libmpfr 2.2.0 on very soon with the
2005.11.25 cumulative patch set.


More information about the gmp-discuss mailing list