PGI Guide to Gromacs

This guide is intended to help build the GROMACS molecular dynamics package for Linux using PGI 2011 compilers.

Version Information

This guide was created for GROMACS release 4.5.5 compiled using the PGI 2011 compilers. This information is for both x64 processors running 64-bit Linux and x86 processors running 32 bit Linux.

Application Notes

Information about Gromacs can be found on the Gromacs website. From the GROMACS home page:

"GROMACS is a versatile package to perform molecular dynamics, i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles."

"It is primarily designed for biochemical molecules like proteins, lipids and nucleic acids that have a lot of complicated bonded interactions, but since GROMACS is extremely fast at calculating the nonbonded interactions (that usually dominate simulations) many groups are also using it for research on non-biological systems, e.g. polymers."

Obtaining the Source Code

The GROMACS 4.5.5 source code is available from the Gromacs website referenced above. You may want to check there for recent updates.


GROMACS requires an FFT library such as FFTW3 (see build instructions).

Building, Testing and Installing GROMACS

  1. Untar the GROMACS package:

      tar -xvzf gromacs-4.5.5.tar.gz
      cd gromacs-4.5.5
  2. Gromacs should be configured and built twice. Once for normal executables, and a second time to enable MPI executables.

      env CC=pgcc F77=pgf90 CXX=pgCC CFLAGS="-fast -fPIC" FFLAGS="-fast  \
        -fPIC" CXXFLAGS="-fast -fPIC" ./configure --with-fft=fftw3       \

    You can trying using Fortran kernels which may result in a faster executable for some configurations. To do this add the following to the end of the configure command:

      --enable-fortran --disable-threads
  3. Build the code:

      make >& make.log
  4. Finally, install the results. Note that the installation process re-links some executables, so if you install as root, the compilers have to be in root's $PATH:

      sudo make install
  5. To compile for MPI requires a change to the configure file. The configure script assumes (wrongly) that the mpicc linker will support the GNU extension --rpath. PGI does not support this. Edit the configure file and replace all instances of ‑‑rpath with -R. When this is done, rerun configure with MPI:

      env CC=pgcc F77=pgf90 CXX=pgCC CFLAGS="-fast -fPIC" FFLAGS="-fast  \
       -fPIC" CXXFLAGS="-fast -fPIC" ./configure --with-fft=fftw3        \
       --enable-mpi --program_suffix=_mpi --enable-fortran               \
  6. Build the code:

      make clean
      make >& make.log
  7. Finally, install the results:

      sudo make install
  8. Known Issues and Limitations

    None other than those noted above

Click me