Biomodeling: Introduction
How to install Gromacs using conda
By using conda, one can make his own environment conveniently.
Install miniconda https://docs.conda.io/en/main/miniconda.html
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
Install Gromacs package using conda
conda create -n gromacs
conda activate gromacs
conda install -c conda-forge gromacs=2023.1=nompi_cuda_ha81c2ac_2
Conda install command above tries to install Gromacs 2023.1 linked with CUDA library, assuming that you have an NVIDIA GPU.
Depending on the environment, you might need to choose another Gromacs image.
See https://anaconda.org/conda-forge/gromacs/files for available Gromacs images.
After installation, “conda activate gromacs” will bring you to the installed environment.
How to install Gromacs using a conventional way
https://manual.gromacs.org/current/index.html
If you have a Nvidia GPU, install CUDA toolkit before installing Gromacs
https://developer.nvidia.com/cuda-toolkit
cmake ../ \
-DGMX_BUILD_OWN_FFTW=ON \
-DGMX_DEFAULT_SUFFIX=OFF \
-DCMAKE_INSTALL_PREFIX=PATH_TO_GROMACS_INSTALLATION \
-DGMX_X11=OFF \
-DGMX_GPU=CUDA \
-DGMX_OPENMP=on \
-DGMX_PREFER_STATIC_LIBS=ON \
-DGMXAPI=OFF \
-DGMX_HWLOC=off
make
make install
source YOUR_INSTALLATION_DIRECTORY/bin/GMXRC.bash
Test your Gromacs installation
Setup Gromacs environments:
If you installed Gromacs using conda,
conda activate YOUR_GROMACS_ENVIRONMENT
If you compiled Gromacs package, you can set up environments by sourcing GMXRC.bash file
source PATH_TO_GROMACS_INSTALLATION/bin/GMXRC.bash
Confirm Gromacs environments:
Check if environmental variables such as $PATH, $GMXDATA etc are set up.
env
echo $GMXDATA
Where is the Gromacs binary located?
which gmx
See Gromacs manual pages
man gmx
man gmx mdrun
man gmx grompp
You need a text editor such as VIM, VS code, or something else.
Gromacs flow chart taken from the official documentation.