Jason Martin on Fri, 15 Dec 2006 21:56:42 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Lowering compiler optimisation with Apple gcc


I've had excellent luck on my Core 2 Mac with the latest version of gcc using

  CFLAGS="-m64 -fast"

I've also ported and optimized GMP for Core 2 Macs, and using my port
of GMP I get Pari benchmarks on my Mac Pro that out perform all of the
Opteron machines I have access to.  For details, see my website (in my
signature).

I have not encountered any "bugs" in Apple's gcc, but I have
encountered "frustrations" because the Apple gcc options are not
compatible with the Linux options that I'm familiar with.

One subtle point of building for Core 2 Macs is that current versions
of the autoconf tools do not correctly detect the CPU type.  This is
because the "uname -m" command returns the rather unhelpful "i386"
rather than the "x86_64" that one might expect.  So, you have to
manually detect the CPU (Agner Fog has some nice routines for this).

I have not tried building on the 32bit or PowerPC Macs because I don't
have access to any.

--jason

-----------------------------------------------------------
Jason Worth Martin
Asst. Prof. of Mathematics
James Madison University
http://www.math.jmu.edu/~martin
phone: (+1) 540-568-5101
fax: (+1) 540-568-6857

"Ever my heart rises as we draw near the mountains.
There is good rock here." -- Gimli, son of Gloin


On 12/15/06, Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr> wrote:
Hello PARI-dev,

we regurlarly get bug reports about random problems on Apple platform,
see #504, #523,
<http://pari.math.u-bordeaux.fr/archives/pari-dev-0603/msg00003.html>
<http://pari.math.u-bordeaux.fr/archives/pari-dev-0606/msg00004.html>
and others.

Unfortunately we never have been able to reproduce any of them and
they looks like compilers bugs in various Apple gcc build.

Maybe we should lower the default optimisation level to reduce breakage.
Advanced users could still pick higher optimisation level.

We could check the gcc version for the string 'Apple'.

What do you think ?

Cheers,
Bill