FFTW Installation with Intel, PGI, and GCC compilers

"Fastest Fourier Transform in the West" (FFTW) is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).

Download FFTW and extract the tarball in a sensible place (e.g., /usr/local/src/FFTW. Note that you will probably want the 3.x and the 2.x series to satisfy a range of scientific applications. Installation is relatively simple, but is a little unusual. Each of the following will install the relevant version into /usr/local/FFTW/x.x.x. Change to the appropriate directory and run the following configuration and make process.


module load intel
make clean
CC=icc F77=ifort ./configure --prefix=--prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-intel --enable-mpi --enable-shared --enable-type-prefix --disable-float
make
make install
make clean
CC=icc F77=ifort ./configure --prefix=--prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-intel --enable-mpi --enable-shared --enable-type-prefix --enable-float
make
make install
make clean
CC=icc F77=ifort ./configure --prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-intel --enable-mpi --enable-shared --enable-type-prefix --enable-long-double
make install
make clean


module load gcc
./configure --prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-gcc --enable-shared
make
make install
make clean
./configure --prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-gcc --enable-shared --enable-single
make
make install
make clean
./configure --prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-gcc --enable-shared --enable-long-double
make
make install
make clean


module load pgi
CFLAGS="-fastsse -tp k8-64,barcelona-64 -Mipa=fast" CXX=pgcpp CC=pgcc F77=pgf77 ./configure --prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-pgi --enable-shared
make
make install
make clean
CFLAGS="-fastsse -tp k8-64,barcelona-64 -Mipa=fast" CXX=pgcpp CC=pgcc F77=pgf77 ./configure --prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-pgi --enable-shared --enable-single
make
make install
make clean
CFLAGS="-fastsse -tp k8-64,barcelona-64 -Mipa=fast" CXX=pgcpp CC=pgcc F77=pgf77 ./configure --prefix=/usr/local/$(basename $(pwd) | sed 's#-#/#')-pgi --enable-shared --enable-long-double
make
make install
make clean

Produce a module file the usual way (e.g., ln -s .base 3.1.3-gcc). The .base module file looks like the following.


#%Module1.0#####################################################################
##
## $name modulefile
##
set ver [lrange [split [ module-info name ] / ] 1 1 ]
set name [lrange [split [ module-info name ] / ] 0 0 ]
set loading [module-info mode load]
set desc [join [read [ open "/usr/local/Modules/modulefiles/$name/.desc" ] ] ]
proc ModulesHelp { } {
puts stderr "\tThis module sets the envinronment for $name v$ver"
}
module-whatis "$desc (v$ver)"
prepend-path --delim " " CPPFLAGS -I/usr/local/$name/$ver/include
prepend-path --delim " " LDFLAGS -L/usr/local/$name/$ver/lib
prepend-path LD_LIBRARY_PATH /usr/local/$name/$ver/lib
setenv FFTWDIR /usr/local/$name/$ver