Pylucene 7.7.1在arch Linux上构建“error'gcc'command failed with exit status 1”

2024-09-27 21:26:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在尝试安装pylucene,但每次输入make命令都会在构建阶段出错

running build_ext building 'lucene._lucene' extension creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/build creating build/temp.linux-x86_64-3.7/build/_lucene gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -DPYTHON -DJCC_VER="3.2" -D_jcc_shared -D_java_generics -I/usr/lib/jvm/default/include -I/usr/lib/jvm/default/include/linux -Ibuild/_lucene -I/usr/lib/python3.7/site-packages/jcc/sources -I/usr/include/python3.7m -c build/_lucene/__wrap08__.cpp -o build/temp.linux-x86_64-3.7/build/_lucene/__wrap08__.o -fno-strict-aliasing -Wno-write-strings gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -DPYTHON -DJCC_VER="3.2" -D_jcc_shared -D_java_generics -I/usr/lib/jvm/default/include -I/usr/lib/jvm/default/include/linux -Ibuild/_lucene -I/usr/lib/python3.7/site-packages/jcc/sources -I/usr/include/python3.7m -c build/_lucene/__wrap02__.cpp -o build/temp.linux-x86_64-3.7/build/_lucene/__wrap02__.o -fno-strict-aliasing -Wno-write-strings gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -DPYTHON -DJCC_VER="3.2" -D_jcc_shared -D_java_generics -I/usr/lib/jvm/default/include -I/usr/lib/jvm/default/include/linux -Ibuild/_lucene -I/usr/lib/python3.7/site-packages/jcc/sources -I/usr/include/python3.7m -c build/_lucene/__wrap04__.cpp -o build/temp.linux-x86_64-3.7/build/_lucene/__wrap04__.o -fno-strict-aliasing -Wno-write-strings gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -DPYTHON -DJCC_VER="3.2" -D_jcc_shared -D_java_generics -I/usr/lib/jvm/default/include -I/usr/lib/jvm/default/include/linux -Ibuild/_lucene -I/usr/lib/python3.7/site-packages/jcc/sources -I/usr/include/python3.7m -c build/_lucene/__wrap05__.cpp -o build/temp.linux-x86_64-3.7/build/_lucene/__wrap05__.o -fno-strict-aliasing -Wno-write-strings In file included from /usr/include/c++/8.3.0/cmath:45, from /usr/include/c++/8.3.0/math.h:36, from /usr/include/python3.7m/pyport.h:191, from /usr/include/python3.7m/Python.h:63, from /usr/lib/python3.7/site-packages/jcc/sources/JCCEnv.h:48, from build/_lucene/__wrap05__.cpp:2: build/_lucene/org/apache/lucene/geo/SimpleWKTShapeParser.h:53:40: error: expected ‘)’ before ‘(’ token static ::java::lang::String *NAN; ^~~ build/_lucene/__wrap05__.cpp:57357:53: error: expected unqualified-id before ‘(’ token ::java::lang::String *SimpleWKTShapeParser::NAN = NULL; ^~~ build/_lucene/__wrap05__.cpp: In static member function ‘static _jclass* org::apache::lucene::geo::SimpleWKTShapeParser::initializeClass(bool)’: build/_lucene/__wrap05__.cpp:57379:103: error: lvalue required as left operand of assignment NAN = new ::java::lang::String(env->getStaticObjectField(cls, "NAN", "Ljava/lang/String;")); ^ In file included from /usr/include/c++/8.3.0/cmath:45, from /usr/include/c++/8.3.0/math.h:36, from /usr/include/python3.7m/pyport.h:191, from /usr/include/python3.7m/Python.h:63, from /usr/lib/python3.7/site-packages/jcc/sources/JCCEnv.h:48, from build/_lucene/__wrap05__.cpp:2: build/_lucene/__wrap05__.cpp: In static member function ‘static void org::apache::lucene::geo::t_SimpleWKTShapeParser::initialize(PyObject*)’: build/_lucene/__wrap05__.cpp:57452:128: error: expected unqualified-id before ‘(’ token PyObject_SetAttrString((PyObject *) PY_TYPE(SimpleWKTShapeParser), "NAN", make_descriptor(j2p(*SimpleWKTShapeParser::NAN))); ^~~ error: command 'gcc' failed with exit status 1 make: *** [Makefile:343: compile] Error 1 [phynicz@phynicz pylucene-7.7.1]$ make clean if test -f lucene-java-7.7.1/lucene/build.xml; then cd lucene-java-7.7.1/lucene; JAVA_HOME=/usr/lib/jvm/java-8-jdk /usr/bin/ant clean; fi Buildfile: /home/phynicz/Downloads/Compressed/pylucene-7.7.1/lucene-java-7.7.1/lucene/build.xml clean: [delete] Deleting directory /home/phynicz/Downloads/Compressed/pylucene-7.7.1/lucene-java-7.7.1/lucene/build BUILD SUCCESSFUL Total time: 0 seconds rm -rf lucene-java-7.7.1/lucene/build build

任何帮助都将不胜感激 我试过安装gcc和升级python。你知道吗


Tags: buildincludelibusrjavax86genericmarch

热门问题