Compilation#

Installing#

The most reliable method is building wheels and testing that exact artifact:

python -m cibuildwheel --output-dir wheelhouse
pip install --force-reinstall wheelhouse/*.whl

Alternatively, for a more iterative workflow, you can install from the source:

pip install .

This will trigger the CMake build process for all the bundled solvers.

Optional CPLEX-backed MaxHS / iMaxHS#

MaxHS and iMaxHS are optional and controlled by build environment variables.

Default behavior is auto-detect:

  • if CPLEX headers + libraries are found, extensions are built

  • otherwise they are skipped

Relevant variables:

  • CPLEX_INC_DIR

  • CPLEX_LIB_DIR

  • HERMAX_ENABLE_MAXHS (auto | on | off)

  • HERMAX_ENABLE_IMAXHS (auto | on | off)

Example forcing both on:

export CPLEX_INC_DIR=/path/to/cplex/include
export CPLEX_LIB_DIR=/path/to/cplex/lib-or-bin
export HERMAX_ENABLE_MAXHS=on
export HERMAX_ENABLE_IMAXHS=on
pip install .

Example forcing both off (recommended for generic wheel builds):

export HERMAX_ENABLE_MAXHS=off
export HERMAX_ENABLE_IMAXHS=off
pip install .

Optional OptiLog Formula Support#

Hermax can optionally accept OptiLog WCNF formulas by converting them to PySAT WCNF internally.

pip install optilog==0.6.1

This dependency is optional because OptiLog has a separate proprietary licensing model.

CIBuildWheel#

hermax uses cibuildwheel for generating multi-platform wheels. The configuration is stored in pyproject.toml.