Skip to content

Prefixed options, numsim::core namespace, shared numsim-cmake modules - #22

Closed
petlenz wants to merge 8 commits into
mainfrom
refactor/options-namespace-cmake
Closed

petlenz wants to merge 8 commits into
mainfrom
refactor/options-namespace-cmake

Conversation

@petlenz

@petlenz petlenz commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Stacked on #21 (its commits show here until #21 is merged).

What

  • Options are prefixed: NUMSIM_CORE_BUILD_TESTS, NUMSIM_CORE_BUILD_EXAMPLES, NUMSIM_CORE_BUILD_BENCHMARK, NUMSIM_CORE_INSTALL. The generic BUILD_TESTS/BUILD_EXAMPLES leaked into every parent project (numsim-materials even forces them OFF globally). Old names are still honoured with a deprecation warning. Tests/examples default to ON only when numsim-core is the top-level project.
  • Namespace numsim::core, with namespace numsim_core = numsim::core; (numsim-core/namespace.h, included by every header), so downstream code is unaffected. This matches numsim::materials, numsim::fft, numsim::homogenization.
  • numsim-cmake: GoogleTest through numsim_googletest() (installed or pinned v1.15.2 instead of an unpinned zip), tests through numsim_add_test (each test also runs under ASan+UBSan, -Wall -Wextra -Wpedantic -Wconversion -Werror), examples get the warning set. cmake/numsim_bootstrap.cmake takes the modules from ../numsim-cmake when present, else the pinned tag.
  • CMake minimum 3.25.

Verified

122 tests (61 + sanitizer variants) with g++-13 and g++-14; -DBUILD_TESTS=OFF still works and warns.

…18 baseline)

<print> needs libstdc++ 14 and was the only reason numsim-core required
GCC 14. print.h provides print/println with the same compile-time checked
format strings on top of <format>, which libstdc++ 13 has.

CI: gcc-13 and clang-18 (default libstdc++-13) join gcc-14 and clang-19.
- NUMSIM_CORE_BUILD_TESTS / _BUILD_EXAMPLES / _BUILD_BENCHMARK / _INSTALL
  replace the generic BUILD_* names that leaked into parent projects; the
  old names are still read with a deprecation warning; tests and examples
  default to ON only for the top-level project
- namespace numsim::core, with `namespace numsim_core = numsim::core` so
  existing code keeps compiling
- CMake helpers from numsim-cmake: GoogleTest via numsim_googletest(),
  tests via numsim_add_test (ASan+UBSan variants), warnings for examples
@petlenz
petlenz force-pushed the refactor/options-namespace-cmake branch from f429d32 to df03895 Compare October 1, 2026 20:17
@petlenz

petlenz commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Replaced by the single simplified PR.

@petlenz petlenz closed this Oct 1, 2026
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