Installation of Gromacs-5.1.4

First and foremost, you need to get the source files (with .tar.gz extension) from homepage of Gromacs. Then open a terminal and type the following command:

tar -xzvf gromacs-5.1.4.tar.gz cd gromacs-5.1.4 mkdir build

This extracts the files from the .tar.gz file to a folder with the same file name and creates a build directory.

mkdir /home/username/gromacs_bin cmake /home/username/gromacs-5.1.4 -DCMAKE_PREFIX_PATH=/home/username/fftw_bin/include: /home/username/fftw_bin/lib -DFFTWF_INCLUDE_DIR=/home/username/fftw_bin/include: /home/username/fftw_bin/lib -DFFTWF_LIBRARY=/home/username/fftw_bin/lib/libfftw3f.so -DCMAKE_INSTALL_PREFIX=/home/username/gromacs_bin

And in fact, I have no idea why cmake has such a complex and long option name, which makes this command look so intimidating. If everything goes fine, please go to the directory /home/username/gromacs-5.1.4/src/gromacs/fft/ and change the follwing lines in the fft5d.h as well as fft_fftw3.ccp file from:

#include <fftw3.h>
to
#include </home/username/fftw_bin/include/fftw3.h>

We can then run the make command for the installation.

make prefix=/home/username/gromacs_bin make prefix=/home/username/gromacs_bin install

After the installation, you have to include the directory path in the .bash_profile such that the computer knows where you have installed gromacs.

nano .bash_profile

I prepare to use the nano because of its more user-friendly interface compared to that vi. In the .bash_profile, please write:

export PATH=/home/username/gromacs_bin/bin:$PATH

Logout and login again, and now you can use gromacs for molecular simulation!

Go back; Go back to Main Page