summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-07-14 23:44:15 +0200
committerGitHub <noreply@github.com>2023-07-14 14:44:15 -0700
commit206a0a16588dbf923f712be735904cfbc04ed8ae (patch)
treec7937500963177c11b66265f301e7325d1694b01 /var
parentb72d0e850d89cfcbcd53b584495927618ad58915 (diff)
downloadspack-206a0a16588dbf923f712be735904cfbc04ed8ae.tar.gz
spack-206a0a16588dbf923f712be735904cfbc04ed8ae.tar.bz2
spack-206a0a16588dbf923f712be735904cfbc04ed8ae.tar.xz
spack-206a0a16588dbf923f712be735904cfbc04ed8ae.zip
legion package: use conditional variants for gasnet (#38902)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/legion/package.py54
1 files changed, 17 insertions, 37 deletions
diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py
index 91e0ff3e2e..f4f6a6bb2a 100644
--- a/var/spack/repos/builtin/packages/legion/package.py
+++ b/var/spack/repos/builtin/packages/legion/package.py
@@ -148,42 +148,26 @@ class Legion(CMakePackage, ROCmPackage):
else:
return True
- variant(
- "gasnet_root",
- default="none",
- values=validate_gasnet_root,
- description="Path to a pre-installed version of GASNet (prefix directory).",
- multi=False,
- )
- conflicts("gasnet_root", when="network=mpi")
-
- gasnet_conduits = ["aries", "ibv", "udp", "mpi", "ucx", "ofi-slingshot11"]
- variant(
- "conduit",
- default="none",
- values=gasnet_conduits + ["none"],
- description="The gasnet conduit(s) to enable.",
- multi=False,
- )
-
- conflicts(
- "conduit=none",
- when="network=gasnet",
- msg="a conduit must be selected when 'network=gasnet'",
- )
-
- for c in gasnet_conduits:
- conflict_str = "conduit=%s" % c
- conflicts(
- conflict_str, when="network=mpi", msg="conduit attribute requires 'network=gasnet'."
+ with when("network=gasnet"):
+ variant(
+ "gasnet_root",
+ default="none",
+ values=validate_gasnet_root,
+ description="Path to a pre-installed version of GASNet (prefix directory).",
+ multi=False,
+ )
+ variant(
+ "conduit",
+ default="none",
+ values=("none", "aries", "ibv", "udp", "mpi", "ucx", "ofi-slingshot11"),
+ description="The gasnet conduit(s) to enable.",
+ sticky=True,
+ multi=False,
)
conflicts(
- conflict_str, when="network=none", msg="conduit attribute requires 'network=gasnet'."
+ "conduit=none", msg="the 'conduit' variant must be set to a value other than 'none'"
)
-
- variant("gasnet_debug", default=False, description="Build gasnet with debugging enabled.")
- conflicts("+gasnet_debug", when="network=mpi")
- conflicts("+gasnet_debug", when="network=none")
+ variant("gasnet_debug", default=False, description="Build gasnet with debugging enabled.")
variant("shared", default=False, description="Build shared libraries.")
@@ -313,11 +297,7 @@ class Legion(CMakePackage, ROCmPackage):
options.append("-DLegion_EMBED_GASNet_CONFIGURE_ARGS=--enable-debug")
elif "network=mpi" in spec:
options.append("-DLegion_NETWORKS=mpi")
- if spec.variants["gasnet_root"].value != "none":
- raise InstallError("'gasnet_root' is only valid when 'network=gasnet'.")
else:
- if spec.variants["gasnet_root"].value != "none":
- raise InstallError("'gasnet_root' is only valid when 'network=gasnet'.")
options.append("-DLegion_EMBED_GASNet=OFF")
if "+shared" in spec: