[PPL-devel] PPL for Mac

Swarat Chaudhuri swarat.chaudhuri at gmail.com
Mon Sep 8 00:15:42 CEST 2008


By the way, as it happens, this is what GNU MP's webpage says:
"[2006-05-04] GMP does not build on MacInteltosh machines. We've been told
that the main problem is a serious Apple linker bug that Apple hasn't fixed
for several years. There are ugly GMP workarounds floating around the net
that we will not apply to GMP."

Also:

"This page is an attempt to help and caution GMP users of the problems to
expect when compiling GMP on Mac OS.

Most people use Apple's "Xcode" bundles for compilation on these systems.
Unfortunately, of the many Xcode releases we've tried, none has worked
properly. The most common problem is that the compiler generates incorrect
code. But there have also been problems with the linker and assembler.

Please do not report any problem you encounter with building or running GMP
on Apple systems to us, if you've used Xcode. You're on your own here. You
might want to report Apple's bugs to Apple, though."
So I tried to download the new version of gcc and compile it from source.
However, that seems to require GMP! So it's a cyclic dependency!

I am posting this here just so other Apple users can save a few hours of
their and Roberto's time. :) Also, if anyone finds a workaround, please let
me know.




On Sun, Sep 7, 2008 at 1:55 PM, Roberto Bagnara <bagnara at cs.unipr.it> wrote:

> Swarat Chaudhuri wrote:
>
>> Thanks so much for the help. Please scroll below for the content of the
>> file.
>>
>
> Hi Swarat,
>
> the comfig.log you sent suggests that there is something wrong
> with your installation of GMP.  See the lines:
>
> ld warning: in /usr/local/lib/libgmpxx.dylib, file is not of required
> architecture
> ld warning: in /usr/local/lib/libgmp.dylib, file is not of required
> architecture
> Undefined symbols:
>  "___gmpz_clear", referenced from:
>      _main in ccxmmb5n.o
>      _main in ccxmmb5n.o
>  "___gmpz_init_set_str", referenced from:
>      _main in ccxmmb5n.o
> ld: symbol(s) not found
>
> I suggest we come back to the problem of building the PPL when
> you have been able to compile the file test_gmp.cc, whose
> contents is
>
> #include <gmpxx.h>
>
> #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 &&
> __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 &&
> __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3)
> #error "GMP version 4.1.3 or higher is required"
> #endif
>
> int main() {
>  mpz_class n("3141592653589793238462643383279502884");
>  return 0;
> }
>
> with the compilation command
>
> $ g++ -o test_gmp -g -O2 test_gmp.cc -lgmpxx -lgmp
>
> and this program runs
>
> $ ./test_gmp && echo "Yes!"
>
> We don't have access to any Mac, so I am afraid we cannot
> advise about how to fix your GMP installation.
> Good luck,
>
>
>   Roberto
>
> --
> Prof. Roberto Bagnara
> Computer Science Group
> Department of Mathematics, University of Parma, Italy
> http://www.cs.unipr.it/~bagnara/
> mailto:bagnara at cs.unipr.it
>



More information about the PPL-devel mailing list