GROMACS is a widely used open-source software program designed for molecular dynamics simulations that investigate the behaviour of complex molecular systems. It is known for its high performance and user-friendly interface. It is an excellent choice for simulating various chemical and biochemical systems, including proteins, nucleic acids, lipids, carbohydrates, and polymers.
GROMACS offers a broad range of capabilities, such as energy minimization, molecular dynamics simulations, free energy calculations, and tools for analyzing and visualizing simulation results.
GROMACS can be installed and used on various operating systems; however, Linux is the most suitable platform due to extensive code testing and better performance. However, if you only have one Windows PC and want to practice and learn the program, don’t bother yourself with installing GROMACS on a real Linux OS installed on a physical partition.
You can install and run GROMACS inside your Windows, and if your system doesn’t have a decent CUDA-enabled graphic card, the performance difference between Windows and Linux installation is negligible.
In this tutorial, I will show you how to install GROMACS on a Windows operating system through a feature of widows called Windows Subsystem for Linux (WSL). This is a viable method for Windows 10 and 11. I will also show you how you can install VMD software and use it alongside the WSL GROMACS. VMD is an excellent molecular visualization program that displays and analyzes molecular systems.
Note: This blog is the text version of the GROMACS installation video tutorial. You can Watch the video here or on the Insilicosci YouTube channel. You can also copy and paste commands from this page if you prefer not to type them.
Installing Ubuntu on Windows Subsystem for Linux
Installing Linux on a Windows subsystem is a straightforward task. You must first enable the Windows subsystem and then pick Ubuntu or any Linux from the Microsoft store.
Installing GROMACS on Windows Subsystem for Linux using Ubuntu package manager
Installing GROMACS on WSL is similar to installing GROMACS on a physical-based Linux.
To start, update the package index list of Ubuntu.
sudo apt update
sudo apt search gromacs
sudo apt install gromacs
After installation, you can check where the GROMACS binary is installed with the following command:
whereis gmx
Compiling GROMACS on Windows Subsystem for Linux
Compiling the source code of GROMACS is another method of installing it. And it is arguably the most challenging method to install GROMACS. So why would someone bother applying this method? This question has three possible answers.
- You may want to compile GROMACS with special features, like the ability to run on GPUs.
- You want to have the latest version of GROMACS.
- You may have a particular Hardware or operating system with no precompiled binary file for them.
sudo apt install -y build-essential gcc vim cmake libpomp-dev hwloc libhwloc-dev
wget -c https://ftp.gromacs.org/gromacs/gromacs-2024.4.tar.gz
tar -xvzf gromacs-2024.4.tar.gz
mkdir gromacs-2024.4/build
cd gromacs-2024.4/build
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/opt/gromacs-24.4 -DCMAKE_C_COMPILER=gcc -DGMX_HWLOC=ON
make -j 4
sudo make install
echo 'source /opt/gromacs-24.4/bin/GMXRC.bash' >> ~/.bashrc
Running GROMACS and VMD on Windows Subsystem for Linux
Download the sample input files from here.
tar -xvzf gromacs_running_test.tgz
cd gromacs_running_test/
gmx grompp -f nvt.mdp -p topol.top -c em.gro -o nvt.tpr -r em.gro -maxwarn 1
gmx mdrun -v -deffnm nvt
Downloads
GROMACS is a free software you can download its source code from the GROMACS website.
To get the GROMACS test simulation input files, click the button below.