2017-05-23 56 views
0

我試圖爲FFTW C庫安裝Python包裝器pyFFTW,似乎無法得到問題所在。 我從官方頁面(版本3.3.6,fftw-3.3.6-pl2.tar.gz)下載的FFTW和使用未能在Linux下安裝pyFFTW Mint 18.1'Serena'

<user>$ ./configure 
<user>$ make 
<user>$ sudo make install 

在所提供的README指定安裝它/usr/local/bin。然後我運行

<user>$ pip install pyfftw 

按照website的建議。終端給我這樣的輸出:

<user>$ pip install pyfftw 
     Collecting pyfftw 
     Using cached pyFFTW-0.10.4.tar.gz 
     Building wheels for collected packages: pyfftw 
     Running setup.py bdist_wheel for pyfftw ... error 
     Complete output from command <user>/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ONw2sB/pyfftw/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmprNCz7Kpip-wheel- --python-tag cp27: 
     . 
     . (shortened by me) 
     . 
     In file included from <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0, 
       from <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, 
       from <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, 
       from /tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.c:462: 
     <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 
     #warning "Using deprecated NumPy API, disable it by " \ 
     ^
     /tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.c: In function ‘__pyx_f_6pyfftw_6pyfftw_byte_align.isra.48.constprop’: 
     /tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.c:3086:6: warning: ‘__pyx_v_update_dtype’ may be used uninitialized in this function [-Wmaybe-uninitialized] 
      if (__pyx_t_1) { 
      ^
     gcc -pthread -shared -L<user>/anaconda2/lib -Wl,-rpath=<user>/anaconda2/lib,--no-as-needed build/temp.linux-x86_64-2.7/tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.o -L<user>/anaconda2/lib -lfftw3 -lfftw3f -lfftw3l -lfftw3_threads -lfftw3f_threads -lfftw3l_threads -lpython2.7 -o build/lib.linux-x86_64-2.7/pyfftw/pyfftw.so 
     /usr/bin/ld: //usr/local/lib/libfftw3.a(apiplan.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC 
     //usr/local/lib/libfftw3.a: error adding symbols: Bad value 
     collect2: error: ld returned 1 exit status 
     error: command 'gcc' failed with exit status 1 
     ---------------------------------------- 
     Failed building wheel for pyfftw 
     Running setup.py clean for pyfftw 
     Failed to build pyfftw 
     . 
     . (shortened by me) 
     . 
     In file included from <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0, 
       from <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, 
       from <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, 
       from /tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.c:462: 
     <user>/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 
     #warning "Using deprecated NumPy API, disable it by " \ 
     ^
     /tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.c: In function ‘__pyx_f_6pyfftw_6pyfftw_byte_align.isra.48.constprop’: 
     /tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.c:3086:6: warning: ‘__pyx_v_update_dtype’ may be used uninitialized in this function [-Wmaybe-uninitialized] 
      if (__pyx_t_1) { 
      ^
     gcc -pthread -shared -L<user>/anaconda2/lib -Wl,-rpath=<user>/anaconda2/lib,--no-as-needed build/temp.linux-x86_64-2.7/tmp/pip-build-ONw2sB/pyfftw/pyfftw/pyfftw.o -L<user>/anaconda2/lib -lfftw3 -lfftw3f -lfftw3l -lfftw3_threads -lfftw3f_threads -lfftw3l_threads -lpython2.7 -o build/lib.linux-x86_64-2.7/pyfftw/pyfftw.so 
     /usr/bin/ld: //usr/local/lib/libfftw3.a(apiplan.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC 
     //usr/local/lib/libfftw3.a: error adding symbols: Bad value 
     collect2: error: ld returned 1 exit status 
     error: command 'gcc' failed with exit status 1 

我懷疑它是與丟失的包,但誰知道...我檢查了所有的要求,並應安裝到FFTW使用的所有程序和setuptools的等。我甚至嘗試從github源代碼構建,但這給了我同樣的錯誤。 關於我可能做錯什麼的建議?

PS:很抱歉,終端輸出很長......我已經縮短到(imo)重要部分。

在此先感謝您的幫助!

meetaig

+0

請編輯您的上述問題,包括操作系統的名稱和版本。 –

+0

@Knud Larsen它的標題。我正在使用Linux Mint 18.1 – meetaig

回答

0

//usr/local/lib/libfftw3.a:錯誤添加符號:壞值

FFTW3的非有效的生成。

需要的是像{libfftw3.so, libfftw3.so.3, libfftw3f.so.3, libfftw3l.so.3, libfftw3_threads.so.3, libfftw3f_threads.so.3, libfftw3l_threads.so.3}

即像一個默認的「(lib)fftw3 +(lib)fftw3-devel」,通常由大多數'Package Manager'提供。

實例,建立fftw3:(配置x86_64的)

./configure --enable-shared --enable-threads --enable-openmp --enable-mpi --enable-fortran --enable-sse2 --enable-avx 
+0

我試過這種配置,但是它不能用'--enable-mpi'運行,即使我已經安裝了mpi。嘗試安裝'pyfftw'時,忽略該選項會產生與上面所示相同的輸出。 – meetaig

+0

對不起,錯過了'薄荷18.1'。爲什麼不安裝'fftw3'系統? ...'sudo apt-get update && sudo apt install libfftw3-dev':你將得到6個'libfftw3'軟件包:https://packages.ubuntu.com/xenial/libfftw3-dev –

+0

謝謝,最後的評論你的工作!我以爲這些庫是用fftw3安裝的。但是不安裝'libfftw3-dec'是個問題 – meetaig