Tool to compute decoding quantities.
Most functionality is available through a Python package which can be installed with:
pip install asmc-preparedecodingThis Python package is currently available on Linux (x86_64 and aarch64) and macOS (Apple Silicon).
Examples for using the Python package can be found in the following Jupyter notebook:
Please note that you must install Jupyter in order to view the notebook, and then open it:
pip install jupyter
jupyter-notebook notebooks/CreatingDecodingQuantities.ipynbGet the source:
git clone https://github.com/PalamaraLab/PrepareDecoding.git
cd PrepareDecodingYou need a C++17 compiler and CMake 3.25 or later (pip install cmake gets a recent one).
GMP, MPFR and zlib should be obtained from your package manager prior to the CMake configuration step.
Other dependencies (Eigen, {fmt}, cereal, cxxopts, and Catch2 for the tests) are fetched automatically by CMake.
-
Ubuntu/Debian:
sudo apt install cmake libgmp-dev libmpfr-dev zlib1g-dev
-
CentOS/Fedora:
sudo dnf install cmake gmp-devel mpfr-devel zlib-devel
-
macOS:
brew install cmake gmp mpfr
This project uses CMake.
Create a build directory:
mkdir build
cd buildConfigure, and build the PrepareDecoding library and executable:
cmake ..
cmake --build . --parallel 4 --target prepare_decoding_lib
cmake --build . --parallel 4 --target prepare_decoding_exeYou can optionally build the and run the unit tests:
cmake --build . --parallel 4 --target unit_tests
ctest --output-on-failureConfigure with coverage enabled, using g++ or clang++:
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
cmake --build . --parallel 2 --target unit_tests
ctest -j2 --output-on-failure
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/_deps/*' '*/test/*' --output-file coverage.info
lcov --list coverage.infoThis project is configured to work with clang tidy and cppcheck.
Enable the relevant option and compile with clang++.
Any finding fails the build, in CI too: fix it, or suppress a false positive where it occurs with a comment saying why
(see cmake/StaticAnalysers.cmake).
The checks clang-tidy runs are listed in .clang-tidy.
For clang tidy (add -DCLANGTIDY=/path/to/clang-tidy-NN to choose a version):
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_CLANG_TIDY=ON
cmake --build . --parallel 2 --target prepare_decoding_lib prepare_decoding_exeFor cppcheck:
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_CPPCHECK=ON
cmake --build . --parallel 2 --target prepare_decoding_lib prepare_decoding_exeThis project is configured to work with various LLVM sanitisers.
Enable the relevant option, compile with clang++, and run the unit tests.
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITISER_{{{SANITISER}}}=ON
cmake --build . --parallel 2 --target unit_tests
./test/unit_testswhere {{{SANITISER}}} is one of:
Last reviewed: December 2026.
Dependabot updates the GitHub Actions (pinned by commit SHA) weekly. Everything else below is updated by hand: check each for a newer release every few months, and when a new Python version comes out.
| What | Version | Where it is set |
|---|---|---|
| Eigen | 5.0.1 | cmake/Dependencies.cmake |
| {fmt} | 12.2.1 | cmake/Dependencies.cmake |
| cereal | 1.3.2 | cmake/Dependencies.cmake |
| cxxopts | 3.3.1 | cmake/Dependencies.cmake |
| Catch2 | 3.16.1 | cmake/Dependencies.cmake |
| pybind11 | 3.1.0 | pyproject.toml and cmake/Dependencies.cmake: keep them equal |
| scikit-build-core | ≥ 1.1 | pyproject.toml: the minimum also selects its default behaviour |
| cibuildwheel | 4.3.5 | python-wheels.yml (Dependabot) |
| zizmor | 1.31.1 | zizmor-audit.yml |
| Python | 3.11 – 3.15 | see adding a Python version |
| CI runners | Ubuntu 26.04, macOS 15 | .github/workflows |
| CI compilers | GCC 15, Clang 22 | .github/workflows (CXX, and CLANGTIDY in static analysis) |
| macOS deployment target | 15.0 | pyproject.toml: must match the macOS runner, as Homebrew's libraries target it |
| Minimum CMake | 3.25 | CMakeLists.txt (cmake_minimum_required), and this README |
| C++ standard | C++17 | CMakeLists.txt |
| GMP, MPFR, zlib | not pinned | system package managers: apt, brew, and dnf in the manylinux image |
- A C++ dependency: in cmake/Dependencies.cmake, change the archive URL and set
URL_HASHto the new archive's SHA256 (download it and runsha256sum). - pybind11: change both pyproject.toml and cmake/Dependencies.cmake.
- The regression reference outputs in test/regression are never regenerated just to make a test pass. If an update changes the output, find out why; regenerate them only for an intended change, in a commit of its own that says what changed.
cibuildwheel builds wheels for every Python version that requires-python in pyproject.toml
allows, including free-threaded builds, once cibuildwheel itself supports that version. So:
- update cibuildwheel (Dependabot usually has);
- add the version's classifier to pyproject.toml, and its column to the table in PyPI_README.md;
- consider moving regression.yml and one of the
pr-buildentries in python-wheels.yml to the new version.
To drop a version, raise requires-python and remove its classifier.
- Bump the version number in pyproject.toml and CMakeLists.txt
- Update RELEASE_NOTES.md
- Push changes and check that all GitHub workflows pass
- Tag the commit in Git using syntax
vX.Y.Z - Make a release on GitHub. This builds the wheels and the source distribution for every Python version, and uploads
them to PyPI with Trusted Publishing, through the
releaseenvironment.
This project is currently released under the GNU General Public License Version 3.