We provide conda packages for Linux and MacOS via conda-forge
, which can be installed from the conda-forge channel:
conda install -c conda-forge openmm-torch
If you don't have conda
available, we recommend installing Miniconda for Python 3 to provide the conda
package manager.
Depending on your environment there are different instructions to follow:
- Linux (NO CUDA): This is for Linux OS when you do have have, or do not want to use CUDA.
- Linux (CUDA): This is for Linux OS when you have CUDA installed and have a CUDA device you want to use.
- MacOS
-
Get the source code
git clone https://github.com/openmm/openmm-torch.git cd openmm-torch
-
Create and activate a conda environment using the provided environment file
conda env create -n openmm-torch -f linux_cpu.yaml conda activate openmm-torch
-
Configure
mkdir build && cd build # set the Torch_DIR path export Torch_DIR="$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')" cmake .. -DOPENMM_DIR=$CONDA_PREFIX \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
-
Build
make make PythonInstall
-
Test
make test
-
Install
make install
Your built version of openmm-torch will now be available in your conda environment. You can test this by trying to import openmmtorch
into python
.
python -c "from openmmtorch import TorchForce"
Should complete without error.
- Minconda https://docs.conda.io/en/latest/miniconda.html#linux-installers
- CUDA Toolkit https://developer.nvidia.com/cuda-downloads
-
Get the source code
git clone https://github.com/openmm/openmm-torch.git cd openmm-torch
-
Make sure your
$CUDA_HOME
path is set correctly to the path of your CUDA installationecho $CUDA_HOME
-
Create and activate a conda environment using the provided environment file
conda env create -n openmm-torch -f linux_cuda.yaml conda activate openmm-torch
-
Configure
mkdir build && cd build # set the Torch_DIR path export Torch_DIR="$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')" cmake .. -DOPENMM_DIR=$CONDA_PREFIX \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
-
Build
make make PythonInstall
-
Test
make test
-
Install
make install
Your built version of openmm-torch will now be available in your conda environment. You can test this by trying to import openmmtorch
into python
.
python -c "from openmmtorch import TorchForce"
Should complete without error.
-
Get the source code
git clone https://github.com/openmm/openmm-torch.git cd openmm-torch
-
Create and activate a conda environment using the provided environment file
conda env create -n openmm-torch -f macOS.yaml conda activate openmm-torch
-
Configure
mkdir build && cd build # set the Torch_DIR path export Torch_DIR="$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')" cmake .. -DOPENMM_DIR=$CONDA_PREFIX \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
-
Build
make make PythonInstall
-
Test
make test
-
Install
make install
Your built version of openmm-torch will now be available in your conda environment. You can test this by trying to import openmmtorch
into python
.
python -c "from openmmtorch import TorchForce"
Should complete without error.