简体   繁体   English

如何在Mac OS X Mavericks上使用Clang构建Python

[英]How to build Python with Clang on Mac OS X Mavericks

How can I build Python with Clang on Mac OS X? 如何在Mac OS X上使用Clang构建Python? Mavericks already comes with Python 2.7 installed. Mavericks已经安装了Python 2.7。 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. 我问的原因是因为我在尝试安装PyLucene时遇到问题,这可能是因为Python是用Clang以外的东西编译的,而JCC作为PyLucene的一部分需要用Clang编译。

i see your problem now. 我现在看到你的问题了。 when building jcc, 建立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. 实际上,这是一个已知问题,解决方案是-x链接标志,在Mac OSX 10.9上导致链接错误(错误?),只需在同一目录中运行上述clang ++命令,而不使用“ -x”。 and then run the "python setup.py build" again... 然后再次运行“ python setup.py build” ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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