PGI Guide to FFTW

This guide is intended to help build and test the Fastest Fourier Transform in the West (FFTW) library for Linux using PGI 2010 compilers.

Version Information

This guide was created for both the 3.2.2 and the 2.1.5 releases of FFTW compiled using the PGI 2010 compilers. This information is for both x64 processors running 64-bit Linux and x86 processors running 32 bit Linux.

Application Notes

Information about FFTW can be found on the FFTW website at www.fftw.org. From the FFTW home page:

"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). We believe that FFTW, which is free software, should become the FFT library of choice for most applications. "

"Our benchmarks, performed on a variety of platforms, show that FFTW's performance is typically superior to that of other publicly available FFT software, and is even competitive with vendor-tuned codes. In contrast to vendor-tuned codes, however, FFTW's performance is portable: the same program will perform well on most architectures without modification. Hence the name, FFTW, which stands for the somewhat whimsical title of 'Fastest Fourier Transform in the West.' "

"FFT version 2.1.5 is not compatible with the 3.x FFTW versions as the interfaces to the FFT routines changed in the 3.x release stream. Applications which take advantage of FFTW will usually specify where to use the 2.x version or the 3.x version of this library. If in doubt about which library to use, look for where the code either includes FFTW header files or library routines. FFTW 2.x will include fftw.h while FFTW 3.x will include fftw3.h. Since they have different header files and library names, both versions of fftw can be installed on a system at the same time."

Obtaining the Source Code

The FFTW source code is available from the FFTW website referenced above. You may want to check there for recent updates. The current versions as of this writing (March 2010) are available for download here:

Prerequisites

None.

Building, Testing and Installing FFTW

  1. Untar the FFTW package:

       tar -xvzf fftw-3.2.2.tar.gz
       cd fftw-3.2.2
    

    or

       tar -xvzf fftw-2.1.5.tar.gz
       cd fftw-2.1.5
    
  2. Set the environment and configure the code:

       env CC=pgcc CFLAGS="-fast -Minfo" F77=pgf90 FFLAGS="-fast -Minfo"
       ./configure --prefix=/usr/local
    
  3. Build the code:

       make >& make.log
    
  4. Test the build:

       make check >& make_check.log
    
  5. Finally, install the results:

       sudo make install
    

Known Issues and Limitations

FFTW 3.2.2 has a configuration option called --enable-sse2. Enable the compilation of SIMD code for SSE2 (Pentium IV+). SSE2 only works in double precision (the default). The resulting code will still work on earlier CPUs lacking the SIMD extensions (SIMD is automatically disabled, although the FFTW library is still larger).

Testing FFTW with this configuration option did not pass the internal checks, so it's use is discouraged.

Click me