Installation

This guide shows you how to build and install mcmpy. There are two supported installation methods for this project:

  1. Installation using Docker

  2. Local installation using CMake

Installation using Docker

First install Docker. Then clone the GitHub repository and build the Docker image.

git clone --recursive git@github.com:DM-Lab-UvA/MinCompSpin.git
cd MinCompSpin
docker build -t mincompspin .

After building the image, you can run the container:

docker run -p 8888:8888 -it mincompspin

To run a Jupyter notebook in the Docker container

jupyter notebook --ip=0.0.0.0 --no-browser --allow-root

This returns a link beginning with 127.0.0.1, which can be opened in a local browser.

Local installation using CMake

This method requires some system dependencies. Make sure the following are installed:

  • C++ compiler with C++ 11 support

  • CMake >= 3.26.4

  • Python >= 3.11

  • NumPy

Clone the GitHub repository and run the installation script:

git clone --recursive git@github.com:DM-Lab-UvA/MinCompSpin.git
cd MinCompSpin
bash installation.sh

Note

By default, the tests are built but not run. To build the project without the tests, execute the following commands instead:

git clone --recursive git@github.com:DM-Lab-UvA/MinCompSpin.git
cd MinCompSpin
mkdir -p build && cd build
cmake .. -DBUILD_TESTS=OFF
make
cd mcmpy
pip install .

Testing

After installation, the test suite can be run to verify if the installation was succesful:

cd build
ctest --output-on-failure

Using MCMPy

Once mcmpy is installed, it can be imported in Python.

import mcmpy
import numpy as np