Add CMake Presets#3805
Open
med-ayssar wants to merge 1 commit into
Open
Conversation
a5208df to
6c39206
Compare
Contributor
Author
|
@heplesser, @terhorstd and @gtrensch: could you maybe give it a try and approve it if you see it fit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NEST has no
CMakePresets.json, forcing every developer to manually remember and type the same long-D flagchains every time they configure a build. This adds friction for new contributors and makes it easy to misconfigure.This PR adds
CMakePresets.jsonwith 7 presets covering the most common build scenarios (default,debug,release,mpi,mpi-debug,minimal, docs), so developers can replace verbosecmake -Dwith-mpi=ON -Dwith-optimize=ON ...invocations with a singlecmake --preset <name>.CMake Presets
default-O2, OpenMP, Python, GSL, Boostdebug-g, no optimizationrelease-O3mpi-O2, MPI enabledmpi-debug-g, MPI enabledminimaldocsEach preset puts its binary dir under
build/<preset-name>/to avoid conflicts.List all presets
Configure
Build
Install
Note: you need to run the configure stage first, so that it creates the
buildDir!Example
cmake --preset debug cd build/debug make install -j7