GROMACS

Install GROMACS for PyMACS on Linux or WSL2

Install GROMACS for PyMACS on Linux or WSL2, verify the shared system executable, understand Conda-independent usage, and continue into the PyMACS workflow.

Overview

PyMACS requires access to GROMACS for system setup, equilibration, production MD, trajectory processing, and related helper commands. The companion installer provides a reproducible Linux and WSL2 path that installs GROMACS at the system level instead of inside a Conda environment.

Linux WSL2 GROMACS 2026.3 NVIDIA CUDA Conda-independent

Who should use this installer?

Good fit

Linux workstation users, WSL2 users, PyMACS users without a working GROMACS installation, and users who want one shared system gmx executable across base, cgenff, and mdanalysis.

Use another path

Managed HPC systems, administrator-provided module environments, and platforms not supported by the companion installer should generally keep using the local institutional GROMACS path instead of replacing it.

Why install GROMACS system-wide?

Python dependencies and GROMACS solve different problems. PyMACS may use separate cgenff and mdanalysis environments for Python packages, but those environments should still call the same system executable at /usr/local/bin/gmx.

  • One GROMACS installation instead of duplicated environment-specific copies.
  • Consistent debugging because every environment resolves to the same executable.
  • Cleaner separation between Python package management and the MD engine.
  • Versioned installation paths and build records that support reproducibility.
1

GROMACS

System simulation engine

2

PyMACS

Automation scripts and workflow

3

Python environments

cgenff and mdanalysis

4

First simulation

Run Example 1

/usr/local/bin/gmx
base cgenff mdanalysis future environments ordinary shell

Conda manages the Python environments. GROMACS remains a shared system-level simulation engine.

Quick installation

Run the companion installer from a normal Linux or WSL2 shell. The current repository installs GROMACS 2026.3 under /usr/local/gromacs-2026.3, creates a stable /usr/local/gromacs symlink, and exposes /usr/local/bin/gmx.

Copy command
git clone https://github.com/Joey305/gromacs-installation.git
cd gromacs-installation
chmod +x install_gromacs.sh
./install_gromacs.sh
hash -r
source /etc/profile.d/gromacs.sh
gmx --version

Verify the installation

Refresh the current shell, then confirm that gmx runs and resolves to the intended system executable.

  • Expected executable path: /usr/local/bin/gmx
  • For a CUDA-enabled build, gmx --version should report GROMACS version 2026.3 and GPU support: CUDA when the installer detected a supported NVIDIA path.
Copy command
hash -r
source /etc/profile.d/gromacs.sh
gmx --version
which gmx

Verify across environments

The point of this workflow is that Conda environments manage Python packages while the system GROMACS executable remains shared.

  • base, mdanalysis, and cgenff should all resolve to /usr/local/bin/gmx in the shared workstation workflow.
  • If one environment resolves somewhere else, inspect the PATH and check for a second GROMACS installation inside that environment.
Copy command
conda activate base
which gmx
gmx --version

conda activate mdanalysis
which gmx
gmx --version

conda activate cgenff
which gmx
gmx --version

NVIDIA GPU / CUDA and WSL2

The companion repository can detect NVIDIA GPU availability and build CUDA-enabled GROMACS when the machine and toolkit satisfy the documented requirements. On WSL2, Windows provides the NVIDIA driver layer and the Linux side should follow the repository's WSL-aware CUDA guidance.

  • Check GPU visibility with nvidia-smi before troubleshooting CUDA-enabled builds.
  • The current installer repository documents CUDA >= 12.1 support and prefers cuda-toolkit-12-6 on supported Ubuntu and WSL2 paths.
  • Do not install a Linux NVIDIA display driver inside WSL2; follow the repository's toolkit guidance instead.
Copy command
nvidia-smi
gmx --version

Conda shadowing and gmx: command not found

A later Conda package can expose a different gmx than the intended system executable. When that happens, PyMACS may call the wrong binary or fail to find the system copy you expected.

  • The intended system executable for this workflow is /usr/local/bin/gmx.
  • If a Conda environment exposes its own $CONDA_PREFIX/bin/gmx, remove that separate Conda GROMACS package or call the system executable explicitly.
  • If gmx is still missing, rerun the latest companion installer and follow its troubleshooting guidance.
Copy command
type -a gmx

hash -r
source /etc/profile.d/gromacs.sh
which gmx
gmx --version

Existing GROMACS installations and HPC users

Already have GROMACS?

If gmx --version already works and the version and build are appropriate for your PyMACS workflow, you may not need to install another copy.

Cluster or MPI environment

Workstation defaults should not automatically replace cluster-specific installations. HPC users should normally use module systems, administrator-provided GROMACS builds, and cluster-specific MPI or GPU instructions, then point PyMACS at the proper executable.

Continue to PyMACS

GROMACS working?

Continue to the PyMACS installation guide, then create the cgenff and mdanalysis environments and run Example 1.

Install PyMACS