Math::GMP make test fails.

Discussion in 'Perl Misc' started by Ishmael, Jan 5, 2007.

  1. Ishmael

    Ishmael Guest

    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!
    Ishmael, Jan 5, 2007
    #1
    1. Advertising

  2. Ishmael

    Ishmael Guest

    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.
    Ishmael, Jan 5, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    1,095
  2. Allen Harkleroad
    Replies:
    0
    Views:
    448
    Allen Harkleroad
    Sep 5, 2007
  3. Replies:
    9
    Views:
    523
    DJ Stunks
    Mar 6, 2007
  4. Rahul
    Replies:
    1
    Views:
    138
    Rahul
    Feb 10, 2009
  5. VK
    Replies:
    15
    Views:
    1,125
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page