Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Couldn't find gmp library after moving perl module

by helenocean (Initiate)
on Sep 04, 2007 at 00:35 UTC ( [id://636807]=perlquestion: print w/replies, xml ) Need Help??

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

I was able to install GMP library, Math::GMP, Math::BigINT and Net::SSH on a Solaris machine A. Then I tar-ed the whole Perl directory and moved it to a Solaris machine B. I also moved *libgmp* files (libgmp.a libgmp.la libgmp.so libgmp.so.3 libgmp.so.3.4.1) under /usr/local/lib to machine B, same path. On machine B, I got an error message: "Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::Calc at /edi/perl/lib/site_perl/5.8.0/Crypt/DH.pm line 6 " I recall when I installed Math::GMP and Math::BigInt on machine A, I specified the lib path = "/usr/local/lib" in Makefile.PL, otherwise, "No library found for -lgmp". What caused machine B fail to find the gmp library? (P.S. Since I’m not a su on machine B, I can not install perl module.) Thanks so much for any suggestions!
  • Comment on Couldn't find gmp library after moving perl module

Replies are listed 'Best First'.
Re: Couldn't find gmp library after moving perl module
by ides (Deacon) on Sep 04, 2007 at 16:18 UTC

    Just an FYI, but trying to "move" modules like this is always going to cause you more pain than it is worth. Even without root ( or su/sudo ) access you can install a modules anywhere you can write files on the filesystem. Just install the module as you would normally, but give it a PREFIX of some location you have write access to, such as $HOME.

    You will then need to just 'use lib' that location and you can avoid situations like this.

    Frank Wiles <frank@revsys.com>
    www.revsys.com

      Thanks! I'll try to re-install some modules on machine B. Two quick questions: 1. "use lib $my_perl_dir" shoul be placed in my perl script, right? 2. Do you think just move the following gmp files should be enough to use gmp library? libgmp.a libgmp.so libgmp.so.3.4.1 libgmp.la libgmp.so.3

        Yes you'll need the 'use lib /path/to/wherever' in your script. This tells Perl to add this path to @INC so it will then look there for modules.

        As for moving the libraries, it *might work. But there are several things that can go wrong when doing that, so it's best to just rebuild the module on the local box to avoid those issues. Unless of course like actually enjoy doing things the hard way and creating more work for yourself!

        Frank Wiles <frank@revsys.com>
        www.revsys.com

Re: Couldn't find gmp library after moving perl module
by Anonymous Monk on Sep 04, 2007 at 07:20 UTC
    ldd ldconfig LD_LIBRARY_PATH
      Thanks. In my .bash_profile, I have already set LD_LIBRARY_PATH = /usr/local/lib, and it can be echoed on the command line. But still "couldn't load specified math lib(s)". Not sure how to use ldconfig...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://636807]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-23 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found