[Numpy-discussion] Questions about cross-compiling extensions for mac-ppc and mac-intel

Robert Kern robert.kern at gmail.com
Mon Feb 26 14:38:49 EST 2007


Christopher Barker wrote:

> I'm no expert, but the glory of distutils is that it will, by default 
> build extensions the same way as python itself was built. So if you use 
> a PPC python, you'll get PPC extensions, same with Intel, and if you use 
>   a Universal Python, you'll get a Universal extension.

There is a little wrinkle in that numpy configures itself by compiling and
running small C programs to determine what is supported on its platform. When
building on an Intel machine even with a Universal Python, the results of that
configuration will only be for the system it was compiled on. Thus, even though
Universal binaries built on 10.4 systems would usually work on 10.3.9, numpy
doesn't.

> The trick is that while you can build Universal on either platform, you 
> can't use this trick to build Intel extensions on a PPC mac, as the 
> Python would have to be intel, and a PPC mac won't run an Intel Python. 
> It may be possible to run a PPC Python on an Intel Mac with Rosettta, 
> though.
> 
> In any case, Universal is probably the best bet except for your Fortran 
> code - non one has made a Fortan compiler that can do Universal.

The R folks have a package containing gcc 4.0.3 with gfortran that looks like it
might be Universal. I haven't tried to build scipy with it, yet.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco



More information about the NumPy-Discussion mailing list