From charlesreid1

Installation

Prerequisites

If you're installing FFTW v.2, you have the option of using MPI. I use OpenMPI for development on my laptop (alternatively, you can use LAM MPI, but it's no longer being developed).

FFTW 3.2.2

Mac Snow Leopard (OS X 10.6)

#!/bin/sh

./configure \
    --prefix=${HOME}/pkg/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"

FFTW 2.1.5

This configure script should work for Mac OS X 10.5 or 10.6 (Leopard or Snow Leopard).

#!/bin/sh

./configure \
    --prefix=${HOME}/pkg/fftw/2.1.5 \
    --enable-threads \
    --enable-mpi \
    --with-mpi=${HOME}/pkg/openmpi/1.4.3 \
    \
    CC="/usr/bin/gcc" \
    CXX="/usr/bin/g++" \
    F77="/usr/local/bin/gfortran" \
    \
    CFLAGS="-arch i386 -arch x86_64" \
    CXXFLAGS="-arch i386 -arch x86_64" \
    FFLAGS="-arch i386 -arch x86_64" \
    \
    CPP="/usr/bin/gcc -E" \
    CXXCPP="/usr/bin/g++ -E" \

Errors

I saw the following error when I was attempting to use MPI compiler wrappers (mpicc, mpic++, etc.) that were part of my own OpenMPI build:

checking for mpicc... mpicc
checking for MPI_Init... no
checking for MPI_Init in -lmpi... no
checking for MPI_Init in -lmpich... no
configure: error: couldn't find mpi library for --enable-mpi

I fixed this by adding a library flag to my configure script:

LDFLAGS="-L${HOME}/pkg/openmpi/1.4.3/lib/openmpi"