Skip to content

Latest commit

 

History

History
201 lines (137 loc) · 4.1 KB

INSTALL.md

File metadata and controls

201 lines (137 loc) · 4.1 KB

Installing with conda

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.

Building from source

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

Linux (NO CUDA)

Prerequisites

Build & install

  1. Get the source code

    git clone https://github.com/openmm/openmm-torch.git
    cd openmm-torch
    
  2. 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
    
  3. 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
    
  4. Build

    make
    make PythonInstall
    
  5. Test

    make test
    
  6. 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.

Linux (CUDA)

Prerequisites

Build & install

  1. Get the source code

    git clone https://github.com/openmm/openmm-torch.git
    cd openmm-torch
    
  2. Make sure your $CUDA_HOME path is set correctly to the path of your CUDA installation

    echo $CUDA_HOME
    
  3. 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
    
  4. 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
    
  5. Build

    make
    make PythonInstall
    
  6. Test

    make test
    
  7. 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.

MacOS

Prerequisites

  1. Get the source code

    git clone https://github.com/openmm/openmm-torch.git
    cd openmm-torch
    
  2. Create and activate a conda environment using the provided environment file

    conda env create -n openmm-torch -f macOS.yaml
    conda activate openmm-torch
    
  3. 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
    
  4. Build

    make
    make PythonInstall
    
  5. Test

    make test
    
  6. 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.