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

Hm, I'm also running MacOS 10.3, with the same version of gcc, and I get the exact same error.

If it is in fact a gcc upgrade that's necessary, that version of gcc (3.3 20030304) seems to be the latest one that's available from http://developer.apple.com for 10.3. There are some more recent downloads (Xcode Tools 2.1 and 2.2) for MacOS 10.4, but I don't know if you want to shell out more money for 10.4.

I suppose you could email the maintainer of Math::GMP about it. Then again, I figure he must have already seen the bug report on rt.cpan.org ....

Update: I poked around on the tests for Math::GMP, and found at least this one instance of gcc (3.3.3 FreeBSD 20031106) that's about the same age as the one on the Mac, and it passed. Interestingly enough, there's this case that passed, but using gcc 3.0.3. Although it's Solaris, my feeling is that it's not the version of gcc that's the problem ...

Update 2: I also think it couldn't be miscompiling libgmp, as I did a make check (as emphasized on the download site), and I still got the same thing. However, looking at the website, I see something else. This is from the GNU MP Bignum library (libgmp) site:

GMP is very often miscompiled! We are seeing ever increasing problems with mis-compilations of the GMP code. Please never use your newly compiled libgmp.a or libgmp.so without first running make check. If it doesn't complete without errors, don't trust the library, and please report this as a bug to the gmp-bugs@swox.com list, so that we can investigate it and make sure the bug is indeed in the compiler. (The compilers that cause problems are HP's unbundled compilers and GCC, in particular Apple's GCC releases. It has come to the point where a compiler should be assumed to miscompile GMP.)

I think that last note about 'Apple's gcc releases may be the answer... it seems that make check may find no problems, when there actually really are. I dunno, maybe post something on their forum, asking when it might be fixed..

-- Burvil

Replies are listed 'Best First'.
Re^2: Math::GMP won't install on Darwin
by jkeenan1 (Deacon) on Apr 20, 2006 at 02:47 UTC
    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

    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
      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