我在Mac OS X 10.6版本上使用Python。我最近安裝了最新的Mac OS X開發人員工具SDK,其中包含GCC。我擁有的軟件開發工具包是:如何使Python和distutils在Mac OS X上使用正確的SDK?
$ ls /Developer/SDKs/
MacOSX10.4u.sdk MacOSX10.5.sdk MacOSX10.6.sdk
我想使用的Mac OS X 10.6與Python /的distutils,每當我安裝一個Python包「的setup.py安裝」,需要編譯。
我注意到,Python的經過-isysroot標誌和路徑的Mac OS X 10.5 (未10.6),即:
$ python-config --cflags --ldflags
-I/Library/Frameworks/EPD64.framework/Versions/7.0/include/python2.7 -I/Library/Frameworks/EPD64.framework/Versions/7.0/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -O3 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Library/Frameworks/EPD64.framework/Versions/7.0/include
-L/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 EPD64.framework/Versions/7.0/Python
我如何糾正呢?我希望它使用10.6 SDK。
現在,當我運行在所有需要C語言編譯程序包「蟒蛇的setup.py安裝」,它的產量,看起來像這樣GCC電話:
gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -O3 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Library/Frameworks/EPD64.framework/Versions/7.0/include -DHAVE_RINTF=1 -DHAVE_FINITE=1 -DHAVE_EXPM1=1 -DHAVE_RINT=1 -DHAVE_LOG2=1 -DHAVE_LOGBL=1 -DHAVE_SNPRINTF=1 -DHAVE_LOG1P=1 -DHAVE_ROUND=1 -DHAVE_FMIN=1 -Iinclude -Isrc/lapack -Isrc/f2c -I/Library/Frameworks/EPD64.framework/Versions/7.0/include/python2.7 -c src/f2c/signal_.c -o build/temp.macosx-10.5-x86_64-2.7/src/f2c/signal_.o
這就要求在其路徑10.5的SDK。
我使用Python的Enthought Python Distribution安裝以防萬一。
非常感謝。