(Problem solved!) Re: Intel OSX support

William Stein wstein at gmail.com
Thu Jul 27 17:31:15 CEST 2006


I just wanted to follow up my previous email with the solution I found
this morning.
Since the only reason the GMP dylib with assembler support doesn't
work on OS X Intel
is because of the code in mpn/dive_1.asm and mpn/mode1o.asm, one solution is
to simply use the C versions of the two functions defined in those
files but use the
assembler versions of everything else.   Fortunately, the GMP build process
makes it extremely easy to use C versions of functions instead of assembler
versions.  If I execute the commands listed below, I get a version of
GMP built as a
dynamic library with (most) special assembler support.  It passes
"make check" with no
problems at all. And according to my benchmarks it is almost (but not
quite) as fast (for
what I do) as GMP compiled under Linux on the same machine -- i.e.,
it's about 3-4
times faster than compiling GMP with no assembly support on OS X.

tar jxvf gmp-4.2.1.tar.bz2
cd gmp-4.2.1/mpn/x86
rm *dive_1* */*dive_1* */*/*dive_1*
rm */*mode1o* */*/*mode1o*
cd ../..
./configure --enable-cxx=yes --enable-shared --disable-static
make check

I hope this is helpful to people using Intel-based Macs.

  -- William

(P.S. If you didn't read my previous post, I assume that one is using
the latest version of XCode above.  I don't know whether this
will work or not with older versions.)

More information about the gmp-discuss mailing list