Build from source.

GLUED ships as source only. There is no pip or conda package, on purpose. You need CMake, an OpenMM 8.x install, usually from conda-forge, and a CUDA toolkit if you want the CUDA 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, so 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)

On Miniforge, conda-forge is already the only channel and the commands below work as written. On plain Miniconda they include --override-channels so the solver never hits the Anaconda terms-of-service 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 builds everywhere and covers development and small systems.

Build & install

Pick your OS. The prerequisites and the 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 because every file access crosses the Windows filesystem boundary. Copy the source into WSL first:

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

Keep editing the Windows copy if you like, but 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 need CUDA or OpenCL skip themselves when that platform is missing. A Reference-only build still passes every non-GPU test.

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']

NVRTC version mismatch

Common on Windows and WSL2

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 a driver update to one that supports the NVRTC version bundled with your OpenMM build. Compare nvcc --version with the CUDA version nvidia-smi reports for the driver.

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. One broken entry takes the whole process down. On Ubuntu base images that is usually the pocl ICD pointing at a missing or mismatched libpocl. The GLUED CUDA plugin is fine. OpenMM dies while enumerating plugins, before GLUED loads.

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.