summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-04-19 00:16:15 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commitcb919c2e39dfe9567782cd07f18dbe8c9f6a37f6 (patch)
tree3b626f471f4eaf1c33d39371d3a2fddfd962cdd0
parentafa74ea155000f73cfeeeb2aedf415bcee7693cb (diff)
downloadspack-cb919c2e39dfe9567782cd07f18dbe8c9f6a37f6.tar.gz
spack-cb919c2e39dfe9567782cd07f18dbe8c9f6a37f6.tar.bz2
spack-cb919c2e39dfe9567782cd07f18dbe8c9f6a37f6.tar.xz
spack-cb919c2e39dfe9567782cd07f18dbe8c9f6a37f6.zip
concretizer: targets are inherited like compilers
-rw-r--r--lib/spack/spack/solver/concretize.lp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp
index a0b9a1da17..cfa675a9ae 100644
--- a/lib/spack/spack/solver/concretize.lp
+++ b/lib/spack/spack/solver/concretize.lp
@@ -193,6 +193,14 @@ node_target(Package, Target)
node_target_weight(Package, Weight)
:- node(Package), node_target(Package, Target), target_weight(Target, Weight).
+% compatibility rules for targets among nodes
+node_target_match_pref(Package, Target) :- node_target_set(Package, Target).
+node_target_match_pref(Dependency, Target)
+ :- depends_on(Package, Dependency), node_target_match_pref(Package, Target),
+ not node_target_set(Dependency, _).
+node_target_match(Package, 1)
+ :- node_target(Package, Target), node_target_match_pref(Package, Target).
+
#defined node_target_set/2.
%-----------------------------------------------------------------------------
@@ -346,4 +354,5 @@ root(Dependency, 1) :- not root(Dependency), node(Dependency).
% TODO: if these are slightly different by compiler (e.g., skylake is
% best, gcc supports skylake and broadweell, clang's best is haswell)
% things seem to get really slow.
-#minimize{ Weight@5,Package : node_target_weight(Package, Weight) }.
+#maximize{ Weight@5,Package : node_target_match(Package, Weight) }.
+#minimize{ Weight@4,Package : node_target_weight(Package, Weight) }.