Skip to content

Commit 74bb269

Browse files
committed
Exclude system CMake on Chrysalis
It is too old. Don't exclude it on Perlmutter, where it is new enough and can't be built with Spack.
1 parent b466b24 commit 74bb269

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

compass/machines/chrysalis.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ spack = /lcrc/soft/climate/compass/chrysalis/spack
3030
# whether to use the same modules for hdf5, netcdf-c, netcdf-fortran and
3131
# pnetcdf as E3SM (spack modules are used otherwise)
3232
use_e3sm_hdf5_netcdf = True
33+
34+
# whether to exclude system cmake from spack build
35+
exclude_system_cmake = True

deploy/config.yaml.j2

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,10 @@ spack:
159159
# Optional list of machine-provided Spack packages to suppress so Spack can
160160
# build them instead.
161161
#
162-
# We exclude the system `cmake` so Spack can build the newer version
163-
# requested in `deploy/spack.yaml.j2`.
164-
#
165162
# The HDF5/NetCDF bundle is controlled dynamically in `pre_spack()` based on
166163
# merged machine config, mapping [deploy] use_e3sm_hdf5_netcdf = false to
167164
# excluding `hdf5_netcdf`.
168-
exclude_packages:
169-
- cmake
165+
exclude_packages = []
170166

171167
jigsaw:
172168
# If true, build/install JIGSAW + JIGSAW-Python into the pixi env

deploy/hooks.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def pre_spack(ctx: DeployContext) -> dict[str, Any] | None:
3030
_maybe_exclude_e3sm_hdf5_netcdf(
3131
exclude_packages=exclude_packages, machine_config=ctx.machine_config
3232
)
33+
_maybe_exclude_cmake(
34+
exclude_packages=exclude_packages, machine_config=ctx.machine_config
35+
)
3336

3437
spack_path = _get_spack_path(ctx.config, ctx.machine, ctx.machine_config)
3538
if spack_path is not None:
@@ -141,6 +144,21 @@ def _maybe_exclude_e3sm_hdf5_netcdf(
141144
exclude_packages.append('hdf5_netcdf')
142145

143146

147+
def _maybe_exclude_cmake(
148+
exclude_packages: list[str], machine_config
149+
) -> None:
150+
exclude_cmake = False
151+
if machine_config.has_section('deploy') and machine_config.has_option(
152+
'deploy', 'exclude_system_cmake'
153+
):
154+
exclude_cmake = machine_config.getboolean(
155+
'deploy', 'exclude_system_cmake'
156+
)
157+
158+
if exclude_cmake and 'cmake' not in exclude_packages:
159+
exclude_packages.append('cmake')
160+
161+
144162
def _check_unsupported(
145163
machine: str | None, toolchain_pairs: list[tuple[str, str]]
146164
) -> None:

0 commit comments

Comments
 (0)