Installation

Getting Started

Get the gromacs_py library from github.

git clone https://github.com/samuelmurail/gromacs_py.git
./setup.py install --user

Prerequisites

  1. python 3 libraries:
    • numpy
    • scipy
    • Sphinx and sphinx-argparse (only for building documentation)
  2. pdb2pqr:
git clone https://github.com/Electrostatics/apbs-pdb2pqr.git --branch master --depth=1
cd apbs-pdb2pqr/pdb2pqr/
python scons/scons.py install --prefix=$HOME
  1. Gromacs

Get source code from gromacs website and follow the following command for a quick and dirty install (for more details see gromacs 2019 install guide)

In my case I add to change few options to cmake:

  • -DCMAKE_C_COMPILER=gcc-6, as gcc versions later than 6 are not supported.
  • -DGMX_GPU=on to use GPU acceleration
  • -DCMAKE_INSTALL_PREFIX=../../local-gromacs-2019.2/ to install gromacs in a non-standard location
tar -xfz gromacs-2019.2.tar.gz
cd gromacs-2019.2
mkdir build
cd build
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DCMAKE_C_COMPILER=gcc-6 -DGMX_GPU=on -DCMAKE_INSTALL_PREFIX=../../local-gromacs-2019.2/

# the option -j 4 allow using 4 processor for compilation
make -j 4
make check -j 4
make install -j 4

source ../../local-gromacs-2019.2/bin/GMXRC

Installing

Need to add path of gmx and pdb2pqr to the environment variable $PATH. Add in your ~/.bashrc :

# Add gromacs 'gmx' path:
export PATH='*path_to_gromacs*/bin/':$PATH
# Add pdb2pqr 'pdb2pqr.py' path:
export PATH='*path_to_apbs-pdb2pqr/pdb2pqr/':$PATH

Make the documentation

Need sphinx installed with the argparse sphinx module:

pip3 install Sphinx --user
pip3 install sphinx-argparse --user

You can then build the documentation either in html format or pdf.

cd gromacs_py/doc
# For html documentation:
sphinx-build -b html . _build
# For pdf documentation:
sphinx-build -M latexpdf . _build/

Test installation

Launch test with doctest, will check that module’s docstrings are up-to-date by verifying that all interactive examples still work as documented.

$ ./test_gromacs_py.py
tools.os_command:        TestResults(failed=0, attempted=19)
tools.pdb_manip:         TestResults(failed=0, attempted=127)
tools.pdb2pqr:           TestResults(failed=0, attempted=11)
gromacs.gmx5:            TestResults(failed=0, attempted=52)