Compiling Gromacs 4.6.0 on HECToR Phase 3

GROMACS compilation consists of two steps:

  • Compiling the serial tools (for the service nodes).
  • Compiling the parallel MD simulation program (for the compute nodes).

Build the serial tools for the frontend nodes

Set up your environment for the serial build

Switch to the login node architecture:

module swap xtpe-interlagos xtpe-istanbul

Switch to the GNU programming environment:

module swap PrgEnv-cray PrgEnv-gnu

and load the FFTW 3 and CMake modules:

module add fftw
module add CMake/2.8.7

Module list for centrally installed serial executables:

Currently Loaded Modulefiles:
  1) modules/3.2.6.6
  2) nodestat/2.2-1.0400.29866.4.3.gem
  3) sdb/1.0-1.0400.30000.6.18.gem
  4) MySQL/5.0.64-1.0000.4667.20.1
  5) lustre-cray_gem_s/1.8.4_2.6.32.45_0.3.2_1.0400.6221.1.1-1.0400.30252.1.29
  6) udreg/2.3.1-1.0400.3911.5.6.gem
  7) ugni/2.3-1.0400.3912.4.29.gem
  8) gni-headers/2.1-1.0400.3906.5.1.gem
  9) dmapp/3.2.1-1.0400.3965.10.12.gem
 10) xpmem/0.1-2.0400.29883.4.6.gem
 11) hss-llm/6.0.0
 12) Base-opts/1.0.2-1.0400.29823.8.1.gem
 13) xtpe-network-gemini
 14) PrgEnv-gnu/4.0.30
 15) xt-mpich2/5.4.4
 16) atp/1.4.3
 17) xt-asyncpe/5.08
 18) pmi/3.0.0-1.0000.8661.28.2807.gem
 19) xt-libsci/11.0.06
 20) xt-totalview/8.9.2
 21) totalview-support/1.1.2
 22) gcc/4.6.2
 23) pbs/10.2.2.113537
 24) packages-phase3
 25) budgets/1.0
 26) xtpe-istanbul
 27) git/1.7.5
 28) fftw/3.3.0.0
 29) CMake/2.8.7

Configure the single-precision build

Create a build directory in the source tree

cd gromacs-4.6.0
mkdir build
cd build

Set the environment variables for the CMake build (note use of native compiler commands):

export CMAKE_PREFIX_PATH=/opt/fftw/3.3.0.0/x86_64
export CXX=g++
export CC=gcc

Use CMake to configure the build:

cmake ../ -DGMX_MPI=OFF -DGMX_X11=OFF -DGMX_OPENMP=OFF -DGMX_GPU=OFF \\
          -DGMX_PREFER_STATIC_LIBS=OFF  \\
          -DCMAKE_INSTALL_PREFIX=/usr/local/packages/gmx/4.6.0-phase3

Build the serial, single-precision code

make install

Configure and build the serial, double-precision code

Create a build directory in the source tree

cd gromacs-4.6.0
mkdir build_d
cd build_d

Use CMake to configure the build:

cmake ../ -DGMX_MPI=OFF -DGMX_X11=OFF -DGMX_OPENMP=OFF -DGMX_GPU=OFF \\
          -DGMX_PREFER_STATIC_LIBS=OFF  -DGMX_DOUBLE=ON \\
          -DCMAKE_INSTALL_PREFIX=/usr/local/packages/gmx/4.6.0-phase3
make install

Build the parallel simulation code for the compute nodes

Set up your environment for the parallel build

Switch to the login node architecture:

module swap xtpe-istanbul xtpe-interlagos

Switch to the GNU programming environment:

module swap PrgEnv-cray PrgEnv-gnu

and load the FFTW 3 and CMake modules:

module add fftw
module add CMake/2.8.7

Module list for centrally installed parallel executables:

Currently Loaded Modulefiles:
  1) modules/3.2.6.6
  2) nodestat/2.2-1.0400.29866.4.3.gem
  3) sdb/1.0-1.0400.30000.6.18.gem
  4) MySQL/5.0.64-1.0000.4667.20.1
  5) lustre-cray_gem_s/1.8.4_2.6.32.45_0.3.2_1.0400.6221.1.1-1.0400.30252.1.29
  6) udreg/2.3.1-1.0400.3911.5.6.gem
  7) ugni/2.3-1.0400.3912.4.29.gem
  8) gni-headers/2.1-1.0400.3906.5.1.gem
  9) dmapp/3.2.1-1.0400.3965.10.12.gem
 10) xpmem/0.1-2.0400.29883.4.6.gem
 11) hss-llm/6.0.0
 12) Base-opts/1.0.2-1.0400.29823.8.1.gem
 13) xtpe-network-gemini
 14) PrgEnv-gnu/4.0.30
 15) xt-mpich2/5.4.4
 16) atp/1.4.3
 17) xt-asyncpe/5.08
 18) pmi/3.0.0-1.0000.8661.28.2807.gem
 19) xt-libsci/11.0.06
 20) xt-totalview/8.9.2
 21) totalview-support/1.1.2
 22) gcc/4.6.2
 23) pbs/10.2.2.113537
 24) packages-phase3
 25) budgets/1.0
 26) xtpe-interlagos
 27) git/1.7.5
 28) fftw/3.3.0.0
 29) CMake/2.8.7

Patch the source for pure static builds

Use the patch file cmake_static_linking.patch to modify the build process to produce purely static builds:

module add git
cd gromacs-4.6.0
git apply cmake_static_linking.patch

Configure and build the parallel, single-precision build

Create a build directory in the source tree

cd gromacs-4.6.0
mkdir build_mpi
cd build_mpi

Set the environment variables for the CMake build (note use of compiler wrapper scripts):

export CMAKE_PREFIX_PATH=/opt/fftw/3.3.0.0/interlagos
export CXX=CC
export CC=cc

Use CMake to configure the build:

cmake ../ -DGMX_MPI=ON -DGMX_OPENMP=ON -DGMX_GPU=OFF -DGMX_PREFER_STATIC_LIBS=ON \\
          -DGMX_X11=OFF -DGMX_DOUBLE=OFF -DCMAKE_SKIP_RPATH=YES \\
          -DCMAKE_C_FLAGS='-static' -DCMAKE_CXX_FLAGS='-static' \\
          -DCMAKE_INSTALL_PREFIX=/usr/local/packages/gmx/4.6.0-phase3
make install-mdrun

Configure and build the parallel, double-precision build

Create a build directory in the source tree

cd gromacs-4.6.0
mkdir build_mpi_d
cd build_mpi_d

Use CMake to configure the build:

cmake ../ -DGMX_MPI=ON -DGMX_OPENMP=ON -DGMX_GPU=OFF -DGMX_PREFER_STATIC_LIBS=ON \\
          -DGMX_X11=OFF -DGMX_DOUBLE=ON -DCMAKE_SKIP_RPATH=YES \\
          -DCMAKE_C_FLAGS='-static' -DCMAKE_CXX_FLAGS='-static' \\
          -DCMAKE_INSTALL_PREFIX=/usr/local/packages/gmx/4.6.0-phase3
make install-mdrun