summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregory Becker <becker33@llnl.gov>2016-01-05 17:00:28 -0800
committerGregory Becker <becker33@llnl.gov>2016-01-05 17:00:28 -0800
commitc649610473a722388a09bf1000a8e3e9d6a4f9ff (patch)
treec697e575e8e77e0f859f5d8695b9d7464ae71c20 /lib
parentd6768cf9210288ec562330fac0978cfa0b8b8683 (diff)
downloadspack-c649610473a722388a09bf1000a8e3e9d6a4f9ff.tar.gz
spack-c649610473a722388a09bf1000a8e3e9d6a4f9ff.tar.bz2
spack-c649610473a722388a09bf1000a8e3e9d6a4f9ff.tar.xz
spack-c649610473a722388a09bf1000a8e3e9d6a4f9ff.zip
fixed concretization to only consider compilers found by the proper strategy
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/concretize.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 48d05f7f8d..f32e956a13 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -260,8 +260,27 @@ class DefaultConcretizer(object):
build with the compiler that will be used by libraries that
link to this one, to maximize compatibility.
"""
+ # Pass on concretizing the compiler if the architecture is not yet determined
+ if not spec.architecture:
+ #Although this usually means changed, this means awaiting other changes
+ return True
+
+ # Examine only those compilers found by the proper compiler strategy for this architecture
+ # Takes advantage of the proper logic already existing in compiler_for_spec
+ # Should be redone more efficiently if this works
all_compilers = spack.compilers.all_compilers()
+ def _proper_compiler_style(cspec, target):
+ compilers = spack.compilers.compilers_for_spec(cspec)
+ if target.compiler_strategy == 'PATH':
+ filter(lambda c: not c.modules, compilers)
+ if target.compiler_strategy == 'MODULES':
+ filter(lambda c: c.modules, compilers)
+ return compilers
+
+ filter(lambda c: _proper_compiler_style(c, spec.architecture), all_compilers)
+
+
if (spec.compiler and
spec.compiler.concrete and
spec.compiler in all_compilers):
@@ -287,7 +306,7 @@ class DefaultConcretizer(object):
raise UnavailableCompilerVersionError(other_compiler)
# copy concrete version into other_compiler
- spec.compiler = matches[len(matches)-1].copy()
+ spec.compiler = matches[0].copy()
assert(spec.compiler.concrete)
return True # things changed.