Unable to install Math::BigInt::GMP on Solaris 10

S

sumitbee

Hello Guru's:

Make fails on both version 1.18 and 1.19. I am trying to install this
to speed up Net::SSH::perl, since that is unbearably slow with the
pure perl libraries, or even Math::BigInt::pari, or
Math::BigInt::FastCalc. here is what I get when I run make:
--------------------------------------------------------------------------------------------------------------------
bash-3.00# perl Makefile.PL
Note (probably harmless): No library found for -lgmp
YAML not installed, make dist will not override metafile at
Makefile.PL line 8.
Writing Makefile for Math::BigInt::GMP
bash-3.00# make
cp lib/Math/BigInt/GMP.pm blib/lib/Math/BigInt/GMP.pm
/usr/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp -typemap /usr/
perl5/5.8.4/lib/ExtUtils/typemap -typemap typemap GMP.xs > GMP.xsc &&
mv GMP.xsc GMP.c
cc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -
D_TS_ERRNO -xO3 -xspace -xildoff -DVERSION=\"1.19\" -DXS_VERSION=
\"1.19\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"
GMP.c
"GMP.xs", line 4: cannot find include file: "gmp.h"
"GMP.c", line 40: undefined symbol: mpz_t
"GMP.c", line 40: undefined symbol: RETVAL
"GMP.xs", line 34: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 35: warning: implicit function declaration:
mpz_init_set_str
"GMP.xs", line 35: cannot dereference non-pointer type
"GMP.c", line 59: undefined symbol: mpz_t
"GMP.c", line 59: undefined symbol: RETVAL
"GMP.xs", line 47: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 48: cannot dereference non-pointer type
"GMP.c", line 78: undefined symbol: mpz_t
"GMP.c", line 78: undefined symbol: RETVAL
"GMP.xs", line 60: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 61: cannot dereference non-pointer type
"GMP.c", line 97: undefined symbol: mpz_t
"GMP.c", line 97: undefined symbol: RETVAL
"GMP.xs", line 73: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 74: cannot dereference non-pointer type
"GMP.c", line 115: undefined symbol: mpz_t
"GMP.c", line 115: undefined symbol: RETVAL
"GMP.xs", line 85: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 86: warning: implicit function declaration:
mpz_init_set_ui
"GMP.xs", line 86: cannot dereference non-pointer type
"GMP.c", line 133: undefined symbol: mpz_t
"GMP.c", line 133: undefined symbol: RETVAL
"GMP.xs", line 97: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 98: cannot dereference non-pointer type
"GMP.c", line 151: undefined symbol: mpz_t
"GMP.c", line 151: undefined symbol: RETVAL
"GMP.xs", line 109: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 110: cannot dereference non-pointer type
"GMP.c", line 169: undefined symbol: mpz_t
"GMP.c", line 169: undefined symbol: RETVAL
"GMP.xs", line 121: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 122: cannot dereference non-pointer type
"GMP.c", line 188: undefined symbol: mpz_t
"GMP.c", line 188: undefined symbol: n
"GMP.c", line 192: syntax error before or at: )
"GMP.xs", line 135: warning: implicit function declaration: mpz_clear
"GMP.xs", line 135: cannot dereference non-pointer type
"GMP.xs", line 136: warning: improper pointer/integer combination: arg
#1
"GMP.c", line 212: undefined symbol: mpz_t
"GMP.c", line 212: undefined symbol: n
"GMP.c", line 223: syntax error before or at: )
"GMP.xs", line 151: warning: implicit function declaration:
mpz_sizeinbase
"GMP.xs", line 151: cannot dereference non-pointer type
"GMP.xs", line 156: warning: implicit function declaration:
mpz_get_str
"GMP.xs", line 156: cannot dereference non-pointer type
"GMP.c", line 254: undefined symbol: mpz_t
"GMP.c", line 254: undefined symbol: n
"GMP.c", line 267: syntax error before or at: )
"GMP.xs", line 184: warning: implicit function declaration: mpz_tstbit
"GMP.xs", line 184: cannot dereference non-pointer type
"GMP.xs", line 189: cannot dereference non-pointer type
"GMP.xs", line 194: cannot dereference non-pointer type
"GMP.c", line 316: undefined symbol: mpz_t
"GMP.c", line 316: undefined symbol: n
"GMP.c", line 326: syntax error before or at: )
"GMP.xs", line 230: cannot dereference non-pointer type
"GMP.xs", line 235: cannot dereference non-pointer type
"GMP.c", line 353: undefined symbol: mpz_t
"GMP.c", line 353: undefined symbol: n
"GMP.c", line 363: syntax error before or at: )
"GMP.xs", line 253: cannot dereference non-pointer type
"GMP.xs", line 258: cannot dereference non-pointer type
"GMP.c", line 390: undefined symbol: mpz_t
"GMP.c", line 390: undefined symbol: n
"GMP.c", line 400: syntax error before or at: )
"GMP.xs", line 276: cannot dereference non-pointer type
"GMP.xs", line 281: cannot dereference non-pointer type
"GMP.c", line 427: undefined symbol: mpz_t
"GMP.c", line 427: undefined symbol: n
"GMP.c", line 428: operands must have arithmetic type: op "*"
"GMP.c", line 429: undefined symbol: mod
"GMP.c", line 430: undefined symbol: RETVAL
"GMP.c", line 434: syntax error before or at: )
"GMP.c", line 441: syntax error before or at: )
"GMP.c", line 448: syntax error before or at: )
"GMP.xs", line 296: warning: improper pointer/integer combination: op
"="
"GMP.xs", line 296: warning: implicit function declaration: mpz_init
"GMP.xs", line 296: cannot dereference non-pointer type
"GMP.xs", line 297: warning: implicit function declaration: mpz_powm
"GMP.xs", line 297: cannot dereference non-pointer type
"GMP.xs", line 297: cannot dereference non-pointer type
"GMP.xs", line 297: cannot dereference non-pointer type
"GMP.c", line 460: cannot recover from previous errors
cc: acomp failed for GMP.c
*** Error code 2
make: Fatal error: Command failed for target `GMP.o'
bash-3.00#
--------------------------------------------------------------------------------------------------------------------

Version 1.18 gives similar errors. Any suggestions/advice would be
much appreciated!

Sumit
 
D

DJ Stunks

Make fails on both version 1.18 and 1.19.
<snip>
bash-3.00# perl Makefile.PL
Note (probably harmless): No library found for -lgmp
YAML not installed, make dist will not override metafile at
Makefile.PL line 8.
Writing Makefile for Math::BigInt::GMP

Why does the creation of the makefile for Math::BigInt::GMP say that
not finding the gmp library is "probably harmless"? Seems like it
should be critical to me...

-jp
 
S

sumitbee


Mark, DJ, Thank you for your comments. mark, Math::BigInt is
installed and tests succeed. I am on Solaris, and cannot seem to find
the GMP header files. From the Tel test results, it seems that v.
1.18 was the only one that passed tests on Solaris, but that is
failing for me as well. Has anyone been able to install this on
Solaris? Any other ideas as to how to speed up Net::SSH::perl?

Thanks again,
Sumit
 
S

Sisyphus

..
..
JP, thanks for the update. I installed gmp-4.1.2, changed the
LD_LIBRARY_PATH_64 and made sure the libgmp files were in /usr/local/
lib/sparcv9, but same problem.....

Try hacking at the XS file. Where it says:

#include "gmp.h"

Change that to:

#include "/usr/local/include/sparcv9/gmp.h" // if that's where gmp.h is
located

That should at least allow gmp.h to get found. Then it's just a matter of
making libgmp.a (or the gmp .so) findable.

Probably the simplest way to build it is to do it manually. Download the
M:::BI::GMP-1.19 source from CPAN, extract to some location, cd to that
location and run:

perl Makefile.PL INC="-I/usr/local/include/sparcv9"
LIBS="-L/usr/local/lib/sparcv9 -lgmp"
make test
make install

If you don't have a 'libgmp.a' then you should be able to link directly to
the libgmp-3.so (or whatever it's called) but you would need to change the
above command to properly reflect the name of the gmp .so file. Something
like:

perl Makefile.PL INC="-I/usr/local/include/sparcv9"
LIBS="-L/usr/local/lib/sparcv9 -lgmp-3"

All of this is, of course, untested.

Is there something there that works for you ? (You should at least be able
to eradicate the error about gmp.h being not found - assuming it really is
in /usr/local/include/sparcv9.)

Cheers,
Rob
 
S

sumitbee

.
.




Try hacking at the XS file. Where it says:

#include "gmp.h"

Change that to:

#include "/usr/local/include/sparcv9/gmp.h" // if that's where gmp.h is
located

That should at least allow gmp.h to get found. Then it's just a matter of
making libgmp.a (or the gmp .so) findable.

Probably the simplest way to build it is to do it manually. Download the
M:::BI::GMP-1.19 source from CPAN, extract to some location, cd to that
location and run:

perl Makefile.PL INC="-I/usr/local/include/sparcv9"
LIBS="-L/usr/local/lib/sparcv9 -lgmp"
make test
make install

If you don't have a 'libgmp.a' then you should be able to link directly to
the libgmp-3.so (or whatever it's called) but you would need to change the
above command to properly reflect the name of the gmp .so file. Something
like:

perl Makefile.PL INC="-I/usr/local/include/sparcv9"
LIBS="-L/usr/local/lib/sparcv9 -lgmp-3"

All of this is, of course, untested.

Is there something there that works for you ? (You should at least be able
to eradicate the error about gmp.h being not found - assuming it really is
in /usr/local/include/sparcv9.)

Cheers,
Rob

Rob, thanks. I'll try it out on Monday and let you know.

Cheers,
Sumit
 
S

sumitbee

Rob, thanks. I'll try it out on Monday and let you know.

Cheers,
Sumit- Hide quoted text -

- Show quoted text -

Rob,

Changing the include to the full path to gmp.h in the xs file and
creating the makefile with the INC and LIB options as you suggested
worked. I am still getting errors on "make test" but thats a different
issue. Thanks a lot for your help!

Thanks to all others that replied as well.

Sumit
 
S

sumitbee

The solution, for anyone interested, was to install GNU make 3.81,
compile gmp-4.2 with this version of make, and then install
Math::BigInt::GMP pointing the lib and INC to the location of the
newly installed gmp-4.2.
 
D

DJ Stunks

The solution, for anyone interested, was to install GNU make 3.81,
compile gmp-4.2 with this version of make, and then install
Math::BigInt::GMP pointing the lib and INC to the location of the
newly installed gmp-4.2.

It's good to know you got it to work, but I would suggest that this
post is going to be nearly useless to some future googler unless they
come across your OP first AND the thread remains intact. In the
future perhaps you could consider full-quoting your OP and posting the
solution below.

We've all Googled issues like this but, as I'm sure you know, all one
normally finds is other people with the same problem.

$0.02
-jp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top