0

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.

stevetronix
  • 1,231
  • 2
  • 16
  • 32
  • have you tried hombrew? http://brew.sh/ brew install python. and see if this python works. – Dyno Fu Nov 14 '14 at 17:11
  • I did but it doesn't seem to work, maybe because of a conflict with the pre-installed Python versions that are shipped with OS X Mavericks – stevetronix Nov 14 '14 at 17:18
  • 1
    Brew's python does not conflict with system's python as it simply installs it in another directory. – Nima Nov 14 '14 at 23:15

1 Answers1

0

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...

Community
  • 1
  • 1
Dyno Fu
  • 8,753
  • 4
  • 39
  • 64