> On Apr 9, 2014, at 11:41, Thomas Koch <[email protected]> wrote:
> 
> Hi,
> I’m currently stuck on building this RC on MacOS X. This is probably due to 
> my broken build environment and not a particular PyLucene issue. Anyway 
> others may face the same problem - or even have a solution at hand … so here 
> are the lengthy details:

I think all of these were covered last week on this list, or was it offlist ?

Anyway:
  - you must use the same compiler used to build python to build extensions for 
it - this may imply building python from sources
  - you must ensure that the desired version of the java libraries and header 
files are picked up: setting JAVA_HOME correctly and/or the relevant variables 
in JCC's setup.py
  - you should use the compiler and linker Apple Xcode command line tools (a 
separate install) 

Andi..

> 
> I first encountered an error when building JCC which seems to be cause by new 
> XCode with clang v5.1
> 
> clang: error: unknown argument: '-mno-fused-madd' 
> [-Wunused-command-line-argument-hard-error-in-future]
> clang: note: this will be a hard error (cannot be downgraded to a warning) in 
> the future
> error: command 'cc' failed with exit status 1
> 
> A temporary workaround is to set
> $ export 
> ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future 
> cf. http://kaspermunck.github.io/2014/03/fixing-clang-error/
> (I think this is a trap others will be facing as well…)
> 
> compile then went fine but linker failed:
> 
> ld: warning: directory not found for option '-L/Library/Java/Home/jre/lib'
> ld: warning: directory not found for option 
> '-L/Library/Java/Home/jre/lib/server'
> ld: library not found for -ljava
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> error: command 'c++' failed with exit status 1
> 
> I had a java 1.6.0_65 installed but apparently the java libraries were not 
> found or installed correctly… (do I have to mention that Java on MacOS is a 
> pain ?)
> 
> I then installed Java JDK 7 for Mac OS X x64: 'jdk-7u51-macosx-x64.dmg' 
> (179.49 MB) from      
> http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
> 
> And set the JCC_JDK to the path returned by
> $ /usr/libexec/java_home 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
> 
> The JCC build then gets bit further but still ends up with a linker error:
> 
> —%< —
> 
> jcc $ python setup.py build
> found JAVAHOME = 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
> found JAVAFRAMEWORKS = /System/Library/Frameworks/JavaVM.framework
> Loading source files for package org.apache.jcc...
> ...
> running build_py
> writing 
> /Users/koch/Projekte/Python/pylucene/pylucene-4.5.1-1/jcc/jcc/config.py
> copying jcc/config.py -> build/lib.macosx-10.9-intel-2.7/jcc
> copying jcc/classes/org/apache/jcc/PythonVM.class -> 
> build/lib.macosx-10.9-intel-2.7/jcc/classes/org/apache/jcc
> copying jcc/classes/org/apache/jcc/PythonException.class -> 
> build/lib.macosx-10.9-intel-2.7/jcc/classes/org/apache/jcc
> running build_ext
> building 'jcc' extension
> creating build/temp.macosx-10.9-intel-2.7
> creating build/temp.macosx-10.9-intel-2.7/jcc
> creating build/temp.macosx-10.9-intel-2.7/jcc/sources
> cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common 
> -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX 
> -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os 
> -Wall -Wstrict-prototypes -DENABLE_DTRACE 
> -Wno-error=unused-command-line-argument-hard-error-in-future -dynamiclib 
> -Wno-error=unused-command-line-argument-hard-error-in-future -D_jcc_lib 
> -DJCC_VER="2.18" 
> -I/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/include 
> -I/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/include/darwin
>  -I_jcc -Ijcc/sources 
> -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
> -c jcc/sources/jcc.cpp -o build/temp.macosx-10.9-intel-2.7/jcc/sources/jcc.o 
> -DPYTHON -fno-strict-aliasing -Wno-write-strings
> clang: warning: unknown argument: '-mno-fused-madd' 
> [-Wunused-command-line-argument-hard-error-in-future]
> clang: note: this will be a hard error (cannot be downgraded to a warning) in 
> the future
> clang: warning: argument unused during compilation: '-mno-fused-madd'
> clang: warning: argument unused during compilation: '-dynamiclib'
> jcc/sources/jcc.cpp:185:16: warning: implicit conversion loses integer 
> precision: 'long' to 'int' [-Wshorten-64-to-32]
>    int hash = PyObject_Hash(arg);
>        ~~~~   ^~~~~~~~~~~~~~~~~~
> 1 warning generated.
> cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common 
> -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX 
> -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os 
> -Wall -Wstrict-prototypes -DENABLE_DTRACE 
> -Wno-error=unused-command-line-argument-hard-error-in-future -dynamiclib 
> -Wno-error=unused-command-line-argument-hard-error-in-future -D_jcc_lib 
> -DJCC_VER="2.18" 
> -I/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/include 
> -I/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/include/darwin
>  -I_jcc -Ijcc/sources 
> -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
> -c jcc/sources/JCCEnv.cpp -o 
> build/temp.macosx-10.9-intel-2.7/jcc/sources/JCCEnv.o -DPYTHON 
> -fno-strict-aliasing -Wno-write-strings
> clang: warning: unknown argument: '-mno-fused-madd' 
> [-Wunused-command-line-argument-hard-error-in-future]
> clang: note: this will be a hard error (cannot be downgraded to a warning) in 
> the future
> clang: warning: argument unused during compilation: '-mno-fused-madd'
> clang: warning: argument unused during compilation: '-dynamiclib'
> c++ -Wl,-x -dynamiclib -undefined dynamic_lookup 
> -Wno-error=unused-command-line-argument-hard-error-in-future 
> build/temp.macosx-10.9-intel-2.7/jcc/sources/jcc.o 
> build/temp.macosx-10.9-intel-2.7/jcc/sources/JCCEnv.o -o 
> build/lib.macosx-10.9-intel-2.7/libjcc.dylib 
> -L/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib 
> -ljava 
> -L/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/server
>  -ljvm -Wl,-rpath 
> -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib 
> -Wl,-rpath 
> -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/server
>  -Wl,-S -install_name @rpath/libjcc.dylib -current_version 2.18 
> -compatibility_version 2.18
> 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 'c++' failed with exit status 1
> 
> —%< —
> 
> I read that the JNI CallIntMethod function cannot be found by the linker  - 
> the compile did succeed (e.g. jcc.o) so headers should be found - the -L dirs 
> have jvm libs:
> 
> in jre/lib/server
> - libjsig.dylib
> - libjvm.dylib
> in jre/lib
> - libjava.dylib
> -  ..
> - libjsound.dylib
> 
> Am I missing the JNI lib?
> 
> Here is the 'verbose' output of the linker phase
> 
> $ c++ -v -Wl,-x -dynamiclib -undefined dynamic_lookup 
> -Wno-error=unused-command-line-argument-hard-error-in-future 
> build/temp.macosx-10.9-intel-2.7/jcc/sources/jcc.o 
> build/temp.macosx-10.9-intel-2.7/jcc/sources/JCCEnv.o -o 
> build/lib.macosx-10.9-intel-2.7/libjcc.dylib 
> -L/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib 
> -ljava 
> -L/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/server
>  -ljvm -Wl,-rpath 
> -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib 
> -Wl,-rpath 
> -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/server
>  -Wl,-S -install_name @rpath/libjcc.dylib -current_version 2.18 
> -compatibility_version 2.18
> Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
> Target: x86_64-apple-darwin13.1.0
> Thread model: posix
> "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
>  -demangle -dynamic -dylib -dylib_compatibility_version 2.18 
> -dylib_current_version 2.18 -arch x86_64 -dylib_install_name 
> @rpath/libjcc.dylib -macosx_version_min 10.9.0 -undefined dynamic_lookup 
> -undefined dynamic_lookup -o build/lib.macosx-10.9-intel-2.7/libjcc.dylib 
> -L/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib 
> -L/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/server
>  -x build/temp.macosx-10.9-intel-2.7/jcc/sources/jcc.o 
> build/temp.macosx-10.9-intel-2.7/jcc/sources/JCCEnv.o -ljava -ljvm -rpath 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib 
> -rpath 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/server
>  -S -lc++ -lSystem 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
> 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)
> 
> 
> This is Max OS X 10.9.2 with XCode version 5.1 - any hints are appreciated ,-)
> 
> 
> regards
> 
> Thomas Koch
> --
> OrbiTeam Software GmbH & Co. KG
> www.orbiteam.de
> 
>> Am 09.04.2014 um 03:57 schrieb Andi Vajda <[email protected]>:
>> 
>> 
>> This vote has been obsoleted by the upcoming release of Lucene 4.7.2.
>> 
>> Andi..
> 

Reply via email to