in reply to Re^10: Math::GMP won't install on Darwin
in thread Math::GMP won't install on Darwin

Hi Rob,

this one turned out to be harder than expected.

First of all, I have to correct myself. While I did a ./configure --disable-static --enable-shared for gmp-4.2.1, I didn't check on the results, which was neglegance on my part - there were none. There is a problem with libgmp's configure script, which prevents shared libraries from being built, and silently falls back to static. Duh.

After upgrading libtool (which didn't resolve anything), I found the following patch here, which immediately solves the problem:

--- configure.old 2006-07-19 11:01:44.000000000 +0200 +++ configure 2006-07-19 10:49:59.000000000 +0200 @@ -12547,7 +12547,7 @@ ;; darwin* | rhapsody*) - if test "$GXX" = yes ; then + if test "$GCC" = yes ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012])

Now that the shared library has been built, everything works fine for Math::GMP without further intervention, just as you expected.

dailuaine:~/Documents/Develop/Math-GMP-2.04 pete$ perl Makefile.PL Writing Makefile for Math::GMP dailuaine:~/Documents/Develop/Math-GMP-2.04 pete$ make gcc -c -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasin +g -pipe -Wdeclaration-after-statement -I/usr/local/include -I/opt/loc +al/include -O3 -DVERSION=\"2.04\" -DXS_VERSION=\"2.04\" "-I/usr/lo +cal/lib/perl5/5.8.8/darwin-2level/CORE" GMP.c Running Mkbootstrap for Math::GMP () chmod 644 GMP.bs rm -f blib/arch/auto/Math/GMP/GMP.bundle LD_RUN_PATH="/usr/local/lib" env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bu +ndle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib GMP. +o -o blib/arch/auto/Math/GMP/GMP.bundle \ -lgmp \ chmod 755 blib/arch/auto/Math/GMP/GMP.bundle cp GMP.bs blib/arch/auto/Math/GMP/GMP.bs chmod 644 blib/arch/auto/Math/GMP/GMP.bs Manifying blib/man3/Math::GMP.3 dailuaine:~/Documents/Develop/Math-GMP-2.04 pete$ make test PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" " +test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/gmppm....ok + All tests successful. Files=1, Tests=350, 1 wallclock secs ( 0.21 cusr + 0.04 csys = 0.25 + CPU)

Thanks again for your help. It seems that the problem is on the libgmp side, so I'll send the problem description and the workaround to the developers.

Best regards,

  Peter.