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

I am having trouble installing Net::SFTP. I could not get the module on PPM, so tried a CPAN'd install. However it dies before completing the install. So far, no success, due to the high number of dependencies.
After going through other people's post on the same topic, I tried to individually install the modules mentioned below and in the exact order (using PPM & CPAN).
Test::More
Math::GMP
String::CRC32
Net::SSH::Perl
Class::Loader
Convert::ASCII::Armour
Crypt::CBC
Crypt::Primes
Crypt::Blowfish
Tie::EncryptedHash
Sort::Versions
Data::Buffer
Digest::BubbleBabble
Crypt::RSA
Crypt::DES
Crypt::DSA
Math::Pari
Crypt::Random
Crypt::DH
Crypt::DES_EDE3
Convert::ASN1
Convert::PEM
Net::SSH::Perl
(both SSH2 and SSH1, 3DES)
Net::SFTP

Since, Net::SSH::Perl is prequisite to Net::SFTP, I installed it using PPM. But again the dependencies are not installed correctly so, it does not work :-(
I have trouble installing Crypt::Primes, Crypt::RSA, Math::Pari, Crypt::Random and Net::SFTP.
While installing Math::Pari on CPAN, I get following error -
CPAN.pm: Going to build I/IL/ILYAZ/modules/Math-Pari-2.010703.tar.gz Did not find GP/PARI build directory around. Do you want to me to fetch GP/PARI automatically? (If you do not, you will need to fetch it manually, and/or direct me + to the directory with GP/PARI source via the command-line option parid +ir=/dir) Make sure you have a large scrollback buffer to see the messages. Fetch? (y/n, press Enter) y Getting GP/PARI from ftp://megrez.math.u-bordeaux.fr/pub/pari/unix/ Available golden versions: `2.1.6 2.1.3 2.1.1 2.1.0 2.1.5 2.1.7 2.1.4 +2.1.2' Latest golden is `pari-2.1.7.tgz' Picking golden version 2.1.7, file pari-2.1.7.tgz Downloading...

And, then it asks me for some patches...which I am unable to understand. What am I suppose to write here?
Looking for patches for 2.1.7... Patching... cd pari-2.1.7 ; patch -p1 < ../patches/patch-pari-unnormalized-float Looks like a unified context diff. File to patch: No file found -- skip this patch? [no] yes Skipping patch... I can't seem to find a patch in there anywhere. cd pari-2.1.7 ; patch -p1 < ../patches/diff_2.1.7_-O Looks like a unified context diff. I can't seem to find a patch in there anywhere. cd pari-2.1.7 ; patch -p1 < ../patches/diff_2.1.7_restart Looks like a unified context diff. The next patch looks like a unified context diff. I can't seem to find a patch in there anywhere. Finished patching... Setting up Math::Pari with Perl 5.008002 on solaris version 2.6; cc=gcc, gccversion=2.95.3 20010315 (release), ccflags='-D_POSIX_PTH +READ_SEMANTICS -D_REENTRANT -DNO_HASH_SEED -fno-strict-aliasing -D_LA +RGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', ld=gcc, ldflags=' ', optimize='-O'. Found GP/PARI build directory in pari-2.1.7 (integer-formatted version 2001007). ...Generating libPARI/paricfg.h ... Scanning header files... ...ulong ...getrusage Creating libPARI/paricfg.h... ...Processor of family `sparcv9' detected Checking if your kit is complete... Looks good ...Processor of family `sparcv9' detected ...I will use assembler build of type 'sparcv8_micro'. ...Assembler is not GNU assembler Writing Makefile for Math::PARI::libPARI Writing Makefile for Math::Pari cp libPARI.dumb.pod blib/lib/Math/libPARI.dumb.pod cp PariInit.pm blib/lib/Math/PariInit.pm cp Pari.pm blib/lib/Math/Pari.pm cp libPARI.pod blib/lib/Math/libPARI.pod cd libPARI && /usr/local/bin/make LIB="" LIBPERL_A="libperl.a" LINKTYP +E="dynamic" PREFIX="" OPTIMIZE="-O" PASTHRU_DEFINE="" PASTHRU_INC="" make[1]: Entering directory `/usr1/duser/.cpan/build/Math-Pari-2.01070 +3/libPARI' /usr1/duser/ActivePerl-5.8/bin/perl -pe1 ../pari-2.1.7/src/kernel/spar +cv8/level0.h ../pari-2.1.7/src/kernel/none/level1.h > pariinl.h

And, then a lot of gcc commands (which I am not pasting here, but can if you want).
make[1]: as: Command not found make[1]: *** [kernel.o] Error 127 make[1]: Leaving directory `/usr1/duser/.cpan/build/Math-Pari-2.010703 +/libPARI' make: *** [libPARI/libPARI.a] Error 2 /usr/local/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible

My environment is -
SunOS 5.8
gcc version 2.95.2 19991024 (release) ....at /usr/local/bin
Pl. help me out!!!

Replies are listed 'Best First'.
Re: Trouble installing Net::SFTP
by u235sentinel (Hermit) on Feb 23, 2006 at 17:14 UTC
    make1: as: Command not found make1: *** kernel.o Error 127

    The short answer. Add /usr/ccs/bin to your path and try again.

    My environment is - SunOS 5.8 gcc version 2.95.2 19991024 (release) ....at /usr/local/bin

    You look like you are close to getting this to work. I've spoken with a few people trying to get this up and running on Solaris 8 and 9. So far I haven't come across anyone who has been successful for a variety of reasons. I've even tried replacing Perl with sunfreeware's Perl (built with gcc), How I resolved it was replacing the Sparc server with a Linux server. I was able to build the environment without (many) problems :-)
    make[1]: Leaving directory `/usr1/duser/.cpan/build/Math-Pari-2.010703 +/libPARI' make: *** [libPARI/libPARI.a] Error 2 /usr/local/bin/make -- NOT OK
    libPARI is a OS library you need installed before you can install the Math-Pari perl module. I had to install it manually before Math-Pari would build properly. I would recommend not installing it with CPAN. I would download the module and build it myself.

    I believe CPAN makes a few presumptions which have caused me grief on occasion. With the high number of dependancies, I had on occasion made a few mistakes when building the modules. I got into the habit of running "make test" after building each module. It's possible a previous module didn't build properly and is affecting you here. Math-Pari IMO was one of the more difficult to build.

    I've written a number of Perl programs using Net::SSH::Perl. Personally I like it however I've run into problems manipulating STDERR (don't ask). I'm close to solving it (I hope). When I searched CPAN I noticed the author (Dave Robins) had stopped developing this and will only release fixes. There is another module he released in January. You might find it useful.

    http://search.cpan.org/~dbrobins/Net-SSH2-0.06/

    Good Luck!
Re: Trouble installing Net::SFTP
by salva (Canon) on Feb 23, 2006 at 08:26 UTC
    Have you tried using Net::SFTP::Foreign instead? It doesn't have any dependency other than the OpenSSH binary client (or the commercial one), which should be already available on your systems!

    The only drawback (or feature?) is that it doesn't support automatic password authentication, you have to use pairs of public and private keys or enter the pasword on the console.

    I am currently rewriting it, improving its performance (it's already much faster than Net::SFTP) and adding several new high level methods as find, glob, rget and rput (recursive versions of get and put). Development versions are already available from CPAN, though they will not be installed automatically by the CPAN module. Feedback about those is very welcome!!!

      The reason I am not using Net::SFTP::Foreign is that I need automatic password authentication. The Perl script is going to be a part of an automated task in my application, so automatic authentication is a must.
      Anyways, thanks a lot!!!
      I still need help on Math::Pari problem :-(

        Whew! I was inspired to install Net::SSH::Perl to try and help troubleshoot another node recently, and it had to install Math::Pari as a prerequisite. Tons of problems! I think my first problem was that I'm on a Mac. HOWEVER, I've finally worked my way through a successful installation, and I think the INSTALL file included in the build directory of Math::Pari might help.... for me, it's located at ~/.cpanplus/5.8.6/build/Math-Pari-2.010703/INSTALL. Following the suggestions for "problem compilations" seemed to help me, with the final outcome:

        Writing /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Math/Pari/ +.packlist Appending installation info to //System/Library/Perl/5.8.6/darwin-thre +ad-multi-2level/perllocal.pod

        Contents of said file included here for your convenience.

        Hope this is somewhat helpful :)



        --chargrill
        $/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );
        But is there any reason to not use pairs of public and private keys for authentication?

        Hard coding ssh password in your scripts is usually a very bad idea. It just means throwing away several of the meassures ssh takes to trust your environment.