In order to start developing, clone the DDSIM repository using
$ git clone --recurse-submodules https://github.com/cda-tum/ddsim
--recurse-submodules flag. It is required to also clone all the required submodules. If you happen to forget passing the flag on your initial clone, you can initialize all the submodules by executing
git submodule update --init --recursive in the main project directory.
A C++ compiler supporting C++17 and a minimum CMake version of 3.19 are required to build the project.
Working on the core C++ library
Our projects use CMake as the main build configuration tool. Building a project using CMake is a two-stage process. First, CMake needs to be configured by calling
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
This tells CMake to search the current directory
. (passed via
-S for source) for a
CMakeLists.txt file and process it into a directory
build (passed via
-DCMAKE_BUILD_TYPE=Release tells CMake to configure a Release build (as opposed to, e.g., a Debug build).
After configuring with CMake, the project can be built by calling
$ cmake --build build --config Release
This tries to build the project in the
build directory (passed via
Some operating systems and developer environments explicitly require a configuration to be set, which is why the
--config flag is also passed to the build command. The flag
--parallel <NUMBER_OF_THREADS> may be added to trigger a parallel build.
Building the project this way generates
the main library
ddsim.lib(Windows) in the
a test executable
ddsim_testcontaining unit tests in the
build/testdirectory (this requires passing
-DBUILD_DDSIM_TESTS=ONto CMake during configuration)
the Python bindings library
build/mqt/ddsimdirectory (this requires passing
-DBINDINGS=ONto CMake during configuration)
Working on the Python module
mqt.ddsim Python module can be conveniently built locally by calling
(venv) $ pip install --editable .
--editable flag ensures that changes in the Python code are instantly available without re-running the command.
Pybind11 is used for providing bindings of the C++ core library to Python (see bindings.cpp). If parts of the C++ code have been changed, the above command has to be run again to make the changes visible in Python.