Author: He XingChen
Last Updated: 2026-08-14

Installation

Requirements

  • Python >= 3.10

  • NumPy >= 1.20.0

  • A Fortran compiler with OpenMP support (gfortran >= 9) to build the native backend

Install

pip install cnchash

After installing, build the native backend (or let the package build helper do it):

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

The package auto-detects libhashhp (also via CNCHASH_HASHHP_LIB).

Development Setup

pip install -e ".[dev]"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

Verify Installation

from cnchash import run_hash, get_backend_info
print(get_backend_info())

get_backend_info() reports the backend, OpenMP thread count, and library path. Without the compiled library a clear build error is raised.