R.U.
R.U.

Reputation: 353

Installing pyfftw on mac OSX

I am trying to install pyfftw on mac OSX using pip. Here is what I have already done.

I have installed fftw using brew install fftw, and also tested the linking, by compiling and running the following code:

#include <fftw3.h>

int main() {
    printf("Hello, FFTW!\n");
    return 0;
}

with

gcc -o test test.cpp -I/opt/homebrew/opt/fftw/include -L/opt/homebrew/opt/fftw/lib -lfftw3

which runs fine and prints Hello, FFTW as expected. After this I added the following lines to my .zshrc file:

export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew:$PATH
export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH
export LDFLAGS="-Wl,-S,-rpath,/opt/homebrew/opt/fftw/lib -L/opt/homebrew/opt/fftw/lib"
export CFLAGS="-Wno-implicit-function-declaration -I/opt/homebrew/opt/fftw/include"

When after sourcing the zshrc file I try pip install pyfftw from within a conda environment, I get the error message:

  ld: library 'fftw3f' not found

for each of the libraries and then finally says:

error: Could not find any of the FFTW libraries

I have checked the libraries are there.

From this message, DEBUG:__main__:Checking with includes ['fftw3.h']...ok I believe it is able to locate the header file but the linker is not finding the libraries. Any help will be greatly appreciated.

Upvotes: 0

Views: 124

Answers (0)

Related Questions