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

Hi All, I have a script which uses Net::SSH::Perl for connecting to a remote host.
When the try to connect by creating Object to Net::SSH::Perl, the script returns this error:
Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::Calc at /usr/lib/perl5/site_perl/5.8.8/Crypt/DH.pm line 6
Could any please let me know what could be the problem. Thanks in advance, Sagar
  • Comment on Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::Calc at /usr/lib/perl5/site_perl/5.8.8/Crypt/DH.pm line 6

Replies are listed 'Best First'.
Re: Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::Calc at /usr/lib/perl5/site_perl/5.8.8/Crypt/DH.pm line 6
by AndyZaft (Hermit) on Jun 22, 2010 at 21:59 UTC
    It just tells you that it couldn't find the C lib so it falls back to the pure Perl implementation for the calculations. Solution is to find which lib is missing or not in the path and link it properly to the module.
        Iam seeing the same issue? Please help me if you already got the fix. Thanks so much. ~Rossi

      I’m just a developer on my system and I have to have the system administrator install Perl Modules for me. After spending the good part of the day trying to get it to work he has given up. The SFTP does function but it reports the error

      “Math::BigInt: couldn't load specified math lib(s), fallback to Math: :BigInt::Calc at /usr/opt/perl5/lib/site_perl/5.8.8/Crypt/DH.pm line 6.

      He attempted to install the required modules but was not successful:

      cpan> install Math::BigInt

      CPAN: Storable loaded ok

      Going to read /.cpan/Metadata

      Database was generated on Fri, 20 Jan 2012 09:11:21 GMT

      Math::BigInt is up to date.

      cpan> install Math::Pari

      Math::Pari is up to date.

      He tried installing Math::GMP but got:

      ==========================================================

      WARNING! No GMP libraries were detected!

      Please see the INSTALL file.

      ===========================================================

      The SFTP takes 50 seconds for it to deal with the fallback. This is unacceptable so I will have use a different method to implement SFTP or use the NET::FTP module. Googling this error I see it is very popular too bad the install can’t be made less complicated.

        It seems that GMP is a library external to Perl. Most likely, your system administrator would need to install that prerequisite as well. Usually, vendors provide precompiled packages of such libraries with the package manager of the OS.

        The GMP warning sounds like your system is missing header files for libgmp (aka the development package for libgmp).
        Did you find a solution to the error? I am facing the same issue - where SFTP functions, but I get the warning at the beginning of the script. Thanks!