The content CMake code was written as a macro. This changes them to function. The significance here is scoping: macro works like C-preprocessor macros, and just blots the code block into the call site. function creates a new, isolated scope.
The benefit here is to keep variables created in a function "inside" the function scope, so they don't pollute the calling namespace. This was causing name-collision issues with updates to singularity-eos downstream (https://github.com/lanl/singularity-eos/pull/221)
2023-02-14
Some sundry updates that are tagging along (mostly from co-developing updates in singularity-eos):
Edit-down and format the default output of the configure stage, making it more informative and easier to read,
$> cmake -DCMAKE_BUILD_TYPE=Debug .. -DSPINER_USE_HDF=ON -DSPINER_TEST_USE_KOKKOS=ON
# ...
-- Content inventory for spinerDeps
-- 2 total declared
-- ports-of-call
-- HDF5
-- making available (this may take a few moments)...
--
Configuring tests
-- Content inventory for spinerTest
-- 2 total declared
-- Catch2
-- Kokkos
-- making available (this may take a few moments)...
# ...
Introduced a basic CMakePresets.json to store some common configuration setups. These provide some convenience in building towards common setups, and are used as cmake .. --prefix=testing-kokkos-gpu (this resolves to cmake .. -DBUILD_TESTING=ON -DSPINER_TEST_USE_KOKKOS=ON -DSPINER_TEST_USE_KOKKOS_CUDA=ON). Specific machine architectures can also be given presets. Presets can also "inherit" from previous ones, allowing for easy construction of new ones. Developers can implement a CMakeUserPresets.json for that expands on the base presets (the user json is ignored by .gitignore). This is useful, for instance, for users with specific environment requirements (@jonahm-LANL @jdolence) to be able to configure the code particularly, without needing the source to be overwrought. CMakePresets.json can also handle build/install and other stages, but for now it seems most beneficial as a convenience for developers. See https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html for more info.
De-tuned the required CMake version (3.23 => 3.22) slightly to allow for easier development/testing on machines that are slower in updating modules (@jhp-lanl)
PR Checklist
N/A Code is formatted. (You can use the format_spiner make target.)
[ ] Adds a test for any bugs fixed. Adds tests for new features.
[ ] If preparing for a new release, update the version in cmake.
PR Summary
The
content
CMake code was written as amacro
. This changes them tofunction
. The significance here is scoping:macro
works like C-preprocessor macros, and just blots the code block into the call site.function
creates a new, isolated scope.The benefit here is to keep variables created in a
function
"inside" the function scope, so they don't pollute the calling namespace. This was causing name-collision issues with updates tosingularity-eos
downstream (https://github.com/lanl/singularity-eos/pull/221)2023-02-14
Some sundry updates that are tagging along (mostly from co-developing updates in
singularity-eos
):CMakePresets.json
to store some common configuration setups. These provide some convenience in building towards common setups, and are used ascmake .. --prefix=testing-kokkos-gpu
(this resolves tocmake .. -DBUILD_TESTING=ON -DSPINER_TEST_USE_KOKKOS=ON -DSPINER_TEST_USE_KOKKOS_CUDA=ON
). Specific machine architectures can also be given presets. Presets can also "inherit" from previous ones, allowing for easy construction of new ones. Developers can implement aCMakeUserPresets.json
for that expands on the base presets (the user json is ignored by.gitignore
). This is useful, for instance, for users with specific environment requirements (@jonahm-LANL @jdolence) to be able to configure the code particularly, without needing the source to be overwrought.CMakePresets.json
can also handle build/install and other stages, but for now it seems most beneficial as a convenience for developers. See https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html for more info.3.23 => 3.22
) slightly to allow for easier development/testing on machines that are slower in updating modules (@jhp-lanl)PR Checklist