Failed to install pyFFTW under Linux Mint 18.1 'Serena'

479 Views Asked by At

I am trying to install the Python wrapper pyFFTW for the FFTW C library and can not seem to get what the problem is. I downloaded the FFTW from the official page (version 3.3.6, fftw-3.3.6-pl2.tar.gz) and installed it in /usr/local/bin using

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

as specified in the provided README. Then I run

<user>$ pip install pyfftw

as recommended on the website . The terminal gives me this output:

<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

I doubt it has something to do with missing packages but who knows... I checked all the requirements and should have all the programs installed to use FFTW and setuptools and so on. I even tried building from the github sources, but this gives me the same error. Any suggestions on what I could be doing wrong?

PS: Sorry for the long terminal output... I already shortened it to the (imo) important parts.

Thanks in advance for any help!

meetaig

1

There are 1 best solutions below

3
On BEST ANSWER

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

A non valid build of FFTW3.

Required is like {libfftw3.so, libfftw3.so.3, libfftw3f.so.3, libfftw3l.so.3, libfftw3_threads.so.3, libfftw3f_threads.so.3, libfftw3l_threads.so.3}

I.e. like a default "(lib)fftw3 + (lib)fftw3-devel", usually provided by the most 'Package Manager'´s.

Example, build fftw3 : (configuring for x86_64)

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