Subject: | Misleading message while creating Makefile; Math-GMP won't install on Darwin |
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 in
non-writable section (__TEXT,__text)
Needless to say, 'make test' and 'make install' could not be achieved on
Darwin.
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