You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a CMakePresets.json file with some common presets. #5804
Inheritance is only sufficient for certain setups. Others would need composition/optionality/scripting support. For example: if I want to make some setting (e.g. which backends to build, whether to use ccache) optional, I would need to create two configure presets: setting_enabled and setting_disabled. To then build, I would need to create a matching build preset for each: setting_enabled and setting_disabled. That leads to a state space explosion if build presets then include other options.
Branching by platform (e.g. IREE_ENABLE_LLD, IREE_BUILD_TRACY, -DCMAKE_C_COMPILER=clang vs MSVC) won't really work effectively because of that inheritance setup.
"workflow presets" let you group configure -> build -> test -> etc. steps. They can only be used with a shared configure step though, so you can't have a crosscompilation workflow that runs configure (host) -> build (host) -> install -> configure (target) -> build (target).
Now... we may be able to create something workable with:
a base configure/build preset in CMakePresets.json that sets a minimal list of options (-DIREE_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo, etc.)
some common presets that we currently have scripts for (build_runtime.sh, build_runtime_small.sh)
a script that helps generate a platform-specific CMakeUserPresets.json, maybe with some CLI magic for "do you want to use ccache? which backends do you want?"
Even if the configs are totally flat, I think they would be quite useful. If we end up with a bunch of repetition we could even do our own composition in a somewhat-sane language like Python and then generate a bunch of json files
Regardless of what we do as long as this is CMakePresets.json.template or something then we can land an iterate. One of the many major issues with presets is that the presence of the file will trigger most IDE's/editors to switch to using them and if your configuration isn't supported it gets really painful (nothing will work until you delete the file or go set environment variables before launching the editor, which sucks). This would let us side-step some of the hierarchy issues to start as we could have a template for primarily compiler + host runtime usage and one or more for specific runtime/cross-compiling usage.
Activity
ScottTodd commentedon Mar 9, 2023
Here's a draft of a presets file: https://gist.github.com/ScottTodd/dd4100b22d085723baa3679a7cfbf544
Some impressions:
Inheritance is only sufficient for certain setups. Others would need composition/optionality/scripting support. For example: if I want to make some setting (e.g. which backends to build, whether to use ccache) optional, I would need to create two configure presets: setting_enabled and setting_disabled. To then build, I would need to create a matching build preset for each: setting_enabled and setting_disabled. That leads to a state space explosion if build presets then include other options.
Branching by platform (e.g.
IREE_ENABLE_LLD,IREE_BUILD_TRACY,-DCMAKE_C_COMPILER=clangvs MSVC) won't really work effectively because of that inheritance setup."workflow presets" let you group
configure -> build -> test -> etc.steps. They can only be used with a shared configure step though, so you can't have a crosscompilation workflow that runsconfigure (host) -> build (host) -> install -> configure (target) -> build (target).Now... we may be able to create something workable with:
CMakePresets.jsonthat sets a minimal list of options (-DIREE_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo, etc.)CMakeUserPresets.json, maybe with some CLI magic for "do you want to use ccache? which backends do you want?"GMNGeoffrey commentedon Apr 10, 2023
Even if the configs are totally flat, I think they would be quite useful. If we end up with a bunch of repetition we could even do our own composition in a somewhat-sane language like Python and then generate a bunch of json files
benvanik commentedon Apr 10, 2023
Regardless of what we do as long as this is
CMakePresets.json.templateor something then we can land an iterate. One of the many major issues with presets is that the presence of the file will trigger most IDE's/editors to switch to using them and if your configuration isn't supported it gets really painful (nothing will work until you delete the file or go set environment variables before launching the editor, which sucks). This would let us side-step some of the hierarchy issues to start as we could have a template for primarily compiler + host runtime usage and one or more for specific runtime/cross-compiling usage.Restructure building-from-source/getting-started page. (#13006)
Restructure building-from-source/getting-started page. (#13006)
Restructure building-from-source/getting-started page. (iree-org#13006)
Add optional CMake presets to the repo. (#15581)
ScottTodd commentedon Dec 15, 2023
#15581 added a few presets to
build_tools/cmake/presets/. Still need to have a few people give them a try and offer feedback (see Stella's request on Discord here), then advertise them in our docs.Add optional CMake presets to the repo. (iree-org#15581)