ginkgo
ginkgo copied to clipboard
Adding CMake Presets
This PR can be used to discuss the addition of CMake presets. So far, I've added only very basic presets which are compatible with the current workflows.
But these preset can be used to set common standards, especially regarding warnings. ATM, we only enforce the -Wpedantic
warnings for our development builds. We could use the presets to define a more rigorous set of warnings.
There might also be other options we might want to set here, this is only a starting point for a discussion.
The workflow using the presets would be as follows:
cd ginkgo
cmake . --presets develop [cmake options...]
cmake --build build-develop
Also, the presets are usually picked up by IDEs.
Another useful feature might be the environment
object, with which we can configure path-independent CXX
and CUDACXX
compiler executable names
Another useful feature might be the
environment
object, with which we can configure path-independentCXX
andCUDACXX
compiler executable names
Are you meaning something like CXX=g++
? I think that would make sense if we would extend the presets to be used in our CI, but otherwise I'm not sure of the benefit of that.
I could imagine develop-clang
being useful from time to time, especially with its better diagnostics
I guess that should also work with cmakes new --workflow
option.
Can we extend this approach to enable builds for HPC systems ? Frontier, Horeka etc.
@pratikvn I think the issue there is that they depend on loaded modules, and the executable names (gcc etc) are the same otherwise, so the configs may not help and differ that much between different systems.
We could consider adding a '-march=native` preset that also includes other optimizations (mixed precision, maybe jacobi full optimizations)
I tend to agree that adding supported machines may clutter the file a bit too much. But it is possible to include configurations from other files, so perhaps we could put these configs into a separate file.