Over the past few years a number of Perlmonks threads have dealt with problems in installing the Math::GMP distribution from CPAN. I have tried to install Math::GMP on two different OSes in the past two days: Ubuntu Linux and Darwin Mac OS X 10.3. In each case, when the 'cpan' shell got to the 'perl Makefile.PL' step, the following warning was displayed:

CPAN.pm: Going to build C/CH/CHIPT/Math-GMP-2.04.tar.gz Checking if your kit is complete... Looks good ----> Note (probably harmless): No library found for -lgmp Writing Makefile for Math::GMP

This has to be one of the most misleading messages I've ever seen. In each case it signified the absence of the 'libgmp3' library. The 'cpan' process continued as follows:

GMP.xs:4:17: gmp.h: No such file or directory GMP.c: In function `XS_Math__GMP_new_from_scalar': GMP.c:99: error: `mpz_t' undeclared (first use in this function) GMP.c:99: error: (Each undeclared identifier is reported only once GMP.c:99: error: for each function it appears in.) GMP.c:99: error: `RETVAL' undeclared (first use in this function) GMP.c: In function `XS_Math__GMP_new_from_scalar_with_base': GMP.c:121: error: `mpz_t' undeclared (first use in this function) GMP.c:121: error: `RETVAL' undeclared (first use in this function) [snip 100+ more lines of error messages] make: *** [GMP.o] Error 1 /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible Failed during this command: CHIPT/Math-GMP-2.04.tar.gz : make NO

In the case of Ubuntu Linux, I was able to proceed once I had installed the Debian libgmp3-dev library.

There being no equivalent library that I knew of for Darwin, I had to compile libgmp from source -- which, it turned out, required that I compile libtools from source as well.

45 minutes later (!) I was ready to try to install Math-GMP again. But I then got this error message when I called make:

ld: /usr/local/lib/libgmp.a(mode1o.o) has local relocation entries i +n non-writable section (__TEXT,__text)

Has anyone been able to achieve better results trying to install Math::GMP on Darwin? (I should add that I'm really only interested in this because it's a prerequisite for Net::SSH::Perl.)

My Darwin configuration:

On Darwin: Perl 5.8.7 Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=darwin, osvers=7.9.0, archname=darwin-2level uname='darwin macintosh.local 7.9.0 darwin kernel version 7.9.0: wed mar 30 20:11:17 pst 2005; root:xnuxnu-517.12.7.obj~1release_ppc power macintosh powerpc ' config_args='-de' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include', optimize='-Os', cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1495)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under darwin Compiled at Oct 24 2005 21:19:21

Jim Keenan

In reply to Math::GMP won't install on Darwin by jkeenan1

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.