From 0efd5287c4b95eb01441b9552743843f77fbedd7 Mon Sep 17 00:00:00 2001 From: Sean Koyama Date: Fri, 15 Dec 2023 09:38:01 -0800 Subject: mpifileutils: add DAOS variant (#35618) * mpifileutils: add DAOS variant * mpifileutils: Add daos dep when +daos Add dependency on DAOS when +daos Pass DAOS prefix to ensure correct DAOS is found by during configuration * Change in to satisfies for boolean variants --------- Co-authored-by: Ryan Krattiger --- .../repos/builtin/packages/mpifileutils/package.py | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/mpifileutils/package.py b/var/spack/repos/builtin/packages/mpifileutils/package.py index 094c7b73e6..ef8afa549c 100644 --- a/var/spack/repos/builtin/packages/mpifileutils/package.py +++ b/var/spack/repos/builtin/packages/mpifileutils/package.py @@ -50,6 +50,8 @@ class Mpifileutils(Package): depends_on("attr", when="@0.11.1:+xattr") + depends_on("daos", when="+daos") + depends_on("bzip2") depends_on("libcap") @@ -68,6 +70,8 @@ class Mpifileutils(Package): variant("experimental", default=False, description="Install experimental tools") conflicts("+experimental", when="@:0.6") + variant("daos", default=False, description="Enable DAOS support", when="@0.11:") + def flag_handler(self, name, flags): spec = self.spec iflags = [] @@ -82,26 +86,32 @@ class Mpifileutils(Package): args.append("-DWITH_DTCMP_PREFIX=%s" % self.spec["dtcmp"].prefix) args.append("-DWITH_LibCircle_PREFIX=%s" % self.spec["libcircle"].prefix) - if "+xattr" in self.spec: + if self.spec.satisfies("+xattr"): args.append("-DENABLE_XATTRS=ON") else: args.append("-DENABLE_XATTRS=OFF") - if "+lustre" in self.spec: + if self.spec.satisfies("+lustre"): args.append("-DENABLE_LUSTRE=ON") else: args.append("-DENABLE_LUSTRE=OFF") - if "+gpfs" in self.spec: + if self.spec.satisfies("+gpfs"): args.append("-DENABLE_GPFS=ON") else: args.append("-DENABLE_GPFS=OFF") - if "+experimental" in self.spec: + if self.spec.satisfies("+experimental"): args.append("-DENABLE_EXPERIMENTAL=ON") else: args.append("-DENABLE_EXPERIMENTAL=OFF") + if self.spec.satisfies("+daos"): + args.append("-DENABLE_DAOS=ON") + args.append("-DWITH_DAOS_PREFIX=%s" % self.spec["daos"].prefix) + else: + args.append("-DENABLE_DAOS=OFF") + return args @when("@0.9:") @@ -135,16 +145,16 @@ class Mpifileutils(Package): ) args.append("--with-dtcmp=%s" % self.spec["dtcmp"].prefix) - if "+xattr" in self.spec: + if self.spec.satisfies("+xattr"): args.append("CFLAGS=-DDCOPY_USE_XATTRS") - if "+lustre" in self.spec: + if self.spec.satisfies("+lustre"): args.append("--enable-lustre") else: args.append("--disable-lustre") if self.spec.satisfies("@0.7:"): - if "+experimental" in self.spec: + if self.spec.satisfies("+experimental"): args.append("--enable-experimental") else: args.append("--disable-experimental") -- cgit v1.2.3-70-g09d2