As of Mac OS X 10.9, #include <Python.h> doesn't work; you need #include <Python Python.h="">.
There are nasty hacks out there (see https://github.com/pmccormick/scout/blob/master/lldb/scripts/Python/edit-swig-python-wrapper-file.py ), but the simplest is to just change pyruntime.swg.
Before:
%insert(runtime) %{
/ Python.h has to appear first /
%}
After:
%insert(runtime) %{
/ Python.h has to appear first /
%}
Gah! Let's try again.
As of Mac OS X 10.9,
doesn't work; you need
There are nasty hacks out there (see https://github.com/pmccormick/scout/blob/master/lldb/scripts/Python/edit-swig-python-wrapper-file.py ), but the simplest is to just change pyruntime.swg.
Before:
After:
Can you modify that macro to detect the correct version of OSX, otherwise this will break versions prior to 10.9. Does it work with both of the apple compilers (gcc and clang) ?
We made this change for Chrome, and this works on 10.6 through 10.9, no version check required. Chrome only uses Clang, so while I think this will work in GCC I don't know for sure.
Avi
Related
Bugs:
#1346Hard-coding the assumption that
__APPLE__
means you're using the OS install of Python would be very unhelpful, and doesn't seem like a good approach.Apparently distutils knows about this and will set the include paths suitably so
#include <Python.h>
works, so I'd recommend just using that.