Installing from Source#

This document describes the procedure of how to install (and possibly compile) the Constellation framework from source. The source code can be obtained from the Constellation Git repository:

git clone https://gitlab.desy.de/constellation/constellation.git

Constellation has two separate implementations, one in C++ and one in Python. The tabs below discuss the installation procedure for the two versions separately, but installing both in parallel on the same machine is possible and encouraged.

Prerequisites for C++

The C++ version of Constellation requires:

  • Meson 0.61 or newer

  • C++20 capable compiler like GCC 12 or newer and clang 16 or newer

  • C++20 enabled standard library (GCC’s libstdc++ 12 or newer and LLVM’s libc++ 18 or newer)

The prerequisites can be installed as follows:

Starting with Ubuntu 24.04 and Debian 12 or newer, the official packages for GCC and Meson can be used:

sudo apt install meson g++

Ubuntu 22.04 requires a newer version of GCC than installed by default. Version 12 is recommended and available in the regular package repositories:

sudo apt install meson g++-12
export CXX="g++-12"

Ubuntu 20.04 requires newer versions of GCC and Meson than available from the standard package repositories. They are available in official PPAs:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository ppa:ubuntu-support-team/meson
sudo apt update
sudo apt install meson g++-13
export CXX="g++-13"
sudo dnf install meson clang
export CXX=clang++

MacOS requires an installation of Meson and LLVM, e.g. via Homebrew:

brew install meson
brew install llvm

Assuming ${HOMEBREW_PREFIX} is set (likely /opt/homebrew, can otherwise be found by typing e.g. which meson):

export CXX="${HOMEBREW_PREFIX}/opt/llvm/bin/clang++"
export CC="${HOMEBREW_PREFIX}/opt/llvm/bin/clang"
export LDFLAGS="-L${HOMEBREW_PREFIX}/opt/llvm/lib/c++ -Wl,-rpath,${HOMEBREW_PREFIX}/opt/llvm/lib/c++"
export CXXFLAGS="-fexperimental-library -DASIO_HAS_SNPRINTF"

TODO

Building the C++ Version

meson setup build -Dbuildtype=debugoptimized
meson compile -C build

This is already it!

Prerequisites for Python

The Python version of Constellation requires

  • Python 3.11 or newer

  • The Python venv module

It is also recommended to install the HDF5 development libraries to store data with the H5DataReceiverWriter satellite.

The prerequisites can be installed as follows:

sudo apt install python3-venv libhdf5-dev

TODO

TODO

TODO

Setting up a Python Virtual Environment

python3 -m venv venv
source venv/bin/activate
pip install meson-python meson ninja

Installing the Constellation Package

pip install --no-build-isolation --editable .

To install optional components of the framework, you can install those by replacing . with .[component]. A recommended installation includes the cli and hdf5 components:

pip install --no-build-isolation --editable .[cli,hdf5]