[SciPy-dev] Mac OS X and gcc 4.2
Bill Northcott
w.northcott at unsw.edu.au
Thu Aug 17 21:46:24 EDT 2006
On 18/08/2006, at 3:00 AM, Chris Kees wrote:
> having trouble even building the trunk of numpy and scipy on Mac
> OS X using a recent build of gcc (version 4.2.0 20060710) .
Why use such a bleeding edge compiler?
The FSF compilers don't even work very well on Darwin, which is only
of secondary interest to the FSF developers. OTOH Apple incorporate
a number of Darwin optimisations into their code which does not reach
the FSF sources until later if at all. Even worse current Apple
compilers are based on gcc-4.0.x so a lot of Apple stuff will be in
FSF 4.0.3 but none of it in 4.2 which is very different.
You can use the standard Apple compilers with a Fortran from
hpc.sourceforge.net. Or just get the current R 2.3.1 binary package
which includes gcc-4.0.3 with gfortran. Although this appears to be
built from FSF sources it is universal and can target i386, ppc and
ppc64.
> errors with gcc 4.2:
>
> ...
> gcc: _configtest.c
> gcc: unrecognized option '-no-cpp-precomp'
> cc1: error: unrecognized command line option "-arch"
> cc1: error: unrecognized command line option "-arch"
> cc1: error: unrecognized command line option "-Wno-long-double"
As others have observed the problem is the configure script. As the
autoconf macro guidelines make clear one should test for features not
software versions. The script clearly tests for Darwin and assumes
an Apple compiler. The options causing the errors are all Apple
specific.
I think the -no-cpp-precomp option is now redundant, -arch is only
necessary if you are trying to target a different architecture to the
build host. I am surprised it is used at all. While -Wno-long-
double is sort of important. The size of long doubles has changed
recently on Darwin so it is useful to now if you have them in your code.
Bill Northcott
More information about the SciPy-Dev
mailing list