Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Makefile:107:target'的配方_shtns.so';失败_Python_C_Gcc - Fatal编程技术网

Python Makefile:107:target'的配方_shtns.so';失败

Python Makefile:107:target'的配方_shtns.so';失败,python,c,gcc,Python,C,Gcc,我在尝试使用python支持编译库时遇到问题。我有: ./configure --prefix=$HOME/local --enable-python make 我得到: (...) building '_shtns' extension gcc -march=native -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdeb

我在尝试使用python支持编译库时遇到问题。我有:

./configure --prefix=$HOME/local --enable-python
make
我得到:

(...)
building '_shtns' extension
gcc -march=native -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/david/.local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c shtns_numpy_wrap.c -o build/temp.linux-x86_64-2.7/shtns_numpy_wrap.o -fopenmp
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -L/home/david/local/lib -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/shtns_numpy_wrap.o sht_init.o sht_fly.o sht_omp.o -L/home/david/local/lib -lfftw3_omp -lfftw3 -lm -o build/lib.linux-x86_64-2.7/_shtns.so -L/home/david/local/lib
/usr/bin/ld: /home/david/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Makefile:107: recipe for target '_shtns.so' failed
make: *** [_shtns.so] Error 1

我认为这些是相关的线路。它建议使用-fpic标志进行编译,但这已经在我的CFLAGS环境变量中了,正如您在第一行gcc中看到的那样。问题在于“x86_64-linux-gnu-gcc”位。有什么建议吗?

我已经在其他计算机上安装了这个库,而且一切都很顺利。。。提前谢谢!好吧,我解决了。我意识到我必须用-fPIC标志重新编译的是fftw库。也许这对某人有帮助。