From hpx-dev
Guides building and configuring HPyX (CMake + scikit-build-core + Nanobind + pixi), diagnoses CMake/compilation/link errors, explains `nanobind_add_module` usage, configures conda-forge dependencies, and resolves RPATH issues. Use when the user asks about "build system", "CMake configuration", "scikit-build-core", "pixi", "build errors", "compilation errors", "link errors", "nanobind_add_module", "CMakeLists.txt", "pyproject.toml", "pixi.toml", "build HPX from source", "install dependencies", "RPATH", "conda-forge", or hits build failures, missing library errors, or environment setup issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hpx-dev:build-systemThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
pixi.toml → Environment & dependency management (conda-forge + PyPI)
pyproject.toml → Python package metadata + scikit-build-core config
CMakeLists.txt → C++ compilation, Nanobind module, HPX linking
The build flow:
pixi resolves and installs all dependencies (HPX, Nanobind, compilers, Python 3.13t)pip install -e . (or pixi run test) triggers scikit-build-core_core Nanobind module_core.so / _core.pyd is installed into the hpyx packageKey environments defined in pixi.toml:
| Environment | Purpose | Features |
|---|---|---|
py313t | Default development | Python 3.13 free-threading + HPX + HPyX |
test-py313t | Testing | Above + pytest |
benchmark-py313t | Benchmarking | Above + pytest-benchmark + threadpoolctl |
build-py313t | Distribution builds | Python 3.13 free-threading + build tools |
docs | Documentation | Python 3.13 + MkDocs |
linting | Code quality | Python 3.13 + pre-commit |
py313t-src | Build HPX from source | Python 3.13 free-threading + HPX build deps |
Common pixi commands:
pixi shell -e py313t # Enter dev environment
pixi run test # Run tests
pixi run benchmark # Run benchmarks
pixi run lint # Run linters
pixi run -e docs start # Start docs server
The CMakeLists.txt key sections:
find_package(Python 3.13 COMPONENTS Interpreter Development.Module REQUIRED)
find_package(nanobind CONFIG REQUIRED)
find_package(HPX REQUIRED)
nanobind_add_module(
_core
FREE_THREADED # Required for Python 3.13 free-threading
src/bind.cpp
src/init_hpx.cpp
src/algorithms.cpp
src/futures.cpp
# Add new source files here
)
target_link_libraries(_core PRIVATE
HPX::hpx
HPX::wrap_main
HPX::iostreams_component
)
src/new_feature.cpp and src/new_feature.hppnanobind_add_module():
nanobind_add_module(
_core
FREE_THREADED
src/bind.cpp
src/init_hpx.cpp
src/algorithms.cpp
src/futures.cpp
src/new_feature.cpp # New file
)
target_link_libraries:
target_link_libraries(_core PRIVATE
HPX::hpx
HPX::wrap_main
HPX::iostreams_component
HPX::new_component # Additional HPX component
)
[build-system]
requires = ["scikit-build-core>=0.10", "nanobind>=2.7.0"]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
wheel.packages = ["src/hpyx"]
The src/ layout means Python sources live in src/hpyx/ while C++ sources are in src/ at the project root.
When the latest HPX version is not yet on conda-forge:
pixi shell -e py313t-src
pixi run build-hpx tag=v1.11.0-rc1
pixi run install-latest-lib
This uses scripts/build.sh to:
vendor/hpx/Could not find a package configuration file provided by "HPX"
Fix: Ensure HPX is installed: pixi shell -e py313t (conda-forge provides HPX)
Could not find a configuration file for package "nanobind"
Fix: Run pip install nanobind>=2.7.0 or ensure the pixi environment is active
dyld: Library not loaded...
Fix: The CMakeLists.txt sets CMAKE_INSTALL_RPATH "$ORIGIN". On macOS, the dynamic_lookup flag handles Python symbol resolution. Ensure building within the pixi environment.
undefined reference to `hpx::some_function`
Fix: Add the missing HPX component to target_link_libraries. Check which HPX target provides the symbol by searching vendor/hpx/cmake/.
pip install --no-build-isolation -ve . # Editable install, fast rebuild
# Or with auto-rebuild on import:
pip install --no-build-isolation -ve . -Ceditable.rebuild=true
# 1. Enter dev environment
pixi shell -e py313t
# 2. Edit C++ source files
# 3. Rebuild (fast, editable)
pip install --no-build-isolation -ve .
# 4. Verify the rebuild: _core.*.so should exist under src/hpyx/
ls src/hpyx/_core*.so
# 5. Test
pixi run test
# 5. Benchmark (optional)
pixi run benchmark
npx claudepluginhub uw-ssec/hpyx --plugin hpx-devProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.