Skip to content

Build: take the SuiteSparse headers lightsim2grid_core ships - #26

Open
BDonnot wants to merge 1 commit into
mainfrom
ls2g_shipped_klu_headers
Open

BDonnot wants to merge 1 commit into
mainfrom
ls2g_shipped_klu_headers

Conversation

@BDonnot

@BDonnot BDonnot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

The lightsim2grid bridge needs klu.h / cs.h (lightsim2grid_core exports KLU_SOLVER_AVAILABLE). lightsim2grid >= 1.3.0 ships them with the core and puts them on lightsim2grid::core's include path (Grid2op/lightsim2grid#250), but the lookup in src/_cpp/CMakeLists.txt never looked there: with lightsim2grid installed from a wheel it stopped on its FATAL_ERROR at configure.

This adds a step "1b" (after the explicit SUITESPARSE_INCLUDE_DIR override, so that one still wins): if one of lightsim2grid::core's include directories holds klu.h, the headers are found and nothing is added. Against an older lightsim2grid it finds nothing and the existing lookups run as before. Plus the comment / error message updated, a stale pointer to a non-existent doc dropped, and a changelog line.

Tested (Linux, RTX A1000, CUDA 12.4.1, cuDSS 0.8.0, --no-build-isolation)

lightsim2grid installed from main this branch
PyPI wheel 1.2.0 configure fails (SuiteSparse headers not found) same, as expected: 1.2.0 ships no headers
wheel built from lightsim2grid#250 configure fails (same error) builds; test_base_case.py, test_acpf_resolve.py, test_new_api.py: 31 passed, 9 skipped (torch not installed)

Until lightsim2grid 1.3.0 is released, a build with build isolation pulls 1.2.0 from PyPI and still needs one of the other three lookups.

🤖 Generated with Claude Code

The lightsim2grid bridge needs klu.h and cs.h, because lightsim2grid_core
exports KLU_SOLVER_AVAILABLE. lightsim2grid >= 1.3.0 installs them with the
core and puts them on lightsim2grid::core's include path (lightsim2grid
PR #250), but the lookup here never looked there: with lightsim2grid
installed from a wheel, none of the three places it tried has them, and
configure stopped on its FATAL_ERROR before compiling anything.

Accept them when one of lightsim2grid::core's include directories holds
klu.h, after the explicit SUITESPARSE_INCLUDE_DIR override so that one still
wins. Against an older lightsim2grid the check finds nothing and the
existing lookups run as before.

Also drop the comment's pointer to docs/lightsim2grid_requirements.md,
which does not exist.

Assisted-by: Claude Code (claude-opus-5-5)
Signed-off-by: Benjamin Donnot <benjamin.donnot@rte-france.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant