gmp w/ mpfr for gcc's f95

Hugh Sasse hgs at dmu.ac.uk
Tue Nov 29 18:49:51 CET 2005


On Tue, 29 Nov 2005, Alex Moore wrote:

> On Tue, 29 Nov 2005 16:52:16 +0000 (WET)
> Hugh Sasse <hgs at dmu.ac.uk> 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, libgmp.so would look correct.
> 
> [asmoore at ra ~]$ nm -D /opt/csw/lib/sparcv9/libgmp.so.3.3.3 |grep
> __gmpz_init 
> [287]   |        118872|         128|FUNC |GLOB |0 |9      |__gmpz_init 
> ...
> 

I get
neelix hgs 100 %> nm -D /usr/local/lib/sparcv9/libgmp.so.3.3.3 | grep __gmpz_init
/usr/ccs/bin/sparcv9/nm: /usr/local/lib/sparcv9/libgmp.so.3.3.3: No such file or directory
neelix hgs 101 %> nm -D /usr/local/lib/libgmp.so.3.3.3 | grep __gmpz_init
[209]   |         78220|          64|FUNC |GLOB |0    |9      |__gmpz_init
[210]   |         78292|          72|FUNC |GLOB |0    |9      |__gmpz_init2
[52]    |         81400|         100|FUNC |GLOB |0    |9      |__gmpz_init_set
[115]   |         81508|          76|FUNC |GLOB |0    |9      |__gmpz_init_set_d
[211]   |         81592|          96|FUNC |GLOB |0    |9      |__gmpz_init_set_si
[352]   |         81696|          72|FUNC |GLOB |0    |9      |__gmpz_init_set_str
[400]   |         81776|          76|FUNC |GLOB |0    |9      |__gmpz_init_set_ui
neelix hgs 102 %>

> 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

Does GNU ld pick that up?
> 
> For gmp and mpfr on sparcv9, I use:
> LD_OPTIONS='-R/opt/csw/lib/sparcv9 -L/opt/csw/lib/sparcv9' ; export
> LD_OPTIONS
> Again on one line.  I use ksh or bash.

OK, I'll try tuning that.
> 
> I will patch libmpfr 2.2.0 on www.blastwave.org very soon with the
> 2005.11.25 cumulative patch set.

I've done that patch on mine already.
> 
> Alex
> 
        Thank you,
        Hugh



More information about the gmp-discuss mailing list