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

Hi monks
I am trying to compile Net::SSH::Perl 1.34.. I compiled it, but when i run a script to SSH using Net:SSH::Perl, i get the following error
Can't locate Math/Pari.pm in @INC (@INC contains: /usr/local/lib/perl5 +/5.8.8/sun4-solaris /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/s +ite_perl/5.8.8/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.8 /usr +/local/lib/perl5/site_perl .) at /usr/local/lib/perl5/site_perl/5.8.8 +/Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +8.8/Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.8/ +Net/SSH/Perl/Util.pm line 56, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +8.8/Net/SSH/Perl/Kex/DH1.pm line 10, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.8/ +Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +8.8/Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.8/ +Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +8.8/Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.8/ +Net/SSH/Perl.pm line 52, <GEN0> line 1.

So, i tried installing Math-GMP, but before that i needed the GMP-libraries.. So, i did an installation of the GMP libraries(gmp-4.3.2.tar.bz2).. This gave no issues or errors, but when i tried installing Math-GMP(Math-GMP-2.06.tar.gz), it gives me an 'wrong ELF class' error...
make gcc -c -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/ +usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFS +ET_BITS=64 -O -DVERSION=\"2.06\" -DXS_VERSION=\"2.06\" -fPIC "-I/ +usr/local/lib/perl5/5.8.8/sun4-solaris/CORE" GMP.c Running Mkbootstrap for Math::GMP () chmod 644 GMP.bs rm -f blib/arch/auto/Math/GMP/GMP.so LD_RUN_PATH="/usr/local/lib" gcc -G -L/usr/local/lib -L/opt/gnu/lib G +MP.o -o blib/arch/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 *** Error code 1 make: Fatal error: Command failed for target `blib/arch/auto/Math/GMP/ +GMP.so'

I read in some forums that this is caused due to 32/64 bit compatibility, but dont know how to resolve this..

Can somebody help me out?? Is there any other way to install the Net::SSH::Perl module or any other Perl module to do SSH(which has a hassle free installation)

Regards,
Blub:)



PS:-All this is done in Sun Solaris, Perl 5.8.8 and gcc 3.4.6

Replies are listed 'Best First'.
Re: Compiling Net::SSH::Perl
by salva (Canon) on Jun 07, 2010 at 08:12 UTC
    Is there any other way to install the Net::SSH::Perl module or any other Perl module to do SSH

    Try Net::OpenSSH, it requires a recent version of the OpenSSH client (that you can get from Sun Freeware) and, if you plan to use password authentication, Expect.

    Net::SSH2 is another option.

      if you plan to use password authentication,
      Does this mean that Password authentication is not supported in Net::OpenSSH??
        Password authentication is supported by Net::OpenSSH, it's just that it uses Expect (well, actually IO::Pty) for supporting it.
Re: Compiling Net::SSH::Perl
by Khen1950fx (Canon) on Jun 07, 2010 at 08:18 UTC
    Is there a particular reason why you didn't use gmp-5.0.1? I would try reinstalling it, but do a native compilation to avoid a wrong ELF. For example:
    ./configure --build=ultrasparc-sun-solaris2.7
      Well, as 5.0.1 is the latest version, i figured, would have many bugs?
      silly me
      Anyway, will try that out now, thanks, Khen1950
      Regards,
      Blub:)
Re: Compiling Net::SSH::Perl
by opensourcer (Monk) on Jun 07, 2010 at 08:04 UTC
    you have set the LD_LIBRARY_PATH (e.g export LD_LIBRARY_PATH="64/32 bit lib path).
Re: Compiling Net::SSH::Perl
by Anonymous Monk on Nov 14, 2010 at 15:33 UTC
    HI please help in that ,i am also facing the same problem in installing Net::SSH:win32perl please mail me npreddy1223@gmail.com Thanks Advance Pandu