Skip to content

build: make Cyberfluids consumable — install/export + zero-setup deps - #7

Merged
leonardoaraujosantos merged 1 commit into
mainfrom
feat/install-export-and-deps
Jul 5, 2026
Merged

leonardoaraujosantos merged 1 commit into
mainfrom
feat/install-export-and-deps

Conversation

@leonardoaraujosantos

Copy link
Copy Markdown
Contributor

Summary

Fixes the two biggest Tier-1 adoption blockers: outside projects couldn't consume Cyberfluids, and building required a manual NumPP sibling checkout.

1. Installable find_package(Cyberfluids) package

  • Installs public headers, the C ABI shared library, and a generated CyberfluidsConfig.cmake + version file.
  • Exports namespaced targets Cyberfluids::core / Cyberfluids::c (clean names via EXPORT_NAME), and re-resolves NumPP transitively with find_dependency.
  • The C ABI library now carries a semver SOVERSION (libcyberfluids_c.so.0.0.1 → .so.0), so consumers can pin ABI compatibility.
  • Gated by -DCYBERFLUIDS_INSTALL (default ON), enabled only when NumPP is an installed package.

Verified end-to-end — a separate CMake project:

find_package(Cyberfluids REQUIRED)
target_link_libraries(app PRIVATE Cyberfluids::core Cyberfluids::c)

…configures, builds, and runs against the installed package (consumer sees D3Q19::q = 19, exit 0).

2. Zero-setup dependency resolution

  • Prefer find_package(NumPP CONFIG) from the bootstrap prefix; when NumPP isn't installed, fall back to FetchContent at a pinned tag (v1.6.0) so a plain cmake -B build works with no manual checkout.
  • Disable with -DCYBERFLUIDS_FETCH_DEPS=OFF for offline/vendored builds.
  • Install/export is disabled in the fetch-only path (a fetched NumPP isn't an installed package the exported config could re-resolve) — with a clear message.

Verified — forcing find_package(NumPP) to miss fetches v1.6.0 and builds the C ABI; install/export correctly skips itself.

Docs + spec (kept in sync)

  • build-and-packaging spec: adds the fetch-fallback and install/export requirements (+ scenarios).
  • docs/getting-started.md: new "Use Cyberfluids in your project" section; drops stale "GPU stubs" / "12 tests" text.
  • README.md: find_package snippet. openspec/project.md: dependency line corrected.

Testing

  • All native tests pass; the 3 python_* failures are the known local Anaconda libstdc++ mismatch (CI's system Python is unaffected).
  • openspec validate --all --strict → 14/14.

Scope note

Tier-1's third item — a self-contained Python wheel (build the C ABI inside the wheel via scikit-build-core) — is intentionally deferred to a focused follow-up PR that can validate a clean-venv pip install. This PR lays the install groundwork it will build on.

Tier-1 adoption blockers: downstream projects could not consume Cyberfluids
(no install rules, no find_package config), and building required a manual
NumPP sibling checkout. Both are fixed.

Installable package (find_package(Cyberfluids)):
- install the public headers, the C ABI shared library (now with a semver-tracked
  VERSION/SOVERSION SONAME), and a generated CyberfluidsConfig.cmake + version file.
- export namespaced targets Cyberfluids::core / Cyberfluids::c (via EXPORT_NAME) and
  re-resolve NumPP transitively with find_dependency.
- verified end to end: a separate CMake project does find_package(Cyberfluids),
  links the targets, builds, and runs against the installed package.
- gated behind CYBERFLUIDS_INSTALL and only enabled when NumPP is an installed
  package (the exported config must be able to re-resolve it).

Zero-setup dependency resolution:
- prefer find_package(NumPP CONFIG) from the bootstrap prefix; when NumPP is not
  installed, fall back to FetchContent at a pinned tag (v1.6.0) so a plain
  `cmake -B build` works with no manual checkout. Disable with
  -DCYBERFLUIDS_FETCH_DEPS=OFF for offline/vendored builds.
- install/export is disabled in the fetch-only path (fetched NumPP is not an
  installed package), with a clear message.

Docs + spec kept in sync: build-and-packaging spec gains the fetch-fallback and
install/export requirements; getting-started.md gets a "Use Cyberfluids in your
project" section and drops stale "GPU stubs" / "12 tests" text; README gains a
find_package snippet; project.md dependency line corrected.

All native tests pass (the 3 python failures are the known local Anaconda
libstdc++ issue). openspec validate --all --strict passes (14/14).
@leonardoaraujosantos
leonardoaraujosantos merged commit 0221bfa into main Jul 5, 2026
3 checks passed
@leonardoaraujosantos
leonardoaraujosantos deleted the feat/install-export-and-deps branch July 5, 2026 12:27
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