Installation

pyUAMMD is part of the UAMMD-structured repository, but can be installed as a standalone package. It is recommended to install it using conda, as this will ensure that all dependencies are correctly resolved and installed.

Installing from source

pyUAMMD consists of two parts: the Python package that deals with preparing inputs for UAMMD-structured and a C++ wrapper that allows to run simulations directly from Python.

Start by ensuring you have the necessary dependencies for building installed. The UAMMD-structured repository provides an environment.yml file that lists all required packages. You can create a conda environment with these dependencies by running the following at the root of the repository:

conda env create -f environment.yml

Building UAMMD-structured and pyUAMMD

pyUAMMD can be compiled and installed alongside UAMMD-structured by calling CMake with the right options:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/desired/install/path -DBUILD_PYTHON_WRAPPER=ON -DINSTALL_PYTHON_PACKAGE=ON -DBUILD_LIBRARY=ON ..
make -j4 install

Hint

The install path in a conda environment is usally set to $CONDA_PREFIX, so you can use -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX to install it directly into your conda environment.

The command above, if successful, will build UAMMD-structured, the C++ wrapper and finally install it all to the provided path. The Python wrapper (pyUAMMD) is installed via pip, which CMake is configured to do automatically.

Building pyUAMMD when UAMMD-structured is already installed

You might already have UAMMD-structured installed (either via conda or by building it yourself), and want to build pyUAMMD only. The instructions are similar to the previous case. In this case you can instruct CMake to not build the UAMMD-structured library, in which case CMake will try to find the UAMMD-structured library in the system. You can do this by running:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/desired/install/path -DBUILD_PYTHON_WRAPPER=ON -DINSTALL_PYTHON_PACKAGE=ON -DBUILD_LIBRARY=OFF ..
make -j4 install