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

Hi monks,

I tried to install 'Math::GMP' module on a windows 2000 system.

I got the following messages when I ran Makefile.pl

Note (probably harmless): No library found for -lgmp Note (probably harmless): No library found for oldnames.lib Note (probably harmless): No library found for kernel32.lib Note (probably harmless): No library found for user32.lib Note (probably harmless): No library found for gdi32.lib Note (probably harmless): No library found for winspool.lib Note (probably harmless): No library found for comdlg32.lib Note (probably harmless): No library found for advapi32.lib Note (probably harmless): No library found for shell32.lib Note (probably harmless): No library found for ole32.lib Note (probably harmless): No library found for oleaut32.lib Note (probably harmless): No library found for netapi32.lib Note (probably harmless): No library found for uuid.lib Note (probably harmless): No library found for wsock32.lib Note (probably harmless): No library found for mpr.lib Note (probably harmless): No library found for winmm.lib Note (probably harmless): No library found for version.lib Note (probably harmless): No library found for odbc32.lib Note (probably harmless): No library found for odbccp32.lib Note (probably harmless): No library found for msvcrt.lib Writing Makefile for Math::GMP

And the following error with nmake

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSO +LE -DNO_ST RICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT -DPERL_I +MPLICIT_SY S -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION +=\"2.03\" -DXS_VERSION=\"2.03\" "-IC:\Perl\lib\CORE" GMP.c GMP.c C:\Perl\lib\CORE\perl.h(380) : fatal error C1083: Cannot open include +file: 'sys /types.h': No such file or directory NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop.

20040615 Edit by Corion: Fixed formatting, added code tags

Replies are listed 'Best First'.
Re: problem with Math::GMP
by tachyon (Chancellor) on Jun 15, 2004 at 06:42 UTC

    This is a Perl XS wrapper (C code) that uses the GNU MP library. First read Practical Guide to Compiling C-based modules under Win32 because your C compiler environment is screwed. You will know it is not FUBAR when you reduce your error messages to:

    C:\Math-GMP-2.03>perl Makefile.PL Checking if your kit is complete... Looks good Note (probably harmless): No library found for '-lgmp' Writing Makefile for Math::GMP

    At this stage we are missing the gmp library. This error is not harmless! GMP is not easy to compile on Win32. Go to http://www.cs.nyu.edu/exact/core/gmp/. You can get binaries for the .lib you will need here but they did not work for me. You will probably need to go the patch route, compile within VCC....

    cheers

    tachyon

      Thanks for the reply

      I followed all the steps given in Practical Guide to Compiling C-based modules under Win32, also downloaded files from http://www.cs.nyu.edu/exact/core/gmp/.

      I still got some errors

      I got the following message when i ran makefile.pl

      C:\downloads\Math-GMP-2.03>perl makefile.pl

      Checking if your kit is complete...

      Looks good

      Writing Makefile for Math::GMP

      With nmake I got an error as follows,

      C:\downloads\Math-GMP-2.03>nmake

      Microsoft (R) Program Maintenance Utility Version 7.10.3077

      Copyright (C) Microsoft Corporation. All rights reserved.

      cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_ST RICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SY S -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"2.03\" -DXS_VERSION=\"2.03\" "-IC:\Perl\lib\CORE" GMP.c

      GMP.c

      c1 : warning C4349: /Gf is deprecated and will not be supported in future versio ns of Visual C++; remove /Gf or use /GF instead Running Mkbootstrap for Math::GMP ()

      C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 GMP.bs

      link -out:blib\arch\auto\Math\GMP\GMP.dll -dll -nologo -nodefaultlib -de bug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -machine:x86 GMP.obj C:\Perl\li b\CORE\perl58.lib C:\Perl\lib\CORE\gmp.lib C:\Perl\lib\CORE\oldnames.lib C:\Perl \lib\CORE\kernel32.lib C:\Perl\lib\CORE\user32.lib C:\Perl\lib\CORE\gdi32.lib C: \Perl\lib\CORE\winspool.lib C:\Perl\lib\CORE\comdlg32.lib C:\Perl\lib\CORE\advap i32.lib C:\Perl\lib\CORE\shell32.lib C:\Perl\lib\CORE\ole32.lib C:\Perl\lib\CORE \oleaut32.lib C:\Perl\lib\CORE\netapi32.lib C:\Perl\lib\CORE\uuid.lib C:\Perl\li b\CORE\wsock32.lib C:\Perl\lib\CORE\mpr.lib C:\Perl\lib\CORE\winmm.lib C:\Perl\l ib\CORE\version.lib C:\Perl\lib\CORE\odbc32.lib C:\Perl\lib\CORE\odbccp32.lib C: \Perl\lib\CORE\msvcrt.lib -def:GMP.def

      Creating library blib\arch\auto\Math\GMP\GMP.lib and object blib\arch\auto\Ma th\GMP\GMP.exp

      C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 755 blib\arch\auto\Mat h\GMP\GMP.dll

      C:\Perl\bin\perl.exe -MExtUtils::Command -e cp GMP.bs blib\arch\auto\Mat h\GMP\GMP.bs

      C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 blib\arch\auto\Mat h\GMP\GMP.bs

      with nmake test,

      C:\downloads\Math-GMP-2.03>nmake test

      I got a messge asking whether the following is ok

      'The procedure entry point__gmpz_sqrt could not be located in the dynamic link library gmp.dll'

      and also an error saying 'Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'bl ib\lib', 'blib\arch')" t\gmppm.t t\gmppm....Can't load 'C:\downloads\Math-GMP-2.03\blib\arch/auto/Math/GMP/GMP.dl l' for module Math::GMP: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 229. at t\gmppm.t line 7

      Compilation failed in require at t\gmppm.t line 7. BEGIN failed--compilation aborted at t\gmppm.t line 7. t\gmppm....dubious

      Test returned status 255 (wstat 65280, 0xff00) FAILED--1 test script could be run, alas--no output ever seen NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x2' Stop.

      What do I do now?

      Thanks & regards

      Nalina
        http://crazyinsomniac.perlmonk.org/perl/ppm/5.8/Math-GMP.ppd

        How did you build your underlying GMP library. It looks like you have probably built/got a dynamic gmp.lib and tried to link against that. See this for an explanation of the difference between static and dynamic linking. But in essence you need to link to a static gmp.lib (which contains all the machine code) so that you can build a gmp.dll (for Perl) that can be dynamically loaded and has all the machine code (aka entry points) it needs.

        If this is for Net::SSH::Perl it *may* be possible to simple s/Math::GMP/Math::BigInt/g as these modules are *almost* totally compatible.

        Math::GMP was designed to be a drop-in replacement both for Math::BigInt and for regular integer arithmetic.

        That may be an easier way to do it for you. If your SSH needs are modest there is plink.exe (google for Putty.exe) which gives you a command line ssh tool you might just be able to control through the shell.

        cheers

        tachyon

Re: problem with Math::GMP
by PodMaster (Abbot) on Jun 15, 2004 at 06:14 UTC