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

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
So it claimed to have installed it, except that it wasn't there:
cpan[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)
And when I tried to run my application, I got
+ ./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:

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
So now back to the application:
+ ./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 .................
Observe that the error message is now different: "Can't locate loadable object for module Math::Pari in @INC".

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:

##### HACK ######## push (@INC, "/usr/local/lib/perl/5.18.2/i686-linux-gnu-thread-multi-64 +int");
(that was actually inside the copies Pari.pm). And my application RAN without problem.

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?"


In reply to A Confession by clerew

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.