(My msg originally post here: https://issues.apache.org/jira/projects/PYLUCENE/issues/PYLUCENE-10 but Andreas Vajda said I should send to the mailing list. I missed whatever he had posted to the mailing list previously )
I had a lot of trouble with building PyLucene. I finally got it built (under Python 2.7) with much gnashing of teeth but I'm not sure I can get it to run under 2.7 (I'm not going to bother describing that since I don't think it will be useful.) I'd rather try to get PyLucene built and running under Python 3.x. I suspect some of this has to do with lack of support from Apple and Oracle for Java as well as half-hearted support between gcc & clang headers, libraries, and flags, so I'm not even sure how much responsibility falls onto PyLucene. For me, it would be preferable if I could just download a binary (although I don't know how difficult that would be). My configuration: * pylucene-8.6.1 gotten from https://mirrors.ocf.berkeley.edu/apache/lucene/pylucene/ * Mac OSX 10.15.7 * Macbook Pro, Intel Core i7 * gcc --version gcc (Homebrew GCC 10.2.0_3) 10.2.0 * clang --version * Apple clang version 12.0.0 (clang-1200.0.32.29) * Target: x86_64-apple-darwin19.6.0 * Thread model: posix * Python 3.8.2 * java -version * openjdk version "1.8.0_282" * OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08) * OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode) I get 4 errors I get when building with Python 3.8.2, of which one is easy to fix but the other are total puzzles to me: python setup.py build ... /opt/local/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/local/opt/libomp/include -Xpreprocessor -fopenmp -dynamiclib -D_jcc_lib -DJCC_VER="3.8" -I/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/include/darwin -I_jcc3 -Ijcc3/sources -I/Users/cwang/3.7/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c jcc3/sources/jcc.cpp -o build/temp.macosx-10.14.6-x86_64-3.8/jcc3/sources/jcc.o -DPYTHON -fno-strict-aliasing -Wno-write-strings -mmacosx-version-min=10.9 -std=c++11 -stdlib=libc++ gcc: error: this compiler does not support arm64 gcc: error: unrecognized command-line option '-iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders' gcc: error: unrecognized command-line option '-iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers' gcc: error: unrecognized command-line option '-stdlib=libc++' Error 1. this makes least amount of sense is having two different architecture flags when I'm building on and for an Intel machine. However, I have no idea where this is being mandated. (I can't find it in the setup.py file) flags -arch arm64 -arch x86_64 Error 2 & 3 couldn't find this string in setup.py and nothing actionable with google: -iwithsysroot/.... but it does appear to be a clang flag: https://clang.llvm.org/docs/ClangCommandLineReference.html Error 4 seems easy to fix: -stdlib=libc++ it looks like shouldn't be used and that was easy to remove from setup.py: https://stackoverflow.com/questions/19774778/when-is-it-necessary-to-use-the-flag-stdlib-libstdc I also believe that -ljvm and -ljava flags need to be removed as well from the LFLAGS for darwin. This message and its contents are PROPRIETARY AND CONFIDENTIAL to Premier, Inc. inclusive of its affiliates and subsidiaries. This message and all attachments are a private communication and are only for the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the information contained in or attached to this message is strictly prohibited. Please notify the sender of the delivery error by replying to this message, and then delete it from your system.