Compiling and Installing Gromacs 4.6.2 with OpenMPI and Intel on CentOS 6

Step 1: Compiling cmake
To compile Gromacs 4.6.2, first you need to compile cmake 2.8 and above. At this point in writing, the current version is cmake 2.8.11.2

# tar -zxvf cmake-2.8.11.2.tar.gz
# cd cmake-2.8.11.2
# ./configure --prefix=/usr/local/cmake-2.8.11.2
# make
# make install

Step 2: Installing OpenMPI
See Blog Entry Building OpenMPI with Intel Compilers

Step 3: Installing FFTW (Single and Double Precision)
See Blog Entry Compiling and installing FFTW 3.3.3.

Step 4: Compiling Gromacs 4.6.2 (Single-Precision with Intel and OpenMPI)

# tar -zxvf gromacs-4.6.2.tar.gz
# cd gromacs-4.6.2
# mkdir build-cmake
# cd build-cmake
# CC=icc CMAKE_PREFIX_PATH=/usr/local/fftw-3.3.3-single/ /usr/local/cmake-2.8.11.2/bin/cmake .. 
-DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-4.6.2-single-intel -DGMX_X11=OFF -DGMX_MPI=ON 
-DGMX_PREFER_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF
# make
# make install

Step 5: Compiling Gromacs 4.6.2 (Double Precision with Intel and OpenMPI)

# tar -zxvf gromacs-4.6.2.tar.gz
# cd gromacs-4.6.2
# mkdir build-cmake
# cd build-cmake
# CC=icc CMAKE_PREFIX_PATH=/usr/local/fftw-3.3.3-single/ /usr/local/cmake-2.8.11.2/bin/cmake .. 
-DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-4.6.2-single-intel -DGMX_X11=OFF -DGMX_MPI=ON 
-DGMX_PREFER_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DGMX_DOUBLE=ON
# make 
# make install

For more information,

  1. Compiling Gromacs 4.6 and PLUMED from Source
  2. Gromacs Installation instructions

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)