OSX 10.8: setuptools generates gcc command that wants to use to use .c instead of .cpp
Justin Israel <justinisrael <at> gmail.com>
2013-05-18 01:55:23 GMT
This is a strange issue that happens for my project only when someone with OSX 10.8 (mountain lion) tries to build the extension. I don't have 10.8 so I am still waiting on a colleague to forward me a dump of the literal failure, but I figured I could start the question now and provide more info if needed.
The issue is pretty straight forward. On <=10.7.x, when building the extension in place, it properly respects the language="c++" Extension attribute. It cythonizes the pyx => cpp, and runs the proper gcc command to build.
On 10.8.x, it seems it is cythonizing the cpp file just fine, but then it generates a gcc command that is trying to compile a .c that does not exist, obviously. The way I can get it to succeed is if I modify my setup file to not use cython. Then I manually cythonize the pyx => cpp, and have it use the cpp source directly in the setuptools Extension (I have one of those common use_cython style flag setups that I just force to False).
Does anyone offhand know what might be an issue on osx 10.8? I know apple mucked with the compiler setups a whole bunch, and have seen my fair share of posts containing "problems compiling XYZ on 10.8", requiring some special adjustment. I know that the person who encountered this error had freshly installed the xcode command-line tools to get their compilers, and had no previous setup for building from source code until they were trying to build my extension.
Example setup.py code looks like:
SRC = 'foo.pyx'
cmdclass['build_ext'] = build_ext
SRC = 'foo.cpp'
ext = Extension('plow.client.plow',
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out