Math::GMP make test fails.



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/home/kstahl/PERL/gmp-4.2.1 -O -DVERSION=\"2.04\"
-KPIC "-I/apps/gnu/perl-5.6.1/lib/sol2.sun4/CORE" GMP.c
Running Mkbootstrap for Math::GMP ()
chmod 644
rm -f blib/arch/auto/Math/GMP/
LD_RUN_PATH="" cc -G -L/usr/local/lib/db3 -L/usr/local/lib
-L/apps/supported/lib/sol2.sun4 GMP.o -o
chmod 755 blib/arch/auto/Math/GMP/
cp blib/arch/auto/Math/GMP/
chmod 644 blib/arch/auto/Math/GMP/
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/' for
Math::GMP: /usr/local/bin/perl: fatal: relocation error:
__gmpz_init_set_str: referenced symbol not found at
/apps/gnu/perl-5.6.1/lib/sol2.sun4/ 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.

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 is right there, as
expected. Any help with this will be greatly appreciated. Thanks!


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

ld: fatal: file /home/kstahl/PERL/gmp-4.2.1/lib/ wrong ELF

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

Latest member

Latest Threads