Complete support for ninja cmake backend - #8532
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request aims to make Ninja a usable CMake backend in E3SM by modernizing build script invocations (favoring cmake --build / cmake --install over direct gmake) and introducing a machine-configurable CMake backend selection.
Changes:
- Switch several shared-library build scripts from
gmaketocmake --build/cmake --install. - Add a new
CMAKE_BACKENDbuild setting to driver component config and setmappyto default toninja. - Remove obsolete
buildexescripts from both MOAB and MCT driver configs.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| share/build/buildlib.spio | Switch SCORPIO build invocation from gmake to cmake --build. |
| share/build/buildlib.gptl | Switch GPTL build/install from gmake to cmake --build / cmake --install. |
| share/build/buildlib.ekat | Switch EKAT build/install from gmake to cmake --build / cmake --install. |
| share/build/buildlib.csm_share | Switch csm_share build invocation from gmake to cmake --build. |
| driver-moab/cime_config/config_component.xml | Introduce CMAKE_BACKEND entry for MOAB driver build configuration. |
| driver-mct/cime_config/config_component.xml | Introduce CMAKE_BACKEND entry for MCT driver build configuration. |
| driver-moab/cime_config/buildexe | Remove obsolete standalone build script. |
| driver-mct/cime_config/buildexe | Remove obsolete standalone build script. |
| cime_config/machines/config_machines.xml | Set mappy machine default CMAKE_BACKEND to ninja. |
| # This runs the pio make command from the cmake generated Makefile | ||
| logger.info("Building SCORPIO") | ||
| run_bld_cmd_ensure_logging(f"{gmake} -j {gmake_j}", logger, from_dir=pio_bld_dir) | ||
| run_bld_cmd_ensure_logging(f"cmake --build . -v -j {gmake_j}", logger, from_dir=pio_bld_dir) |
There was a problem hiding this comment.
This is not true:
--parallel [<jobs>], -j [<jobs>]
-v, --verbose
| <entry id="CMAKE_BACKEND"> | ||
| <type>char</type> | ||
| <default_value>gmake</default_value> | ||
| <group>build_def</group> | ||
| <file>env_build.xml</file> | ||
| <desc>Tells cmake which backend to use</desc> | ||
| </entry> |
| <entry id="CMAKE_BACKEND"> | ||
| <type>char</type> | ||
| <default_value>gmake</default_value> | ||
| <group>build_def</group> | ||
| <file>env_build.xml</file> | ||
| <desc>Tells cmake which backend to use</desc> | ||
| </entry> |
Complete support for ninja cmake backend With this PR, ninja is a usable CMake backend for E3SM. Ninja offers superior features to gmake with better parallelism, builds that terminate immediately when there's a failure, etc. If you want to try this feature, you can pass --ninja to create_test or change the default CMake backend for your machine, now represented by the config_machines.xml setting CMAKE_BACKEND to ninja. Change list: 1) Includes a CIME update that only brings in better ninja support 2) Update build scripts to use flexible build invocation cmake --build instead of gmake. 3) Remove obsolete independent build scripts buildexe that appear to be tailored to the pre-cmake E3SM build system. 4) Make ninja the default for mappy 5) Update the ninja executable the comes bundled with E3SM. Fixes #6784 [BFB]
|
can this option be used with create_newcase ? |
|
The switch the ninja appears to have created diffs in mappy testing. Please revert this from next if you can't explain/fix that. |
|
reverted from next so we have a clean dashboard Monday. |
|
@rljacob ,
There's no need. They can just add |
|
@jonbob , some small changes to ice stuff was needed. |
|
@jgfouca -- you had to change a line in the icepack submodule? |
|
@jonbob , yep! It was a brutal debugging session. I explained the problem in the upstream PR I made: |
|
That would be really messy -- excellent sleuthing! So will this PR wait until the one into icepack gets merged? |
|
@jonbob , thanks! I don't think we need to wait because I added the patch to our version. I made the upstream PR so that, whenever we update the submodule in the future, the fix will be there. |
Complete support for ninja cmake backend With this PR, ninja is a usable CMake backend for E3SM. Ninja offers superior features to gmake with better parallelism, builds that terminate immediately when there's a failure, etc. If you want to try this feature, you can pass --ninja to create_test or change the default CMake backend for your machine, now represented by the config_machines.xml setting CMAKE_BACKEND to ninja. Change list: 1) Includes a CIME update that only brings in better ninja support 2) Update build scripts to use flexible build invocation cmake --build instead of gmake. 3) Remove obsolete independent build scripts buildexe that appear to be tailored to the pre-cmake E3SM build system. 4) Make ninja the default for mappy 5) Update the ninja executable the comes bundled with E3SM. 6) Remove dangerous comment style in icepack Fixes #6784 [BFB] * jgfouca/e3sm_ninja: Fix very subtle f90 comment cpp issue
Bringing comment change introduced in E3SM-Project/E3SM#8532 into main. Fix unsafe comment
…t (PR #8582) Updating Icepack hash to main branch Updates Icepack submodule hash to point to main. The comment change introduced in #8532 changed the Icepack hash (E3SM-Project/Icepack@5d30e92) away from main. This change has been brought into the Icepack main branch in E3SM-Project/Icepack#44, so this PR has no code changes, only submodule hash update. [BFB]
Updating Icepack hash to main branch Updates Icepack submodule hash to point to main. The comment change introduced in #8532 changed the Icepack hash (E3SM-Project/Icepack@5d30e92) away from main. This change has been brought into the Icepack main branch in E3SM-Project/Icepack#44, so this PR has no code changes, only submodule hash update. [BFB]
With this PR, ninja is a usable CMake backend for E3SM. Ninja offers superior features to gmake with better parallelism, builds that terminate immediately when there's a failure, etc. If you want to try this feature, you can pass
--ninjato create_test or change the default CMake backend for your machine, now represented by the config_machines.xml settingCMAKE_BACKENDtoninja.Change list:
cmake --buildinstead ofgmake.buildexethat appear to be tailored to the pre-cmake E3SM build system.Fixes #6784
[BFB]