python - Linux Mint 18.1下安装pyFFTW失败 'Serena'

标签 python linux pyfftw

我正在尝试为 FFTW C 库安装 Python 包装器 pyFFTW,但似乎无法找到问题所在。 我从官网下载了FFTW(版本3.3.6,fftw-3.3.6-pl2.tar.gz)安装在/usr/local/bin使用

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

如所提供的 README 中所指定。然后我跑

<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)重要部分。

在此先感谢您的帮助!

见面

最佳答案

//usr/local/lib/libfftw3.a: error adding symbols: Bad value

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”,通常由大多数“包管理器”提供。

例如,构建 fftw3 :(为 x86_64 配置)

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

关于python - Linux Mint 18.1下安装pyFFTW失败 'Serena',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44137999/

相关文章:

python - 如何验证列表 :string fields with web2py?

python - 在 ubuntu 上安装 cx_freeze

python - 为什么 pyfftw 输出为零?

python - pyfftw 释放对数组的引用而不破坏计划

python - SQLalchemy 中 backref 和 back_populate 的概念?

python - 如何在 Python 中使用正则表达式验证 URL?

mysql - 512 错误 UDF MySQL

java - maven java.lang.NoClassDefoundError Linux

python-2.7 - 为 pyFFTW 安装链接 fftw 库时出错

python - 仅对 pandas DataFrame 的一部分进行重新排序