http://www.perlmonks.org?node_id=306589

Plankton has asked for the wisdom of the Perl Monks concerning the following question:

Friends,

I am trying to install Math-GMP-2.03 which is required if I want to install Net::SSH::Perl which is required for Net::SFTP. I have installed gmp from http://www.swox.com/gmp/ with no problem, but when I go to install Math-GMP-2.03 I get this ...
LD_RUN_PATH="/usr/local/lib" gcc -G -L/usr/local/lib GMP.o -o blib/a +rch/auto/Math/GMP/GMP.so -lgmp ld: fatal: file /usr/local/lib/libgmp.so: wrong ELF class: ELFCLASS64 ld: fatal: File processing errors. No output written to blib/arch/auto +/Math/GMP/GMP.so collect2: ld returned 1 exit status make: *** [blib/arch/auto/Math/GMP/GMP.so] Error 1
make error!

Have any of you ran into the problem? If so how did you correct it?

Thanks

Plankton: 1% Evil, 99% Hot Gas.

Replies are listed 'Best First'.
Re: Building Net::SFTP on Solaris problem.
by asarih (Hermit) on Nov 13, 2003 at 02:42 UTC
    GMP was compiled 64-bit. Your Perl is 32-bit. Recompile GMP for 32-bit integers (or you can recompile perl for 64-bit). Consult GMP documentation on how to do it.

    Update: The option is ABI=32, i.e., you should reconfigure GMP by

    ./configure ABI=32
    
    This yields
    gmp-4.1.2$ file .libs/libgmp.so
    .libs/libgmp.so:        ELF 32-bit MSB dynamic lib SPARC32PLUS Version 1, V8+ Required,
    UltraSPARC1 Extensions Required, dynamically linked, not stripped
    
Re: Building Net::SFTP on Solaris problem.
by sunadmn (Curate) on Nov 12, 2003 at 19:25 UTC
    You have a bad binary file so you will need to get a new copy of the GMP source and then attempt to re-compile. I am not sure exactly what the issues is but I had an issue just like this and it was just a bad source tree.

    -sunadmn
    USE PERL