You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by "Clem Wang (Jira)" <ji...@apache.org> on 2021/02/10 01:49:00 UTC
[jira] [Comment Edited] (PYLUCENE-10) Building Pylucene is way too
difficult
[ https://issues.apache.org/jira/browse/PYLUCENE-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17282156#comment-17282156 ]
Clem Wang edited comment on PYLUCENE-10 at 2/10/21, 1:48 AM:
-------------------------------------------------------------
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:
{code:java}
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++'
{code}
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)
{code:java}
flags -arch arm64 -arch x86_64{code}
Error 2 & 3 couldn't find this string in setup.py and nothing useful with google:
{code:java}
-iwithsysroot/....{code}
Error 4 seems easy to fix:
{code:java}
-stdlib=libc++{code}
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
{code:java}
-ljvm{code}
and
{code:java}
-ljava{code}
flags need to be removed as well from the LFLAGS for darwin.
was (Author: clemwang906):
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
* 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:
{code:java}
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++'
{code}
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)
{code:java}
flags -arch arm64 -arch x86_64{code}
Error 2 & 3 couldn't find this string in setup.py and nothing useful with google:
{code:java}
-iwithsysroot/....{code}
Error 4 seems easy to fix:
{code:java}
-stdlib=libc++{code}
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
{code:java}
-ljvm{code}
and
{code:java}
-ljava{code}
flags need to be removed as well from the LFLAGS for darwin.
> Building Pylucene is way too difficult
> --------------------------------------
>
> Key: PYLUCENE-10
> URL: https://issues.apache.org/jira/browse/PYLUCENE-10
> Project: PyLucene
> Issue Type: Bug
> Environment: Linux, Windows Mac
> Reporter: Philippe Ombredanne
> Priority: Major
> Labels: build, linux, mac, window
>
> The amount of work needed to make a redistributable build for a few common os is rather big
> Could there be an effort to provide these pre-built?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)