Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFTW on Mac OS X Mavericks issues

Tags:

c

macos

fftw

I am sure this is a simple issue, but I am having a rough time getting in done. I am using this code snippet from http://www.fftw.org/fftw2_doc/fftw_2.html. I have the library installed (via homebrew). The include folder (/usr/local/include) has

fftw3.f
fftw3.f03
fftw3.h
fftw3l.f03
fftw3q.f03

Here is the code snippet from the site. I have tried it with both fttw.h and fttw3.h

#include <fftw.h>

int main (int argc, char** argv){
 fftw_complex in[N], out[N];
 fftw_plan p;

 p = fftw_create_plan(N, FFTW_FORWARD, FFTW_ESTIMATE);

 fftw_one(p, in, out);

 fftw_destroy_plan(p);  

     return 0;
}

It keeps throwing

fftwtest.c:1:10: fatal error: 'fftw3.h' file not found
#include <fftw3.h>
     ^
1 error generated.
like image 361
Red Avatar asked Dec 26 '22 17:12

Red


2 Answers

/usr/local/include and /usr/local/lib aren't on the default header search path anymore in Mavericks. You'll need to add them with -I and -L flags, respectively.

like image 185
Carl Norum Avatar answered Jan 04 '23 12:01

Carl Norum


I was finally able to install pyfftw via the following, all in one terminal session:

brew install fftw
export DYLD_LIBRARY_PATH=/usr/local/lib
export LDFLAGS="-L/usr/local/include"
export CFLAGS="-I/usr/local/include"
pip install pyfftw
like image 21
David Ketcheson Avatar answered Jan 04 '23 13:01

David Ketcheson