Skip to content

Installation

Requirements

Component Requirements
Build CMake ≥ 3.20, C99 compiler, zlib
CPU backend OpenMP, LP64 BLAS/LAPACK
CUDA backend CUDA Toolkit ≥ 12.4 with NVCC; compatible NVIDIA GPU to run
Python bindings C++17 compiler, Python ≥ 3.8, NumPy ≥ 1.21, SciPy ≥ 1.8
Multi-GPU (optional) MPI, NCCL, C++17 compiler

Backend build choices and runtime selection are documented together in Devices.

Python Package

pip install pdhcg

CVXPY

For the optional CVXPY integration:

pip install "pdhcg[cvxpy]"

From Source

git clone https://github.com/pdhcg/PDHCG.git
cd PDHCG
pip install .

Verify the installation:

import pdhcg
print(pdhcg.__version__)

Continue with the Python quick start.

Command-Line Executable

The same source build provides the native library and executable:

git clone https://github.com/pdhcg/PDHCG.git
cd PDHCG
cmake -S . -B build
cmake --build build
./build/pdhcg --help

See Command line for file solving and C API for linking an application. For backend options and multi-GPU builds, see Devices.

CUDA Compiler

To select a CUDA toolchain explicitly, set CUDACXX before configuring:

CUDACXX=/path/to/nvcc cmake -S . -B build

The same environment variable applies to pip install . source builds.

Development Installation

From a checkout:

pip install -e ".[dev,test]"
pre-commit install

The hooks run Ruff, clang-format, and file consistency checks.