Skip to content

Installation

Requirements

  • GPU: NVIDIA GPU with CUDA 12.4+
  • Build Tools: CMake (≥ 3.20), GCC, NVCC
  • Python: Python 3.8+ (for Python bindings)

C++ Executable

Build from Source

Clone the repository and compile the project using CMake:

git clone https://github.com/Lhongpei/PDHCG-II.git
cd PDHCG-II
cmake -S . -B build
cmake --build build --clean-first

This will create the solver binary at ./build/bin/pdhcg.

Specifying CUDA Compiler

If your system has multiple CUDA versions or the default nvcc is outdated, explicitly specify the path to your CUDA compiler:

# Replace '/your/path/to/nvcc' with the actual path, e.g., /usr/local/cuda-12.6/bin/nvcc
CUDACXX=/your/path/to/nvcc cmake -S . -B build
cmake --build build --clean-first

Python Package

pip install pdhcg

From Source

git clone https://github.com/Lhongpei/PDHCG-II.git
cd PDHCG-II
pip install .

Development Installation

For development with editable install:

git clone https://github.com/Lhongpei/PDHCG-II.git
cd PDHCG-II
pip install -e ".[test]"

Verification

C++ Executable

./build/bin/pdhcg --help

Python Package

import pdhcg
print(pdhcg.__version__)

Pre-commit Hooks (For Contributors)

To ensure code quality before committing, install pre-commit hooks:

pip install pre-commit
pre-commit install

This automatically formats Python (Ruff), C/C++ (clang-format), and checks spelling when you commit.