Installing FFTW on Mac OS X Snow Leopard
No FORTRAN compiler appears to be included in Xcode, so I need to
install it if I haven’t done so. I installed
GFortran. In the configure
statement below, set F77
to gfortran
.
Installing from Fink
For FFTW version 3.x, do:
$ fink install fftw3 fftw3-shlibs
The library will be available under /sw/lib.
Installing from Source
The version of FFTW we use here is 3.2.2. Follow this:
$ mkdir tmp
$ cd tmp
$ wget http://www.fftw.org/fftw-3.2.2.tar.gz
$ tar -xvzf fftw-3.2.2.tar.gz
$ cd fftw-3.2.2
$ ./configure --prefix=/usr/local/fftw-3.2.2 --enable-threads \
CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" \
CPP="gcc -E" CXXCPP="g++ -E" F77=gfortran
$ make
$ sudo make install
$ sudo ln -s /usr/local/fftw-3.2.2 /usr/local/fftw
This will install FFTW under /usr/local/fftw-3.2.2. If a single
precision version also needs to be installed, add --enable-single
to
the configure statement above and do the configure/make/make install
sequence again (it’s a good idea to run make clean
before the
second time around though).
Update History
November 24, 2010 – Added the Fink version. Changed the installation directory to /usr/local/fftw to avoid potential conflict later.