Compiling and installing FFTW 3.3.3 with OpenMPI and OpenMP

This Blog entry is an extension of the Compiling and installing FFTW 3.3.3

To Compile FFTW 3.3.3 single precision with OpenMPI, make sure you compile and set your path for Intel and OpenMPI. You may want to get more information from Compiling OpenMPI 1.6.5 with Intel 12.1.5 on CentOS 6

Step 1: Compiling FFTW 3.3.3 (Single Precision) with OpenMPI and OpenMP

After unpacking FFTW 3.3.3, you may want to use the flags

# ./configure CC=icc 
--enable-float --enable-threads --enable-openmp \
--enable-mpi MPICC=mpicc \
LDFLAGS=-L/usr/local/openmpi/intel/lib CPPFLAGS=-I/usr/local/openmpi/intel/include \ 
--prefix=/usr/local/fftw-3.3.3-single
# make -j8
# make install

Inside /usr/local/fftw-3.3.3-single/lib, you should see at least the files below

libfftw3f.a
libfftw3f_mpi.a
libfftw3f_omp.a
libfftw3f_threads.a
....
....

Step 2: Compiling FFTW 3.3.3 (Double Precision) with OpenMPI and OpenMP

# ./configure CC=icc 
--enable-threads --enable-openmp \
--enable-mpi MPICC=mpicc \
LDFLAGS=-L/usr/local/openmpi/intel/lib CPPFLAGS=-I/usr/local/openmpi/intel/include \ 
--prefix=/usr/local/fftw-3.3.3-single
# make -j8
# make install

Inside /usr/local/fftw-3.3.3-double/lib, you should see at least the files below

libfftw3.a
libfftw3_mpi.a
libfftw3_omp.a
libfftw3_threads.a
....
....

Compiling and installing FFTW 3.3.3

1. FFTW 3.3.3 (Single Precision)

# ./configure --enable-float --enable-threads
# make
# make install

2. FFTW 3.3.3 (Double Precision)

# ./configure --enable threads
# make
# make install

3. Important Note.

If you using FFTW with Gromacs, you may want to compile without threading as according to the document at Gromacs Installation Instructions

…..On x86 hardware, compile only with --enable-sse2 (regardless of precision) even if your processors can take advantage of AVX extensions. Since GROMACS uses fairly short transform lengths we do not benefit from the FFTW AVX acceleration, and because of memory system performance limitations, it can even degrade GROMACS performance by around 20%……

3a. FFTW 3.3.3 (Single Precision)

# ./configure --enable-float --enable-sse2 
# make 
# make install

3b. FFTW 3.3.3 (Double Precision)

# ./configure --enable-sse2 
# make 
# make install

References:

  1. FFTW Home Page
  2. Installation of FFTW (http://www.uvm.edu/~smanchu/fftw_installation.html)