diff options
-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), |