Compare commits
40 Commits
v0.21.0
...
bugfix/com
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f932135f08 | ||
|
|
b7e7db4890 | ||
|
|
f4762cfe7b | ||
|
|
be5f1bd9d7 | ||
|
|
dbb36dbbf1 | ||
|
|
5774df6b7a | ||
|
|
3a5c1eb5f3 | ||
|
|
3a2ec729f7 | ||
|
|
a093f4a8ce | ||
|
|
b8302a8277 | ||
|
|
32f319157d | ||
|
|
75dfad8788 | ||
|
|
f3ba20db26 | ||
|
|
6301edbd5d | ||
|
|
88368dea40 | ||
|
|
968223758a | ||
|
|
177976b762 | ||
|
|
3c9bac5861 | ||
|
|
b8c373f51e | ||
|
|
a27da63d3e | ||
|
|
8a825667e4 | ||
|
|
9db3d9dd6a | ||
|
|
69bbccef6e | ||
|
|
4bf6325930 | ||
|
|
8a56c096d3 | ||
|
|
8760d3885a | ||
|
|
1740c575a2 | ||
|
|
d882116f75 | ||
|
|
90393b77d9 | ||
|
|
2096f35f76 | ||
|
|
8897e1e11f | ||
|
|
f0df745f54 | ||
|
|
06c516c580 | ||
|
|
0d9b416bc5 | ||
|
|
a9be08f560 | ||
|
|
eb62129654 | ||
|
|
92ff8cfd45 | ||
|
|
b0d13f8fcc | ||
|
|
e101c77768 | ||
|
|
fe5ea193fc |
@@ -46,7 +46,22 @@
|
||||
from spack.reporters import CDash, CDashConfiguration
|
||||
from spack.reporters.cdash import build_stamp as cdash_build_stamp
|
||||
|
||||
JOB_RETRY_CONDITIONS = ["always"]
|
||||
# See https://docs.gitlab.com/ee/ci/yaml/#retry for descriptions of conditions
|
||||
JOB_RETRY_CONDITIONS = [
|
||||
# "always",
|
||||
"unknown_failure",
|
||||
"script_failure",
|
||||
"api_failure",
|
||||
"stuck_or_timeout_failure",
|
||||
"runner_system_failure",
|
||||
"runner_unsupported",
|
||||
"stale_schedule",
|
||||
# "job_execution_timeout",
|
||||
"archived_failure",
|
||||
"unmet_prerequisites",
|
||||
"scheduler_failure",
|
||||
"data_integrity_failure",
|
||||
]
|
||||
|
||||
TEMP_STORAGE_MIRROR_NAME = "ci_temporary_mirror"
|
||||
SPACK_RESERVED_TAGS = ["public", "protected", "notary"]
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
# tutorial configuration parameters
|
||||
tutorial_branch = "releases/v0.20"
|
||||
tutorial_branch = "releases/v0.21"
|
||||
tutorial_mirror = "file:///mirror"
|
||||
tutorial_key = os.path.join(spack.paths.share_path, "keys", "tutorial.pub")
|
||||
|
||||
|
||||
@@ -1023,7 +1023,7 @@ def finish_parse_and_run(parser, cmd_name, cmd, env_format_error):
|
||||
"""Finish parsing after we know the command to run."""
|
||||
# add the found command to the parser and re-run then re-parse
|
||||
command = parser.add_command(cmd_name)
|
||||
args, unknown = parser.parse_known_args(cmd)
|
||||
args, unknown = parser.parse_known_args()
|
||||
|
||||
# Now that we know what command this is and what its args are, determine
|
||||
# whether we can continue with a bad environment and raise if not.
|
||||
|
||||
@@ -948,6 +948,12 @@ def visit(node):
|
||||
self.control.load(os.path.join(parent_dir, "display.lp"))
|
||||
if not setup.concretize_everything:
|
||||
self.control.load(os.path.join(parent_dir, "when_possible.lp"))
|
||||
|
||||
for spec in specs:
|
||||
if self._compiler_flags_has_propagation(spec.compiler_flags):
|
||||
self.control.load(os.path.join(parent_dir, "propagation.lp"))
|
||||
break
|
||||
|
||||
timer.stop("load")
|
||||
|
||||
# Grounding is the first step in the solve -- it turns our facts
|
||||
@@ -1028,6 +1034,12 @@ def on_model(model):
|
||||
|
||||
return result, timer, self.control.statistics
|
||||
|
||||
def _compiler_flags_has_propagation(self, flags):
|
||||
for _, flag_vals in flags.items():
|
||||
if any(val.propagate for val in flag_vals):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class ConcreteSpecsByHash(collections.abc.Mapping):
|
||||
"""Mapping containing concrete specs keyed by DAG hash.
|
||||
@@ -1921,8 +1933,8 @@ class Head:
|
||||
node_compiler_version = fn.attr("node_compiler_version_set")
|
||||
node_flag = fn.attr("node_flag_set")
|
||||
node_flag_source = fn.attr("node_flag_source")
|
||||
node_flag_propagate = fn.attr("node_flag_propagate")
|
||||
variant_propagate = fn.attr("variant_propagate")
|
||||
node_flag_propagation_candidate = fn.attr("node_flag_propagation_candidate")
|
||||
variant_propagation_candidate = fn.attr("variant_propagation_candidate")
|
||||
|
||||
class Body:
|
||||
node = fn.attr("node")
|
||||
@@ -1935,8 +1947,8 @@ class Body:
|
||||
node_compiler_version = fn.attr("node_compiler_version")
|
||||
node_flag = fn.attr("node_flag")
|
||||
node_flag_source = fn.attr("node_flag_source")
|
||||
node_flag_propagate = fn.attr("node_flag_propagate")
|
||||
variant_propagate = fn.attr("variant_propagate")
|
||||
node_flag_propagation_candidate = fn.attr("node_flag_propagation_candidate")
|
||||
variant_propagation_candidate = fn.attr("variant_propagation_candidate")
|
||||
|
||||
f = Body if body else Head
|
||||
|
||||
@@ -1985,7 +1997,9 @@ class Body:
|
||||
clauses.append(f.variant_value(spec.name, vname, value))
|
||||
|
||||
if variant.propagate:
|
||||
clauses.append(f.variant_propagate(spec.name, vname, value, spec.name))
|
||||
clauses.append(
|
||||
f.variant_propagation_candidate(spec.name, vname, value, spec.name)
|
||||
)
|
||||
|
||||
# Tell the concretizer that this is a possible value for the
|
||||
# variant, to account for things like int/str values where we
|
||||
@@ -2018,7 +2032,9 @@ class Body:
|
||||
clauses.append(f.node_flag(spec.name, flag_type, flag))
|
||||
clauses.append(f.node_flag_source(spec.name, flag_type, spec.name))
|
||||
if not spec.concrete and flag.propagate is True:
|
||||
clauses.append(f.node_flag_propagate(spec.name, flag_type))
|
||||
clauses.append(
|
||||
f.node_flag_propagation_candidate(spec.name, flag_type, flag, spec.name)
|
||||
)
|
||||
|
||||
# dependencies
|
||||
if spec.concrete:
|
||||
|
||||
@@ -318,9 +318,11 @@ trigger_condition_holds(ID, RequestorNode) :-
|
||||
attr(Name, node(X, A1)) : condition_requirement(ID, Name, A1), condition_nodes(ID, PackageNode, node(X, A1));
|
||||
attr(Name, node(X, A1), A2) : condition_requirement(ID, Name, A1, A2), condition_nodes(ID, PackageNode, node(X, A1));
|
||||
attr(Name, node(X, A1), A2, A3) : condition_requirement(ID, Name, A1, A2, A3), condition_nodes(ID, PackageNode, node(X, A1)), not multiple_nodes_attribute(Name);
|
||||
attr(Name, node(X, A1), A2, A3, A4) : condition_requirement(ID, Name, A1, A2, A3, A4), condition_nodes(ID, PackageNode, node(X, A1));
|
||||
attr(Name, node(X, A1), A2, A3, A4) : condition_requirement(ID, Name, A1, A2, A3, A4), condition_nodes(ID, PackageNode, node(X, A1)), not multiple_nodes_attribute(Name);
|
||||
% Special cases
|
||||
attr("node_flag_source", node(X, A1), A2, node(Y, A3)) : condition_requirement(ID, "node_flag_source", A1, A2, A3), condition_nodes(ID, PackageNode, node(X, A1)), condition_nodes(ID, PackageNode, node(Y, A3));
|
||||
attr("node_flag_propagation_candidate", node(X, A1), A2, A3, node(Y, A4)) : condition_reuqirement(ID, "node_flag_propagation_candidate", A1, A2, A3, A4), condition_nodes(ID, PackageNode, node(X, A1)), condition_nodes(ID, PackageNode, node(Y, A4));
|
||||
% if the structure of the program ever could change so that node_flag_source can be in a condition, we will need a case for it here.
|
||||
not cannot_hold(ID, PackageNode).
|
||||
|
||||
condition_holds(ConditionID, node(X, Package))
|
||||
@@ -373,6 +375,15 @@ attr("node_flag_source", node(X, A1), A2, node(Y, A3))
|
||||
imposed_constraint(ID, "node_flag_source", A1, A2, A3),
|
||||
condition_set(node(Y, A3), node(X, A1)).
|
||||
|
||||
% For node flag propagation, we need to look at the condition_set of the source, since it is the ancestor
|
||||
% of the package on which we want to impose the constraint
|
||||
attr("node_flag_propagation_candidate", node(X, A1), A2, A3, node(Y, A4))
|
||||
:- impose(ID, node(X, A1)),
|
||||
imposed_constraint(ID, "node_flag_propagation_candidate", A1, A2, A3, A4),
|
||||
condition_set(node(Y, A4), node(X, A1)).
|
||||
|
||||
% if the structure of the program ever could change so that node_flag_source can be in a condition, we will need a case for it here.
|
||||
|
||||
% Provider set is relevant only for literals, since it's the only place where `^[virtuals=foo] bar`
|
||||
% might appear in the HEAD of a rule
|
||||
attr("provider_set", node(min_dupe_id, Provider), node(min_dupe_id, Virtual))
|
||||
@@ -757,23 +768,36 @@ node_has_variant(node(ID, Package), Variant) :-
|
||||
pkg_fact(Package, variant(Variant)),
|
||||
attr("node", node(ID, Package)).
|
||||
|
||||
attr("variant_propagate", PackageNode, Variant, Value, Source) :-
|
||||
% Variant propagation is forwarded to dependencies
|
||||
attr("variant_propagation_candidate", PackageNode, Variant, Value, Source) :-
|
||||
attr("node", PackageNode),
|
||||
depends_on(ParentNode, PackageNode),
|
||||
attr("variant_propagate", ParentNode, Variant, Value, Source),
|
||||
not attr("variant_set", PackageNode, Variant).
|
||||
attr("variant_value", node(_, Source), Variant, Value),
|
||||
attr("variant_propagation_candidate", ParentNode, Variant, _, Source).
|
||||
|
||||
attr("variant_value", node(ID, Package), Variant, Value) :-
|
||||
attr("node", node(ID, Package)),
|
||||
% If the node is a candidate, and it has the variant and value,
|
||||
% then those variant and value should be propagated
|
||||
attr("variant_propagate", node(ID, Package), Variant, Value, Source) :-
|
||||
attr("variant_propagation_candidate", node(ID, Package), Variant, Value, Source),
|
||||
node_has_variant(node(ID, Package), Variant),
|
||||
attr("variant_propagate", node(ID, Package), Variant, Value, _),
|
||||
pkg_fact(Package, variant_possible_value(Variant, Value)).
|
||||
pkg_fact(Package, variant_possible_value(Variant, Value)),
|
||||
not attr("variant_set", node(ID, Package), Variant).
|
||||
|
||||
% Propagate the value, if there is the corresponding attribute
|
||||
attr("variant_value", PackageNode, Variant, Value) :- attr("variant_propagate", PackageNode, Variant, Value, _).
|
||||
|
||||
% If a variant is propagated, we cannot have extraneous values (this is for multi valued variants)
|
||||
variant_is_propagated(PackageNode, Variant) :- attr("variant_propagate", PackageNode, Variant, _, _).
|
||||
:- variant_is_propagated(PackageNode, Variant),
|
||||
attr("variant_value", PackageNode, Variant, Value),
|
||||
not attr("variant_propagate", PackageNode, Variant, Value, _).
|
||||
|
||||
% Cannot receive different values from different sources on the same variant
|
||||
error(100, "{0} and {1} cannot both propagate variant '{2}' to package {3} with values '{4}' and '{5}'", Source1, Source2, Variant, Package, Value1, Value2) :-
|
||||
attr("variant_propagate", node(X, Package), Variant, Value1, Source1),
|
||||
attr("variant_propagate", node(X, Package), Variant, Value2, Source2),
|
||||
node_has_variant(node(X, Package), Variant),
|
||||
Value1 < Value2.
|
||||
Value1 < Value2, Source1 < Source2.
|
||||
|
||||
% a variant cannot be set if it is not a variant on the package
|
||||
error(100, "Cannot set variant '{0}' for package '{1}' because the variant condition cannot be satisfied for the given spec", Variant, Package)
|
||||
@@ -1199,46 +1223,16 @@ error(100, "Compiler {1}@{2} requested for {0} cannot be found. Set install_miss
|
||||
% Compiler flags
|
||||
%-----------------------------------------------------------------------------
|
||||
|
||||
% propagate flags when compiler match
|
||||
can_inherit_flags(PackageNode, DependencyNode, FlagType)
|
||||
:- same_compiler(PackageNode, DependencyNode),
|
||||
not attr("node_flag_set", DependencyNode, FlagType, _),
|
||||
flag_type(FlagType).
|
||||
|
||||
same_compiler(PackageNode, DependencyNode)
|
||||
:- depends_on(PackageNode, DependencyNode),
|
||||
node_compiler(PackageNode, CompilerID),
|
||||
node_compiler(DependencyNode, CompilerID),
|
||||
compiler_id(CompilerID).
|
||||
|
||||
node_flag_inherited(DependencyNode, FlagType, Flag)
|
||||
:- attr("node_flag_set", PackageNode, FlagType, Flag),
|
||||
can_inherit_flags(PackageNode, DependencyNode, FlagType),
|
||||
attr("node_flag_propagate", PackageNode, FlagType).
|
||||
|
||||
% Ensure propagation
|
||||
:- node_flag_inherited(PackageNode, FlagType, Flag),
|
||||
can_inherit_flags(PackageNode, DependencyNode, FlagType),
|
||||
attr("node_flag_propagate", PackageNode, FlagType).
|
||||
|
||||
error(100, "{0} and {1} cannot both propagate compiler flags '{2}' to {3}", Source1, Source2, Package, FlagType) :-
|
||||
depends_on(Source1, Package),
|
||||
depends_on(Source2, Package),
|
||||
attr("node_flag_propagate", Source1, FlagType),
|
||||
attr("node_flag_propagate", Source2, FlagType),
|
||||
can_inherit_flags(Source1, Package, FlagType),
|
||||
can_inherit_flags(Source2, Package, FlagType),
|
||||
Source1 < Source2.
|
||||
|
||||
% remember where flags came from
|
||||
attr("node_flag_source", PackageNode, FlagType, PackageNode)
|
||||
:- attr("node_flag_set", PackageNode, FlagType, _).
|
||||
|
||||
attr("node_flag_source", DependencyNode, FlagType, Q)
|
||||
:- attr("node_flag_source", PackageNode, FlagType, Q),
|
||||
node_flag_inherited(DependencyNode, FlagType, _),
|
||||
attr("node_flag_propagate", PackageNode, FlagType).
|
||||
|
||||
% compiler flags from compilers.yaml are put on nodes if compiler matches
|
||||
attr("node_flag", PackageNode, FlagType, Flag)
|
||||
:- compiler_flag(CompilerID, FlagType, Flag),
|
||||
@@ -1259,7 +1253,30 @@ attr("node_flag_compiler_default", PackageNode)
|
||||
|
||||
% if a flag is set to something or inherited, it's included
|
||||
attr("node_flag", PackageNode, FlagType, Flag) :- attr("node_flag_set", PackageNode, FlagType, Flag).
|
||||
attr("node_flag", PackageNode, FlagType, Flag) :- node_flag_inherited(PackageNode, FlagType, Flag).
|
||||
|
||||
attr("node_flag_propagate", PackageNode, FlagType, Flag, Source) :-
|
||||
attr("node_flag_propagation_candidate", PackageNode, FlagType, Flag, Source),
|
||||
not attr("node_flag_set", PackageNode, FlagType, _).
|
||||
|
||||
% source is a node() attribute
|
||||
attr("node_flag_propagation_candidate", PackageNode, FlagType, Flag, Source) :-
|
||||
same_compiler(ParentNode, PackageNode),
|
||||
attr("node_flag_propagation_candidate", ParentNode, FlagType, _, Source),
|
||||
attr("node_flag", Source, FlagType, Flag),
|
||||
flag_type(FlagType).
|
||||
|
||||
error(100, "{0} and {1} cannot both propagate compiler flags '{2}' to {3}", Source1, Source2, PackageNode, FlagType) :-
|
||||
same_compiler(Source1, PackageNode),
|
||||
same_compiler(Source2, PackageNode),
|
||||
attr("node_flag_propagate", _, FlagType, _, Source1),
|
||||
attr("node_flag_propagate", _, FlagType, _, Source2),
|
||||
Source1 < Source2.
|
||||
|
||||
attr("node_flag_source", PackageNode, FlagType, Q)
|
||||
:- attr("node_flag_propagate", PackageNode, FlagType, _, Q).
|
||||
|
||||
attr("node_flag", PackageNode, FlagType, Flag) :- attr("node_flag_propagate", PackageNode, FlagType, Flag, _).
|
||||
|
||||
|
||||
% if no node flags are set for a type, there are no flags.
|
||||
attr("no_flags", PackageNode, FlagType)
|
||||
|
||||
31
lib/spack/spack/solver/propagation.lp
Normal file
31
lib/spack/spack/solver/propagation.lp
Normal file
@@ -0,0 +1,31 @@
|
||||
% Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
% Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
%
|
||||
% SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
%=============================================================================
|
||||
% TODO: Later
|
||||
%=============================================================================
|
||||
|
||||
% propagate flags when compiler match
|
||||
attr("node_flag_propagate", PackageNode, FlagType, Flag, Source) :- % source is a node() attribute
|
||||
attr("node_flag_propagation_candidate", PackageNode, FlagType, Flag, Source),
|
||||
not attr("node_flag_set", PackageNode, FlagType, _).
|
||||
|
||||
attr("node_flag_propagation_candidate", PackageNode, FlagType, Flag, Source) :- % source is a node() attribute
|
||||
same_compiler(ParentNode, PackageNode),
|
||||
attr("node_flag_propagation_candidate", ParentNode, FlagType, _, Source),
|
||||
attr("node_flag", Source, FlagType, Flag),
|
||||
flag_type(FlagType).
|
||||
|
||||
error(100, "{0} and {1} cannot both propagate compiler flags '{2}' to {3}", Source1, Source2, PackageNode, FlagType) :-
|
||||
same_compiler(Source1, PackageNode),
|
||||
same_compiler(Source2, PackageNode),
|
||||
attr("node_flag_propagate", _, FlagType, _, Source1),
|
||||
attr("node_flag_propagate", _, FlagType, _, Source2),
|
||||
Source1 < Source2.
|
||||
|
||||
attr("node_flag_source", PackageNode, FlagType, Q)
|
||||
:- attr("node_flag_propagate", PackageNode, FlagType, _, Q).
|
||||
|
||||
attr("node_flag", PackageNode, FlagType, Flag) :- attr("node_flag_propagate", PackageNode, FlagType, Flag, _).
|
||||
@@ -349,11 +349,25 @@ def test_compiler_flags_differ_identical_compilers(self):
|
||||
spec.concretize()
|
||||
assert spec.satisfies("cflags=-O2")
|
||||
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
)
|
||||
def test_concretize_compiler_flag_propagate(self):
|
||||
spec = Spec("hypre cflags=='-g' ^openblas")
|
||||
spec = Spec("callpath cflags=='-g'")
|
||||
spec.concretize()
|
||||
|
||||
assert spec.satisfies("^openblas cflags='-g'")
|
||||
for dep in spec.traverse():
|
||||
assert dep.satisfies("cflags='-g'")
|
||||
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
)
|
||||
def test_concretize_non_root_compiler_flag_propagate(self):
|
||||
spec = Spec("callpath ^dyninst cflags=='-g'")
|
||||
spec.concretize()
|
||||
|
||||
assert spec.satisfies("^libdwarf cflags='-g'")
|
||||
assert spec.satisfies("^libelf cflags='-g'")
|
||||
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
@@ -362,17 +376,30 @@ def test_concretize_compiler_flag_does_not_propagate(self):
|
||||
spec = Spec("hypre cflags='-g' ^openblas")
|
||||
spec.concretize()
|
||||
|
||||
assert not spec.satisfies("^openblas cflags='-g'")
|
||||
for dep in spec.traverse(root=False):
|
||||
assert not dep.satisfies("cflags='-g'")
|
||||
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
)
|
||||
def test_concretize_propagate_compiler_flag_not_passed_to_dependent(self):
|
||||
spec = Spec("hypre cflags=='-g' ^openblas cflags='-O3'")
|
||||
spec = Spec("callpath cflags=='-g' ^dyninst cflags='-O3'")
|
||||
spec.concretize()
|
||||
|
||||
assert set(spec.compiler_flags["cflags"]) == set(["-g"])
|
||||
assert spec.satisfies("^openblas cflags='-O3'")
|
||||
assert spec.satisfies("^dyninst cflags='-O3'")
|
||||
assert spec.satisfies("^libelf cflags='-g'")
|
||||
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
)
|
||||
def test_concretize_propagate_specified_compiler_flag(self):
|
||||
spec = Spec("callpath cflags=='-g' cxxflags='-O3'")
|
||||
spec.concretize()
|
||||
|
||||
for dep in spec.traverse(root=False):
|
||||
assert dep.satisfies("cflags='-g'")
|
||||
assert not dep.satisfies("cxxflags='-O3'")
|
||||
|
||||
def test_mixing_compilers_only_affects_subdag(self):
|
||||
spack.config.set("packages:all:compiler", ["clang", "gcc"])
|
||||
@@ -458,19 +485,54 @@ def test_concretize_two_virtuals_with_dual_provider_and_a_conflict(self):
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
)
|
||||
def test_concretize_propagate_disabled_variant(self):
|
||||
"""Test a package variant value was passed from its parent."""
|
||||
spec = Spec("hypre~~shared ^openblas")
|
||||
spec.concretize()
|
||||
|
||||
assert spec.satisfies("^openblas~shared")
|
||||
@pytest.mark.parametrize(
|
||||
"spec_str,expected_propagation",
|
||||
[
|
||||
("hypre~~shared ^openblas+shared", [("hypre", "~shared"), ("openblas", "+shared")]),
|
||||
# Propagates past a node that doesn't have the variant
|
||||
("hypre~~shared ^openblas", [("hypre", "~shared"), ("openblas", "~shared")]),
|
||||
(
|
||||
"ascent~~shared +adios2",
|
||||
[("ascent", "~shared"), ("adios2", "~shared"), ("bzip2", "~shared")],
|
||||
),
|
||||
# Propagates below a node that uses the other value explicitly
|
||||
(
|
||||
"ascent~~shared +adios2 ^adios2+shared",
|
||||
[("ascent", "~shared"), ("adios2", "+shared"), ("bzip2", "~shared")],
|
||||
),
|
||||
(
|
||||
"ascent++shared +adios2 ^adios2~shared",
|
||||
[("ascent", "+shared"), ("adios2", "~shared"), ("bzip2", "+shared")],
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_concretize_propagate_disabled_variant(self, spec_str, expected_propagation):
|
||||
"""Tests various patterns of boolean variant propagation"""
|
||||
spec = Spec(spec_str).concretized()
|
||||
for key, expected_satisfies in expected_propagation:
|
||||
spec[key].satisfies(expected_satisfies)
|
||||
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
)
|
||||
def test_concretize_propagated_variant_is_not_passed_to_dependent(self):
|
||||
"""Test a package variant value was passed from its parent."""
|
||||
spec = Spec("hypre~~shared ^openblas+shared")
|
||||
spec = Spec("ascent~~shared +adios2 ^adios2+shared")
|
||||
spec.concretize()
|
||||
|
||||
assert spec.satisfies("^openblas+shared")
|
||||
assert spec.satisfies("^adios2+shared")
|
||||
assert spec.satisfies("^bzip2~shared")
|
||||
|
||||
@pytest.mark.only_clingo(
|
||||
"Optional compiler propagation isn't deprecated for original concretizer"
|
||||
)
|
||||
def test_concretize_propagate_specified_variant(self):
|
||||
"""Test that only the specified variant is propagated to the dependencies"""
|
||||
spec = Spec("parent-foo-bar ~~foo")
|
||||
spec.concretize()
|
||||
|
||||
assert spec.satisfies("~foo") and spec.satisfies("^dependency-foo-bar~foo")
|
||||
assert spec.satisfies("+bar") and not spec.satisfies("^dependency-foo-bar+bar")
|
||||
|
||||
@pytest.mark.only_clingo("Original concretizer is allowed to forego variant propagation")
|
||||
def test_concretize_propagate_multivalue_variant(self):
|
||||
|
||||
@@ -330,8 +330,11 @@ def add_extra_search_paths(paths):
|
||||
for candidate_item in candidate_items:
|
||||
for directory in search_paths:
|
||||
exe = directory / candidate_item
|
||||
if exe.is_file() and os.access(str(exe), os.X_OK):
|
||||
return str(exe)
|
||||
try:
|
||||
if exe.is_file() and os.access(str(exe), os.X_OK):
|
||||
return str(exe)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if required:
|
||||
raise CommandNotFoundError("spack requires '%s'. Make sure it is in your path." % args[0])
|
||||
|
||||
@@ -18,7 +18,7 @@ spack:
|
||||
- hdf5+hl+mpi ^mpich
|
||||
- trilinos
|
||||
- trilinos +hdf5 ^hdf5+hl+mpi ^mpich
|
||||
- gcc@12
|
||||
- gcc@12.3.0
|
||||
- mpileaks
|
||||
- lmod
|
||||
- macsio@1.1+scr ^scr@2.0.0~fortran ^silo~fortran ^hdf5~fortran
|
||||
|
||||
22
var/spack/repos/builtin.mock/packages/adios2/package.py
Normal file
22
var/spack/repos/builtin.mock/packages/adios2/package.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class Adios2(Package):
|
||||
"""This packagae has the variants shared and
|
||||
bzip2, both defaulted to True"""
|
||||
|
||||
homepage = "https://example.com"
|
||||
url = "https://example.com/adios2.tar.gz"
|
||||
|
||||
version("2.9.1", sha256="ddfa32c14494250ee8a48ef1c97a1bf6442c15484bbbd4669228a0f90242f4f9")
|
||||
|
||||
variant("shared", default=True, description="Build shared libraries")
|
||||
variant("bzip2", default=True, description="Enable BZip2 compression")
|
||||
|
||||
depends_on("bzip2")
|
||||
21
var/spack/repos/builtin.mock/packages/ascent/package.py
Normal file
21
var/spack/repos/builtin.mock/packages/ascent/package.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class Ascent(Package):
|
||||
"""This packagae has the variants shared, defaulted
|
||||
to True and adios2 defaulted to False"""
|
||||
|
||||
homepage = "https://github.com/Alpine-DAV/ascent"
|
||||
url = "http://www.example.com/ascent-1.0.tar.gz"
|
||||
|
||||
version("0.9.2", sha256="44cd954aa5db478ab40042cd54fd6fcedf25000c3bb510ca23fcff8090531b91")
|
||||
|
||||
variant("adios2", default=False, description="Build Adios2 filter support")
|
||||
variant("shared", default=True, description="Build Ascent as shared libs")
|
||||
|
||||
depends_on("adios2", when="+adios2")
|
||||
19
var/spack/repos/builtin.mock/packages/bzip2/package.py
Normal file
19
var/spack/repos/builtin.mock/packages/bzip2/package.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class Bzip2(Package):
|
||||
"""This packagae has the variants shared
|
||||
defaulted to True"""
|
||||
|
||||
homepage = "https://example.com"
|
||||
url = "https://example.com/bzip2-1.0.8tar.gz"
|
||||
|
||||
version("1.0.8", sha256="ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269")
|
||||
|
||||
variant("shared", default=True, description="Enables the build of shared libraries.")
|
||||
@@ -0,0 +1,20 @@
|
||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class DependencyFooBar(Package):
|
||||
"""This package has a variant "bar", which is False by default, and
|
||||
variant "foo" which is True by default.
|
||||
"""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/dependency-foo-bar-1.0.tar.gz"
|
||||
|
||||
version("1.0", md5="1234567890abcdefg1234567890098765")
|
||||
|
||||
variant("foo", default=True, description="")
|
||||
variant("bar", default=False, description="")
|
||||
@@ -0,0 +1,22 @@
|
||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class ParentFooBar(Package):
|
||||
"""This package has a variant "bar", which is True by default, and depends on another
|
||||
package which has the same variant defaulting to False.
|
||||
"""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/parent-foo-bar-1.0.tar.gz"
|
||||
|
||||
version("1.0", md5="abcdefg0123456789abcdefghfedcba0")
|
||||
|
||||
variant("foo", default=True, description="")
|
||||
variant("bar", default=True, description="")
|
||||
|
||||
depends_on("dependency-foo-bar")
|
||||
@@ -115,9 +115,9 @@ def configure_args(self):
|
||||
if "+apmpi" in spec:
|
||||
extra_args.append("--enable-apmpi-mod")
|
||||
if "+apmpi_sync" in spec:
|
||||
extra_args.append(["--enable-apmpi-mod", "--enable-apmpi-coll-sync"])
|
||||
extra_args.extend(["--enable-apmpi-mod", "--enable-apmpi-coll-sync"])
|
||||
if "+apxc" in spec:
|
||||
extra_args.append(["--enable-apxc-mod"])
|
||||
extra_args.append("--enable-apxc-mod")
|
||||
|
||||
extra_args.append("--with-mem-align=8")
|
||||
extra_args.append("--with-log-path-by-env=DARSHAN_LOG_DIR_PATH")
|
||||
|
||||
@@ -24,6 +24,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
|
||||
test_requires_compiler = True
|
||||
|
||||
version("develop", branch="master")
|
||||
version("2.30.0", sha256="8e2af97d9a25bf44801c6427779f823ebc6f306438066bba7fcbc2a5f9b78421")
|
||||
version("2.29.0", sha256="98b72115407a0e24dbaac70eccae0da3465f8f999318b2c9241631133f42d511")
|
||||
version("2.28.0", sha256="2eea68740cdbc0b49a5e428f06ad7af861d1e169ce6a12d2cf0aa2fc28c4a2ae")
|
||||
version("2.27.0", sha256="507a3d036bb1ac21a55685ae417d769dd02009bde7e09785d0ae7446b4ae1f98")
|
||||
|
||||
@@ -53,14 +53,16 @@ class SuperluDist(CMakePackage, CudaPackage, ROCmPackage):
|
||||
),
|
||||
)
|
||||
variant("shared", default=True, description="Build shared libraries")
|
||||
variant("parmetis", default=True, description="Enable ParMETIS library")
|
||||
|
||||
depends_on("mpi")
|
||||
depends_on("blas")
|
||||
depends_on("lapack")
|
||||
depends_on("parmetis +int64", when="+int64")
|
||||
depends_on("metis@5: +int64", when="+int64")
|
||||
depends_on("parmetis ~int64", when="~int64")
|
||||
depends_on("metis@5: ~int64", when="~int64")
|
||||
with when("+parmetis"):
|
||||
depends_on("metis@5: +int64", when="+int64")
|
||||
depends_on("parmetis +int64", when="+int64")
|
||||
depends_on("metis@5: ~int64", when="~int64")
|
||||
depends_on("parmetis ~int64", when="~int64")
|
||||
depends_on("cmake@3.18.1:", type="build", when="@7.1.0:")
|
||||
depends_on("hipblas", when="+rocm")
|
||||
depends_on("rocsolver", when="+rocm")
|
||||
@@ -93,13 +95,17 @@ def append_from_variant(*args):
|
||||
append_define("TPL_LAPACK_LIBRARIES", spec["lapack"].libs)
|
||||
append_define("TPL_ENABLE_LAPACKLIB", True)
|
||||
append_define("USE_XSDK_DEFAULTS", True)
|
||||
append_define(
|
||||
"TPL_PARMETIS_LIBRARIES", [spec["parmetis"].libs.ld_flags, spec["metis"].libs.ld_flags]
|
||||
)
|
||||
append_define(
|
||||
"TPL_PARMETIS_INCLUDE_DIRS",
|
||||
[spec["parmetis"].prefix.include, spec["metis"].prefix.include],
|
||||
)
|
||||
|
||||
append_from_variant("TPL_ENABLE_PARMETISLIB", "parmetis")
|
||||
if "+parmetis" in spec:
|
||||
append_define(
|
||||
"TPL_PARMETIS_LIBRARIES",
|
||||
[spec["parmetis"].libs.ld_flags, spec["metis"].libs.ld_flags],
|
||||
)
|
||||
append_define(
|
||||
"TPL_PARMETIS_INCLUDE_DIRS",
|
||||
[spec["parmetis"].prefix.include, spec["metis"].prefix.include],
|
||||
)
|
||||
|
||||
append_define("XSDK_INDEX_SIZE", "64" if "+int64" in spec else "32")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user