Math::GMP make test fails.

I

Ishmael

I am trying to compile the Math::GMP module locally (not as root). I
have successfully built gmp-4.2.1, but am having trouble getting the
Perl wrapper to work. I am doing the following:

perl Makefile.PL PREFIX=/home/kstahl/PERL/Math-GMP-2.04

Here, I receive the following messages:

Note (probably harmless): No library found for -lgmp
Writing Makefile for Math::GMP

Now in order to point Make in the right direction to find my
installation of gmp, I edited the Makefile, and added the correct path
to CCFLAGS, i.e. the last entry below:

CCFLAGS = -I/usr/local/include/db3 -I/usr/local/include
-I/apps/supported/include -I/home/kstahl/PERL/gmp-4.2.1

Then I run make and get these messages:
cc -c -I/usr/local/include/db3 -I/usr/local/include
-I/apps/supported/include
-I/home/kstahl/PERL/gmp-4.2.1 -O -DVERSION=\"2.04\"
-DXS_VERSION=\"2.04\"
-KPIC "-I/apps/gnu/perl-5.6.1/lib/sol2.sun4/CORE" GMP.c
Running Mkbootstrap for Math::GMP ()
chmod 644 GMP.bs
rm -f blib/arch/auto/Math/GMP/GMP.so
LD_RUN_PATH="" cc -G -L/usr/local/lib/db3 -L/usr/local/lib
-L/apps/supported/lib/sol2.sun4 GMP.o -o
blib/arch/auto/Math/GMP/GMP.so
chmod 755 blib/arch/auto/Math/GMP/GMP.so
cp GMP.bs blib/arch/auto/Math/GMP/GMP.bs
chmod 644 blib/arch/auto/Math/GMP/GMP.bs
Manifying blib/man3/Math::GMP.3pm

It looks like everything worked, but then I run 'make test' and get the
following errors:
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"

"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/gmppm....Can't load
'/home/kstahl/PERL/Math-GMP-2.04/blib/arch/auto/Math/GMP/GMP.so' for
module
Math::GMP: ld.so.1: /usr/local/bin/perl: fatal: relocation error:
file
/home/kstahl/PERL/Math-GMP-2.04/blib/arch/auto/Math/GMP/GMP.so:
symbol
__gmpz_init_set_str: referenced symbol not found at
/apps/gnu/perl-5.6.1/lib/sol2.sun4/DynaLoader.pm line 206.
at t/gmppm.t line 7
Compilation failed in require at t/gmppm.t line 7.
BEGIN failed--compilation aborted at t/gmppm.t line 7.
t/gmppm....dubious

Test returned status 255 (wstat 65280, 0xff00)
FAILED--1 test script could be run, alas--no output ever seen
make: *** [test_dynamic] Error 255

I checked in the directory shown above, and GMP.so is right there, as
expected. Any help with this will be greatly appreciated. Thanks!
 
I

Ishmael

Thank you for the very helpful and incredibly prompt response.
Everything compiled beautifully.

In case someone else reads this, I should mention one other problem
that I had to solve before this package finally passed 'make test'.
The problem comes from the compilation of the C gmp package that the
Perl code rests on. While that compilation came up error-free on my
machine (even after running 'make check'), when I ran 'make test' from
the Perl package, I ended up with errors along the lines of the
following:

ld: fatal: file /home/kstahl/PERL/gmp-4.2.1/lib/libgmp.so: wrong ELF
class:
ELFCLASS64

These problems apparently stem from incompatibilities in the libraries.
I am running on a Unix platform with Solaris 5.8 and perl 5.6.1. I
don't know what exactly the problem is, but the solution is to compile
gmp in 32 bit mode, but adding the ABI=32 option when running
configure. After doing this, the Perl module compiled error-free.
 

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,754
Messages
2,569,520
Members
44,996
Latest member
rainocode

Latest Threads

Top