This repository contains the LaTeX source and generated code examples for Modeling and Programming with Gecode. This checkout targets Gecode 6.4.0.
Document inputs live under docs/src/:
docs/src/template/main template (MPG.tex.in.in)docs/src/chapters/chapter sources grouped by domaindocs/src/static/static TeX includes (macros.tex,license.tex)docs/src/bib/bibliography inputsdocs/src/assets/non-TeX source assets (for example.vis,.xsd)docs/src/notes/plain-text companion material
The tooling also recognizes the legacy root paths and warns when it uses them.
The project now uses a Python CLI as the primary interface:
uv run -- python -m tools.mpg doctor
uv run -- python -m tools.mpg extract
uv run -- python -m tools.mpg build --kind all
uv run -- python -m tools.mpg run --kind all
uv run -- python -m tools.mpg test --kind all
uv run -- python -m tools.mpg docs
uv run -- python -m unittest discover -s tests -p "test_*.py"A thin Makefile is kept with the common targets:
make quick, make docs, make extract, make build, make build-test, make build-notest, make test, make clean.
You can pass Gecode location through make variables, for example:
make test GECODE_ROOT=/Users/zayenz/gecode/gecode or make build GECODE_PREFIX=/usr/local.
If neither is set and ../gecode/test/test.cpp exists, the Makefile auto-uses ../gecode for full test coverage.
For release validation, build the current Gecode main branch and pass that checkout as GECODE_ROOT:
git clone --depth=1 --branch main https://github.com/Gecode/gecode.git ../gecode
cmake -S ../gecode -B ../gecode/build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DGECODE_ENABLE_QT=OFF -DGECODE_ENABLE_GIST=OFF \
-DGECODE_ENABLE_MPFR=OFF -DGECODE_ENABLE_CPPROFILER=OFF
cmake --build ../gecode/build --parallel
make test GECODE_ROOT=../gecode
make docsOnce the Gecode release tag exists, use --branch release-6.4.0 for the final release check. The 6.3.0 sources remain available as the release-6.3.0 tag.
MPG supports three dependency modes:
- System install (default): no path flags.
- Explicit install prefix:
--gecode-prefix /path/to/prefix. - Explicit source/build tree:
--gecode-root /path/to/gecode.
Some test examples require Gecode test framework sources (test.cpp, int.cpp, float.cpp, set.cpp).
If these are unavailable from the current configuration, MPG fails with guidance.
For full coverage, use:
uv run -- python -m tools.mpg test --kind all --gecode-root ../gecodeGenerated files are written to .mpg/:
.mpg/generated/tex/processed TeX files.mpg/generated/src/extracted C++ snippets.mpg/build/CMake/Ninja build trees.mpg/bin/compiled executables.mpg/results/machine-readable run summaries.mpg/manifests/per-kind example manifests used byrun.mpg/manifest.jsoncopy of the last manifest, kept for older tooling
uv run -- python -m tools.mpg docs uses the standard document pipeline:
latexbibtexdvipsps2pdf
This keeps the existing chapter, code, and link structure while using the Python CLI to run the build steps.
mpg.toml is optional and supports overrides:
version,yearchapters,models,tests,notestcompile_flagsrun_timeout_sec- per-example metadata in
[examples.<id>]
examples.ymlruns periodic checks formake testandmake docson Linux. By default, it checks out and buildsGecode/gecodeatmain. It can also be run manually against another repository or ref through thegecode_repositoryandgecode_refworkflow inputs. For the final release check, setgecode_reftorelease-6.4.0once that tag exists.docs.ymlbuilds the PDF on Linux and publishes it as an artifact.