Skip to content

Commit 2b8e7ce

Browse files
committed
Changes to satisfy spack audit; cascading changes to ensure variant forwarding for caliper/adiak respected between 0.12.0 and 0.13.0; restrict caliper/adiak variants to 0.13.0 and newer so you do not get caliper/adiak/profiling for older axom versions
1 parent ca13e9d commit 2b8e7ce

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

repos/spack_repo/builtin/packages/axom/package.py

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
122122
default=False,
123123
when="@:0.12.0",
124124
description="Build with hooks for Adiak/Caliper performance analysis. "
125-
"Deprecated -- use the adiak and/or caliper variants directly.",
125+
"Deprecated -- use the adiak and/or caliper variants directly "
126+
"versions 0.13.0 and onwards.",
126127
)
127128

128129
# variant for Axom components
@@ -140,8 +141,8 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
140141
variant("int64", default=True, description="Use 64bit integers for IndexType")
141142

142143
# variants for package dependencies
143-
variant("adiak", default=False, description="Build with adiak")
144-
variant("caliper", default=False, description="Build with caliper")
144+
variant("adiak", default=False, when="@0.13.0:", description="Build with adiak")
145+
variant("caliper", default=False, when="@0.13.0:", description="Build with caliper")
145146
variant("conduit", default=True, description="Build with conduit")
146147

147148
variant("opencascade", default=False, description="Build with opencascade")
@@ -228,26 +229,40 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
228229
depends_on("adiak")
229230
depends_on("caliper+adiak~papi")
230231

231-
with when("^adiak"):
232+
depends_on("caliper+cuda", when="+cuda")
233+
depends_on("caliper~cuda", when="~cuda")
234+
235+
depends_on("caliper+rocm", when="+rocm")
236+
depends_on("caliper~rocm", when="~rocm")
237+
238+
for dep in ["adiak", "caliper"]:
239+
depends_on(f"{dep}+mpi", when="+mpi")
240+
depends_on(f"{dep}~mpi", when="~mpi")
241+
depends_on(f"{dep}+shared", when="+shared")
242+
depends_on(f"{dep}~shared", when="~shared")
243+
244+
with when("+adiak"):
232245
for fwd in ("mpi", "shared"):
233246
depends_on(f"adiak+{fwd}", when=f"+{fwd}")
234247

235-
with when("^caliper"):
248+
with when("+caliper"):
236249
for fwd in ("cuda", "rocm", "mpi", "shared"):
237250
depends_on(f"caliper+{fwd}", when=f"+{fwd}")
238251

239252
for val in CudaPackage.cuda_arch_values:
240253
ext_cuda_dep = f"+cuda cuda_arch={val}"
241254
depends_on(f"raja {ext_cuda_dep}", when=f"+raja {ext_cuda_dep}")
242255
depends_on(f"umpire {ext_cuda_dep}", when=f"+umpire {ext_cuda_dep}")
243-
depends_on(f"caliper {ext_cuda_dep}", when=f"{ext_cuda_dep} ^caliper")
256+
depends_on(f"caliper {ext_cuda_dep}", when=f"+caliper {ext_cuda_dep}")
257+
depends_on(f"caliper {ext_cuda_dep}", when=f"+profiling {ext_cuda_dep}")
244258
depends_on(f"mfem {ext_cuda_dep}", when=f"+mfem {ext_cuda_dep}")
245259

246260
for val in ROCmPackage.amdgpu_targets:
247261
ext_rocm_dep = f"+rocm amdgpu_target={val}"
248262
depends_on(f"raja {ext_rocm_dep}", when=f"+raja {ext_rocm_dep}")
249263
depends_on(f"umpire {ext_rocm_dep}", when=f"+umpire {ext_rocm_dep}")
250-
depends_on(f"caliper {ext_rocm_dep}", when=f"{ext_rocm_dep} ^caliper")
264+
depends_on(f"caliper {ext_rocm_dep}", when=f"+caliper {ext_rocm_dep}")
265+
depends_on(f"caliper {ext_rocm_dep}", when=f"+profiling {ext_rocm_dep}")
251266
depends_on(f"mfem {ext_rocm_dep}", when=f"+mfem {ext_rocm_dep}")
252267

253268
depends_on("rocprim", when="+rocm")
@@ -280,8 +295,6 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
280295
# -----------------------------------------------------------------------
281296
# Hard inter-component dependencies taken from Axom's dependency graph.
282297
requires(f"components={','.join(_AXOM_COMPONENTS)}", when="components=all")
283-
for c in _AXOM_COMPONENTS:
284-
conflicts(f"components={c}", when="components=none")
285298

286299
requires("components=slic,spin,primal", when="components=bump")
287300
requires("components=sidre,slic,primal", when="components=inlet")
@@ -322,10 +335,6 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
322335
conflicts("~umpire", when="+cuda")
323336
conflicts("~umpire", when="+rocm")
324337

325-
# The 'profiling' variant is deprecated after v0.12, but spack doesn't
326-
# give a reasonable error/warning message if it is set
327-
conflicts("+profiling", when="@develop")
328-
329338
conflicts("^blt@:0.3.6", when="+rocm")
330339

331340
def flag_handler(self, name, flags):

0 commit comments

Comments
 (0)