diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-11-04 14:52:43 +0100 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2020-11-17 10:04:13 -0800 |
commit | 1b0338befbce898d6ec4f0f125fb52b396d8a663 (patch) | |
tree | 71119c0de9a2fbf2f938f663becc0650a4998d52 | |
parent | e0ae60edc4ee7dafc5ab99d756d9c63624c281d5 (diff) | |
download | spack-1b0338befbce898d6ec4f0f125fb52b396d8a663.tar.gz spack-1b0338befbce898d6ec4f0f125fb52b396d8a663.tar.bz2 spack-1b0338befbce898d6ec4f0f125fb52b396d8a663.tar.xz spack-1b0338befbce898d6ec4f0f125fb52b396d8a663.zip |
Fixup for target preferences
-rw-r--r-- | lib/spack/spack/solver/asp.py | 4 | ||||
-rw-r--r-- | lib/spack/spack/solver/concretize.lp | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index b562b60417..59f205b7c6 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -1080,7 +1080,7 @@ class SpackSolverSetup(object): preferred = preferred_targets[0] self.gen.fact(fn.package_target_weight( - str(preferred.architecture.target), pkg_name, -10 + str(preferred.architecture.target), pkg_name, -30 )) def preferred_versions(self, pkg_name): @@ -1190,7 +1190,7 @@ class SpackSolverSetup(object): # compiler flags for flag_type, flags in spec.compiler_flags.items(): for flag in flags: - self.gen.fact(f.node_flag(spec.name, flag_type, flag)) + clauses.append(f.node_flag(spec.name, flag_type, flag)) # TODO # namespace diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index dda6fd6f91..bf1d07a63d 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -432,7 +432,15 @@ node_flag_source(Dependency, Q) :- node_flag_source(Package, Q), inherit_flags(Package, Dependency). % compiler flags from compilers.yaml are put on nodes if compiler matches -node_flag(Package, FlagType, Flag), +node_flag(Package, FlagType, Flag) + :- not node_flag_set(Package), + compiler_version_flag(Compiler, Version, FlagType, Flag), + node_compiler(Package, Compiler), + node_compiler_version(Package, Compiler, Version), + flag_type(FlagType), + compiler(Compiler), + compiler_version(Compiler, Version). + node_flag_compiler_default(Package) :- not node_flag_set(Package), compiler_version_flag(Compiler, Version, FlagType, Flag), |