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

This is what I've done over the past several days:

1. I upgraded to the most recent version of gcc which is expected to work on Mac OS X 10.3.9: gcc-4.0.3

[jimk] 510 $ gcc -v Using built-in specs. Target: powerpc-apple-darwin7.9.0 Configured with: ../gcc-4.0.3/configure : (reconfigured) ../gcc-4.0.3 +/configure Thread model: posix gcc version 4.0.3

This process, incidentally, took hours. I went do dinner and then to bed and it was still running! Did a lot of work with gcj, which I guess has to do with Java.

2. Tonight I reinstalled gmp-4.2. It went much faster than previously. As per the instructions cited by bowei_99 above, I performed make check after doing make install. All tests passed.

3. I attempted to reinstall Math-GMP via the cpan shell. I got the same error as before:

CPAN.pm: Going to build C/CH/CHIPT/Math-GMP-2.04.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Math::GMP cp lib/Math/GMP.pm blib/lib/Math/GMP.pm AutoSplitting blib/lib/Math/GMP.pm (blib/lib/auto/Math/GMP) /usr/local/bin/perl /usr/local/lib/perl5/5.8.7/ExtUtils/xsubpp -typem +ap /usr/local/lib/perl5/5.8.7/ExtUtils/typemap -typemap typemap GMP. +xs > GMP.xsc && mv GMP.xsc GMP.c cc -c -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing + -pipe -I/usr/local/include -Os -DVERSION=\"2.04\" -DXS_VERSION=\"2 +.04\" "-I/usr/local/lib/perl5/5.8.7/darwin-2level/CORE" GMP.c Running Mkbootstrap for Math::GMP () chmod 644 GMP.bs rm -f blib/arch/auto/Math/GMP/GMP.bundle env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_looku +p -L/usr/local/lib GMP.o -o blib/arch/auto/Math/GMP/GMP.bundle \ -lgmp \ ld: /usr/local/lib/libgmp.a(mode1o.o) has local relocation entries in +non-writable section (__TEXT,__text) make: *** [blib/arch/auto/Math/GMP/GMP.bundle] 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

Any more ideas? Thanks.

Jim Keenan

Replies are listed 'Best First'.
Re^3: Math::GMP won't install on Darwin
by peckel (Initiate) on Jul 10, 2006 at 12:19 UTC
    Are there any newer insights about this issue? I tried gcc 3.3 and gcc 4.0 from the latest XCode 2.3 release, but both failed in exactly the same way. I need to build Math::GMP for a demo installation of a project requiring Net::SSH, and currently I'm stuck. Thanks in advance, Peter Eckel.
      I haven't had time to get back to this problem since my last posting.
      Jim Keenan
      What's the exact problem ? Sorry ... I've gone back through this thread but I'm not sure what the exact issue is - and rt.cpan.org seems to be down at the moment so I can't even get to the bug reports. I did see an earlier suggestion that compiler bugs may be the problem - but my understanding is that if 'make check' passed all tests (when building the GMP library) then you haven't got any compiler bugs. If GMP has been successfully built and installed then I feel there shouldn't be much of a problem in getting Math::GMP installed ... though, admittedly, I know stuff-all about Macs.

      I could speculate about what the problem could be ... but it's probably quicker if someone provides a refresh of the situation.

      Cheers,
      Rob

        OK, so here's what I did.

        1. Downloaded, configured and compiled libgmp 4.2.1 using gcc 4.0.1 (the latest version from XCode).

        2. "make check" on libgmp. No errors.

        3. Installed libgmp (make install), again, no errors.

        4. Tried to install Math::GMP using CPAN. This fails:

        Checking if your kit is complete... Looks good Writing Makefile for Math::GMP cp lib/Math/GMP.pm blib/lib/Math/GMP.pm AutoSplitting blib/lib/Math/GMP.pm (blib/lib/auto/Math/GMP) /usr/local/bin/perl /usr/local/lib/perl5/5.8.8/ExtUtils/xsubpp -typem +ap /usr/local/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap GMP. +xs > GMP.xsc && mv GMP.xsc GMP.c 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 env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_looku +p -L/usr/local/lib -L/opt/local/lib GMP.o -o blib/arch/auto/Math/GMP +/GMP.bundle \ -lgmp \ /usr/bin/ld: /usr/local/lib/libgmp.a(mode1o.o) has local relocation en +tries in non-writable section (__TEXT,__text) collect2: ld returned 1 exit status make: *** [blib/arch/auto/Math/GMP/GMP.bundle] 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

        5. Back to libgmp, make distclean

        6. Switch gcc to version 3.3

        7. Repeat configure/make cycle (no errors)

        8. make check (no errors)

        9. Tried to install Math::GMP. Same result as above.

        Please feel free to contact me if you need any further information. I'll be glad to help.

        Thanks,

        Peter.