clerew has asked for the wisdom of the Perl Monks concerning the following question:
Forgive me Father, for I have HACKED.
Well, I suppose that should have been whispered in the ear of the Abbott, but I want the whole company to see it, in the hope that some more experienced Monk can tell me what I should have done.
I have been trying to install Net::SFTP. I suspect that this is an ancient module relying on now-outdated CPAN features, since I have previously used it without problem on a different (Solaris) machine where the available CPAN modules were about 5 years old.
Following advice given a few weeks ago on this forum, I looked for useful modules already compiled for Ubuntu and installed libnet-ssh-perl and libnet-ssh2-perl (and it also seemed to want libgmp3-dev, which is not a Perl module at all).
But it seems that Net::SFTP is not built on top of those things, since it was demanding to see modules for Blowfish, Rsa, Pari and lots more, and attempts to install those lead to inexplicable test failures which required force to get around (I must have called force install ... a dozen times).
Finally, it was just short of Math::Pari, and I was in the ridiculous situation of
So it claimed to have installed it, except that it wasn't there:cpan[36]> install Math::Pari Could not read metadata file. Falling back to other methods to determi +ne prerequisites Running install for module 'Math::Pari' Running make for I/IL/ILYAZ/modules/Math-Pari-2.010808.zip Checksum for /usr/local/CPAN/sources/authors/id/I/IL/ILYAZ/modules/Mat +h-Pari-2.010808.zip ok CPAN.pm: Building I/IL/ILYAZ/modules/Math-Pari-2.010808.zip yadda yadda yadda make[1]: Entering directory `/usr/local/CPAN/build/Math-Pari-2.010808- +BwhAPo/libPARI' make[1]: Leaving directory `/usr/local/CPAN/build/Math-Pari-2.010808-B +whAPo/libPARI' make[1]: Entering directory `/usr/local/CPAN/build/Math-Pari-2.010808- +BwhAPo/libPARI' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/usr/local/CPAN/build/Math-Pari-2.010808-B +whAPo/libPARI' Files found in blib/arch: installing files in blib/lib into architectu +re dependent library tree Installing /usr/local/lib/perl/lib/perl5/i686-linux-gnu-thread-multi-6 +4int/auto/Math/Pari/Pari.so Appending installation info to /usr/local/lib/perl/lib/perl5/i686-linu +x-gnu-thread-multi-64int/perllocal.pod ILYAZ/modules/Math-Pari-2.010808.zip /usr/bin/make install -- OK
And when I tried to run my application, I gotcpan[37]> m Math::Pari Module id = Math::Pari CPAN_USERID ILYAZ (Ilya Zakharevich <cpan@ilyaz.org>) CPAN_VERSION 2.010808 CPAN_FILE I/IL/ILYAZ/modules/Math-Pari-2.010808.zip UPLOAD_DATE 2014-06-01 MANPAGE Math::Pari - Perl interface to PARI. INST_FILE (not installed)
+ ./transmit-ftp publish.man.ac.uk Web ./newsadmins.html ./committee.h +tml Can't locate Math/Pari.pm in @INC (you may need to install the Math::P +ari module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr +/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/per +l/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at /usr/local +/lib/perl/5.18.2/Net/SSH/Perl/Util/SSH2MP.pm line 6. BEGIN failed--compilation aborted at /usr/local/lib/perl/5.18.2/Net/SS +H/Perl/Util/SSH2MP.pm line 6. Compilation failed in require at /usr/local/lib/perl/5.18.2/Net/SSH/Pe +rl/Util.pm line 56. BEGIN failed--compilation aborted at /usr/local/lib/perl/5.18.2/Net/SF +TP/Buffer.pm line 9. Compilation failed in require at /usr/local/lib/perl/5.18.2/Net/SFTP/A +ttributes.pm line 7. BEGIN failed--compilation aborted at /usr/local/lib/perl/5.18.2/Net/SF +TP/Attributes.pm line 7. Compilation failed in require at /usr/local/lib/perl/5.18.2/Net/SFTP.p +m line 8. BEGIN failed--compilation aborted at /usr/local/lib/perl/5.18.2/Net/SF +TP.pm line 8. Compilation failed in require at ./transmit-ftp line 3. BEGIN failed--compilation aborted at ./transmit-ftp line 3.
And indeed, on looking in /usr/local/lib/perl/5.18.2/Math there was no Pari.pm, but there was a Pari.pm in /usr/local/lib/perl/5.18.2/i686-linux-gnu-thread-multi-64int/Math. So I copied that Pari.pm into where the other one should have been, and Cpan now admitted it was installed:
So now back to the application:cpan[38]> m Math::Pari Module id = Math::Pari CPAN_USERID ILYAZ (Ilya Zakharevich <cpan@ilyaz.org>) CPAN_VERSION 2.010808 CPAN_FILE I/IL/ILYAZ/modules/Math-Pari-2.010808.zip UPLOAD_DATE 2014-06-01 MANPAGE Math::Pari - Perl interface to PARI. INST_FILE /usr/local/lib/perl/5.18.2/Math/Pari.pm INST_VERSION 2.010808
Observe that the error message is now different: "Can't locate loadable object for module Math::Pari in @INC".+ ./transmit-ftp publish.man.ac.uk Web ./newsadmins.html ./committee.h +tml Can't locate loadable object for module Math::Pari in @INC (@INC conta +ins: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18. +2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/ +5.18 /usr/local/lib/site_perl .) at /usr/local/lib/perl/5.18.2/Net/SS +H/Perl/Util/SSH2MP.pm line 6. Compilation failed in require at /usr/local/lib/perl/5.18.2/Net/SSH/Pe +rl/Util/SSH2MP.pm line 6. BEGIN failed--compilation aborted at /usr/local/lib/perl/5.18.2/Net/SS +H/Perl/Util/SSH2MP.pm .................
Evidently, it is expecting the location of the C-compiled *.so files (which are the bulk of the Math::Pari module) to be visible in the @INC.
So I now perpetrated the HACK, to which I have confessed:
(that was actually inside the copies Pari.pm). And my application RAN without problem.##### HACK ######## push (@INC, "/usr/local/lib/perl/5.18.2/i686-linux-gnu-thread-multi-64 +int");
So, Finally, the question for the Monks is "How was I supposed to fix this problem? Or alternatively, should the location of those *.so files have been in @INC all along?"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A Confession
by salva (Canon) on Jul 13, 2015 at 06:27 UTC | |
by clerew (Novice) on Jul 16, 2015 at 11:17 UTC | |
by salva (Canon) on Jul 16, 2015 at 13:36 UTC | |
|
Re: A Confession
by Anonymous Monk on Jul 12, 2015 at 21:15 UTC | |
by clerew (Novice) on Jul 16, 2015 at 11:36 UTC |