Installating FFTW on 64-bit AMD Opteron Cluster CentOS 5 Linux

"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).", so says the website. FFTW stands for "Fastest Fourier Transform in the West." *sigh*

Download the v3 series and the v2 series because you'll need both, due to the joy that is scientific computing. Extract and put in a sensible place; (e.g., cd /user/local/src/FFTW \n tar xvf fftw-2.1.5.tar.gz). Load various modules depending on what C compilers and version of OpenMPI you intend to use. (e.g., module load gcc/4.3.4 \n module load openmpi-gcc/1.3.3). Create a place for the install to live in (e.g., mkdir /usr/local/fftw/2.1.5-gcc) and run the configuration with a prefix to that directory, with mpi enabled, float disabled etc. (e.g., ./configure --prefix=/usr/local/fftw/2.1.5-gcc --enable-mpi --disable-float --enable-shared --enable-type-prefix). Then run the ritual of make \n make install and surprisingly, all will be fine.

The version 3 series is an improvement in terms of what it can do, but can sure leave on scratching their head for the actual installation process. The following script gives an indication for gcc configuration;


#!/bin/bash
./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

What, you may ask, is going on here (and I certainly did until the subtle and clever BP explained it). The configuration script is run three times to create three different sets of libraries according to what degree of floating point precision is required. Thus is one looks in the (for example) /usr/local/fftw/3.2.1-gcc/lib after configuration one will find different libraries for each type of precision. e.g.,


libfftw3.a libfftw3f.la libfftw3f.so.3 libfftw3.la libfftw3l.la libfftw3l.so.3 libfftw3.so libfftw3.so.3.2.3
libfftw3f.a libfftw3f.so libfftw3f.so.3.2.3 libfftw3l.a libfftw3l.so libfftw3l.so.3.2.3 libfftw3.so.3 pkgconfig

After this you can make a module file as normal in the regular location (/usr/local/Module/modulefiles and by the usual method.