Question

I tried to install pyFFTW 0.9.2 to OSX mavericks, but I encounter the following errors:

/usr/bin/clang -bundle -undefined dynamic_lookup
-L//anaconda/lib -arch x86_64 -arch x86_64 
build/temp.macosx-10.5-x86_64-2.7/anaconda/lib/python2.7/site-packages/pyFFTW-master/pyfftw/pyfftw.o 
-L//anaconda/lib -lfftw3 -lfftw3f -lfftw3l -lfftw3_threads -lfftw3f_threads -lfftw3l_threads 
-o build/lib.macosx-10.5-x86_64-2.7/pyfftw/pyfftw.so

ld: library not found for -lfftw3

clang: error: linker command failed with exit code 1 (use -v to see invocation)

As mentioned in pyFFTW installation -> cannot find -lfftw3_threads, I tried to compile and install fftw 3.3.4 for three times. But it is not working for me.

How I did was:

./configure --enable-float --enable-share  => make => make install
./configure --enable-long-double --enable-share  => make => make install
./configure --enable-threads --enable-share  => make => make install

then I run python (2.7) setup files in pyFFTW folder, and I get the error above.

I appreciate your help.

Was it helpful?

Solution

I had the same issue on OSX 10.9.4 Maverick. Try this: download FFTW 3.3.4 than open a terminal window and go in the extracted FFTW directory and run these commands:

$ ./configure --enable-long-double --enable-threads
$ make
$ sudo make install
$ ./configure --enable-float --enable-threads
$ make
$ sudo make install

Than install pyFFTW using pip as suggested:

$ sudo pip install pyfftw

OTHER TIPS

I'm using MacOX 10.11.4 and Python 3.5.1 installed through conda and the above answer didn't work for me.

I would still get this error:

ld: library not found for -lfftw3l
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1

----------------------------------------
Failed building wheel for pyfftw

or:

ld: library not found for -lfftw3l_threads
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1

----------------------------------------
Failed building wheel for pyfftw

What did work for me was a slight variation on what I found here:

First install long-double libraries

comp:fftw-3.3.4 user$ ./configure --enable-threads --enable-shared --disable-fortran --enable-long-double CFLAGS="-O3 -fno-common -fomit-frame-pointer -fstrict-aliasing"
comp:fftw-3.3.4 user$ make
comp:fftw-3.3.4 user$ sudo make install

Then install float and double libraries

comp:fftw-3.3.4 user$ ./configure --enable-threads --enable-shared --disable-fortran --enable-sse2 --enable-float CFLAGS="-O3 -fno-common -fomit-frame-pointer -fstrict-aliasing"
comp:fftw-3.3.4 user$ make
comp:fftw-3.3.4 user$ sudo make install
comp:fftw-3.3.4 user$ ./configure --enable-threads --enable-shared --disable-fortran --enable-sse2 CFLAGS="-O3 -fno-common -fomit-frame-pointer -fstrict-aliasing"
comp:fftw-3.3.4 user$ make
comp:fftw-3.3.4 user$ sudo make install

Then install pyfftw

comp:fftw-3.3.4 user$ sudo -H  pip install pyfftw

I don't think the --disable-fortran and --enable-sse2 flags are necessary and I'm not sure sudo is necessary for pip but this is what worked for me.

Note that your /usr/local/lib folder should contain the following files when you're done:

libfftw3.3.dylib
libfftw3.a
libfftw3.dylib
libfftw3.la
libfftw3_threads.3.dylib
libfftw3_threads.a
libfftw3_threads.dylib
libfftw3_threads.la
libfftw3f.3.dylib
libfftw3f.a
libfftw3f.dylib
libfftw3f.la
libfftw3f_threads.3.dylib
libfftw3f_threads.a
libfftw3f_threads.dylib
libfftw3f_threads.la
libfftw3l.3.dylib
libfftw3l.a
libfftw3l.dylib
libfftw3l.la
libfftw3l_threads.3.dylib
libfftw3l_threads.a
libfftw3l_threads.dylib
libfftw3l_threads.la
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top