简体   繁体   中英

How to build Python with Clang on Mac OS X Mavericks

How can I build Python with Clang on Mac OS X? Mavericks already comes with Python 2.7 installed. The reason I'm asking is because I am having issues trying to install PyLucene and it's possibly because Python was compiled with something other than Clang, while JCC as part of PyLucene needs to be compiled with Clang.

i see your problem now. when building jcc,

clang++ -Wl,-x -dynamiclib -undefined dynamic_lookup build/temp.macosx-10.9-x86_64-2.7/jcc/sources/jcc.o build/temp.macosx-10.9-x86_64-2.7/jcc/sources/JCCEnv.o -o build/lib.macosx-10.9-x86_64-2.7/libjcc.dylib -L/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib -ljava -L/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/server -ljvm -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/server -Wl,-S -install_name @rpath/libjcc.dylib -current_version 2.21 -compatibility_version 2.21
ld: internal error: atom not found in symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1

actually this is a known issue, and the solution is here -x link flag causing link errors on Mac OSX 10.9 (bug?) just run the above clang++ command without the "-x" in the same directory. and then run the "python setup.py build" again...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM