libfabric: use the class variable to get the list of fabrics (#49007)
Suggested by: alalazo <alalazo@users.noreply.github.com> Signed-off-by: Justin Cook <jscook@lbl.gov>
This commit is contained in:
parent
9747978c7f
commit
d7f05e08be
@ -160,9 +160,8 @@ def determine_variants(cls, exes, version):
|
|||||||
variants = []
|
variants = []
|
||||||
output = Executable(exe)("--list", output=str, error=os.devnull)
|
output = Executable(exe)("--list", output=str, error=os.devnull)
|
||||||
# fabrics
|
# fabrics
|
||||||
fabrics = get_options_from_variant(cls, "fabrics")
|
|
||||||
used_fabrics = []
|
used_fabrics = []
|
||||||
for fabric in fabrics:
|
for fabric in cls.fabrics:
|
||||||
match = re.search(r"^%s:.*\n.*version: (\S+)" % fabric, output, re.MULTILINE)
|
match = re.search(r"^%s:.*\n.*version: (\S+)" % fabric, output, re.MULTILINE)
|
||||||
if match:
|
if match:
|
||||||
used_fabrics.append(fabric)
|
used_fabrics.append(fabric)
|
||||||
@ -219,20 +218,3 @@ def configure_args(self):
|
|||||||
def installcheck(self):
|
def installcheck(self):
|
||||||
fi_info = Executable(self.prefix.bin.fi_info)
|
fi_info = Executable(self.prefix.bin.fi_info)
|
||||||
fi_info()
|
fi_info()
|
||||||
|
|
||||||
|
|
||||||
# This code gets all the fabric names from the variants list
|
|
||||||
# Idea taken from the AutotoolsPackage source.
|
|
||||||
def get_options_from_variant(self, name):
|
|
||||||
values = self.variants[name][0].values
|
|
||||||
explicit_values = []
|
|
||||||
if getattr(values, "feature_values", None):
|
|
||||||
values = values.feature_values
|
|
||||||
for value in sorted(values):
|
|
||||||
if hasattr(value, "when"):
|
|
||||||
if value.when is True:
|
|
||||||
# Explicitly extract the True value for downstream use
|
|
||||||
explicit_values.append("{0}".format(value))
|
|
||||||
else:
|
|
||||||
explicit_values.append(value)
|
|
||||||
return explicit_values
|
|
||||||
|
Loading…
Reference in New Issue
Block a user