py
py copied to clipboard
Using brew Python in OSX
I had to modify some parts of the gnumake-mac-gcc.inc
in order to compile against an alternative Python installation (from brew). I'll put them here so it can serve as documentation to anyone having the same problem.
@@ -1,8 +1,8 @@
# don't use -framework Python, since this will stick to the default system version
-_LOCAL_FRAMEWORK := /Library/Frameworks/Python.framework/Versions/$(PY_MAJOR_VERSION).$(PY_MINOR_VERSION)
+_LOCAL_FRAMEWORK := /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework
_SYSTEM_FRAMEWORK := /System/Library/Frameworks/Python.framework/Versions/$(PY_MAJOR_VERSION).$(PY_MINOR_VERSION)
_LOCAL_LIBRARY := /Library/Python/$(PY_MAJOR_VERSION).$(PY_MINOR_VERSION)
_SYSTEM_LIBRARY := /System/Library/Python/$(PY_MAJOR_VERSION).$(PY_MINOR_VERSION)
DEFS += -DPY_EXPORTS
@@ -19,11 +19,11 @@ endif
ifdef PY_NUMARRAY
DEFS += -DPY_NUMARRAY
endif
ifdef PY_NUMPY
DEFS += -DPY_NUMPY
-INCPATH += -I$(_LOCAL_LIBRARY)/python$(PY_MAJOR_VERSION).$(PY_MINOR_VERSION)/site-packages/numpy/core/include
+INCPATH += -I/usr/local/lib/python2.7/site-packages/numpy/core/include
ifeq ($(PY_DEFAULT),1)
INCPATH += -I$(_SYSTEM_FRAMEWORK)/lib/python$(PY_MAJOR_VERSION).$(PY_MINOR_VERSION)/site-packages/numpy/core/include
INCPATH += -I$(_SYSTEM_FRAMEWORK)/Extras/lib/python/numpy/core/include
else
INCPATH += -I$(_LOCAL_FRAMEWORK)/lib/python$(PY_MAJOR_VERSION).$(PY_MINOR_VERSION)/site-packages/numpy/core/include
It would be awesome if this could be configured in config.txt
.
Thank you, your input is much appreciated. I'll think of how to make the build system more flexible.