views:

24

answers:

1

I'm trying to install matplotlib for Python on MacOS X. If I use the system Python 2.6.1, the default compiler commands that matplotlib uses (presumably via distutils) are::

gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes
g++-4.2 -Wl,-F. -bundle -undefined dynamic_lookup

However, if I simply add the python.org 2.6.6 Python to the PATH to use that instead, the default compilers suddenly change to

gcc-4.0 -DNDEBUG -g -O3
c++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
    -g -bundle -undefined dynamic_lookup

This causes issues, so I was wondering what determines which C compilers are used when running python setup.py install? Why does using the python.org Python mean that different default compiler commands are used?

A: 

The python.org release is designed to work just as well on MacOsX 10.5 as on 10.6, therefore of course it has to stick with a gcc release that is commonly available for both. Apple's system Python, of course, labors under no such constraint -- it supports only a very specific version of MacOsX and therefore can use the "latest and greatest" gcc available for that one specific version... and so of course it does;-).

Alex Martelli