Build system¶
pybFoam is built with scikit-build-core driving CMake and nanobind. This page documents the environment variables, CMake options, and CMake targets you may need to know about when building or packaging pybFoam.
Required environment¶
cmake/FindOpenFOAM.cmake is a hard gate: configuration fails immediately
if any of these environment variables are unset. Sourcing
/path/to/OpenFOAM/etc/bashrc defines all of them.
Variable |
Purpose |
|---|---|
|
Root of OpenFOAM source headers; used to find |
|
Directory containing the built OpenFOAM shared libraries
( |
|
Integer label size (32 or 64). Compiled in as
|
|
Floating-point precision ( |
|
OpenFOAM API integer (e.g. |
CMake options¶
Option |
Default |
Effect |
|---|---|---|
|
|
Build |
|
|
Generate |
|
|
Set via |
scikit-build-core configuration¶
From pyproject.toml:
[tool.scikit-build]
cmake.version = ">=3.18"
cmake.build-type = "Release"
build.verbose = true
build-dir = "_skbuild"
editable.mode = "redirect"
editable.verbose = true
editable.rebuild = false
Note that editable.rebuild = false — edits to the C++ sources require
a manual pip install -e .[all] to take effect. Pure-Python edits are
picked up live.
CMake targets exposed by FindOpenFOAM¶
Each target is an INTERFACE IMPORTED library that pulls in the relevant
OpenFOAM headers and shared libraries.
Target |
Wraps |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Umbrella target linking all of the above |
Install layout¶
A non-editable install lays out site-packages/pybFoam/ as:
pybFoam/
├── *.so # nanobind extension modules
├── libnanobind.so # shared nanobind runtime (RPATH=$ORIGIN)
├── embed/
│ ├── lib/libpybFoamEmbed.so
│ ├── include/pybFoamEmbed/
│ └── cmake/pybFoamEmbed/ # pybFoamEmbedConfig.cmake + Targets
└── ...
The verify-embed-install CI job checks this layout — see
.github/workflows/ci.yaml.