Installation

Build from source.

GLUED is distributed as source. There are no pip or conda packages — by design. You'll need CMake, an OpenMM 8.x install (typically from conda-forge), and optionally a CUDA toolkit if you want the GPU platform.

Prerequisites

RequirementVersionNotes
CMake≥ 3.17
Make or NinjaanyEither generator works for cmake --build
SWIG≥ 4.0Needed for the Python wrapper
Python3.10 – 3.12The conda-forge openmm py3.14 build currently segfaults on import — pin the version
OpenMM8.xFrom conda-forge
pytestanyRequired by the verification step
CUDA toolkitmatched to the OpenMM build (currently cuda-version=12.9)Only for the CUDA platform; works against any modern NVIDIA driver (12.x runtime is forward‑compatible with 13.x drivers)
NVIDIA driver≥ 525Container hosts must mount the driver (--gpus all or NVIDIA Container Toolkit)

If you're using Miniforge, conda-forge is already the only channel and the install just works. If you're on plain Miniconda, the conda commands below include --override-channels so the solver doesn't trip over the Anaconda ToS prompt for the default channels.

Platform support

OS / hardwareReference (CPU)OpenCLCUDA
Linux + NVIDIA
Linux + AMD
Windows + NVIDIA
Windows + AMD/Intel
macOS Intel
macOS Apple Silicon

The Reference platform works everywhere and is fully functional for development and small systems.

Build & install

Pick your OS — the prerequisites and CMake invocation differ slightly.

1. Create the conda environment

conda create -n openmm_env --override-channels -c conda-forge \
    "python=3.12" "cuda-version=12.9" \
    openmm cmake ninja swig pytest \
    cuda-nvcc cuda-cudart-dev cuda-libraries-dev cxx-compiler
conda activate openmm_env

Omit the four cuda-* packages and the cuda-version pin if you only want the Reference + OpenCL platforms.

2. Build

git clone https://github.com/MarvinTaterra/GluedMD.git
cd GluedMD

cmake -S . -B build -G Ninja
cmake --build build
cmake --install build

The install step copies platform plugins into $CONDA_PREFIX/lib/plugins/ and registers the Python wrappers in site-packages.

1. Open an Anaconda Prompt

conda create -n openmm_env --override-channels -c conda-forge ^
    "python=3.12" "cuda-version=12.9" ^
    openmm cmake ninja swig pytest ^
    cuda-nvcc cuda-cudart-dev cxx-compiler
conda activate openmm_env

2. Build

git clone https://github.com/MarvinTaterra/GluedMD.git
cd GluedMD

cmake -S . -B build -G Ninja -DOPENMM_DIR="%CONDA_PREFIX%\Library"
cmake --build build
cmake --install build

The -DOPENMM_DIR override is required on Windows because conda installs OpenMM under Library\ rather than at the prefix root.

1. Conda environment (no CUDA needed)

conda create -n openmm_env --override-channels -c conda-forge \
    "python=3.12" openmm cmake ninja swig pytest
conda activate openmm_env

2. Build

git clone https://github.com/MarvinTaterra/GluedMD.git
cd GluedMD

cmake -S . -B build -G Ninja
cmake --build build
cmake --install build

On Apple Silicon (M1/M2/M3) only the Reference platform builds. On Intel Macs the OpenCL platform is also available via Apple's built-in OpenCL runtime.

Build from the native filesystem

Building from /mnt/c/... is slow due to cross-filesystem I/O. Copy the source to WSL's native filesystem first:

cp -r /mnt/c/Users/<you>/Desktop/glued ~/glued
cd ~/glued
cmake -S . -B build -G Ninja && cmake --build build

The Windows copy can still be used for editing — just build from the WSL copy.

Common CMake options

OptionDefaultEffect
-DOPENMM_DIR=<path>$CONDA_PREFIXOverride OpenMM installation path
-DGLUED_BUILD_PYTHON_WRAPPERS=OFFONSkip SWIG wrapper generation

Build a single platform target

cmake --build build --target OpenMMGluedReference   # CPU reference, no CUDA required
cmake --build build --target OpenMMGluedCUDA        # CUDA platform only
cmake --build build --target OpenMMGluedOpenCL      # OpenCL platform only

Running the tests

# Smoke test — verifies the plugin loads on every available platform
python tests/test_api_smoke.py

# Full pytest suite
python -m pytest tests/ -q

# Single test by name
python -m pytest tests/test_md_enhanced_sampling.py::test_metad_deposits -v

Tests that require CUDA or OpenCL are automatically skipped when that platform is unavailable. A Reference-only build still passes all non-GPU tests.

Verifying the install

import glued
import openmm as mm

f = glued.Force()
print("Available platforms:", [mm.Platform.getPlatform(i).getName()
                                for i in range(mm.Platform.getNumPlatforms())])

Expected output on Linux + NVIDIA:

Available platforms: ['Reference', 'CPU', 'CUDA', 'OpenCL']

Troubleshooting: NVRTC version mismatch

Common Windows / WSL2 error

If you see CUDA_ERROR_UNSUPPORTED_PTX_VERSION (222) at runtime, the NVRTC bundled with conda's OpenMM is newer than your host driver.

Linux / WSL2 quick fix

export LD_PRELOAD=/usr/local/cuda/lib64/libnvrtc.so.XX:/usr/local/cuda/lib64/libnvrtc-builtins.so.XX

Windows quick fix

$env:PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vXX.Y\bin;$env:PATH"

The permanent fix is to update your NVIDIA driver to one that supports the NVRTC version bundled with your OpenMM build (compare nvcc --version to the driver's CUDA version in nvidia-smi).

Troubleshooting: import openmm segfaults

Common on Ubuntu containers

If python -c "import openmm" segfaults immediately after install, the crash is almost always inside an OpenCL ICD loaded from /etc/OpenCL/vendors/, not in OpenMM or GLUED itself.

OpenMM scans /etc/OpenCL/vendors/ at import time and dlopens every .so listed there. A broken third‑party entry (most commonly the pocl ICD on Ubuntu base images, pointing at a missing or version‑mismatched libpocl) takes the whole process down. The GLUED CUDA plugin is fine — OpenMM is just being dragged down while enumerating plugins.

Inspect and fix

ls /etc/OpenCL/vendors/
# For each .icd file, confirm the .so it points to exists at the right version.
# If you only need NVIDIA OpenCL or CUDA, removing the bad entry is safe:
sudo rm /etc/OpenCL/vendors/pocl.icd

Re‑run python -c "import openmm; print(openmm.__version__)" — it should print the version without crashing.