summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregory Becker <becker33@llnl.gov>2015-10-30 10:23:33 -0700
committerGregory Becker <becker33@llnl.gov>2015-10-30 10:23:33 -0700
commit382d8478bf325099582b4814e0d71ff8522696aa (patch)
tree8afffb7b518397eca16b7c15d207e08deaae5277 /lib
parent09597fe8dccbd7d49acf1b3198f24ab928874cdb (diff)
downloadspack-382d8478bf325099582b4814e0d71ff8522696aa.tar.gz
spack-382d8478bf325099582b4814e0d71ff8522696aa.tar.bz2
spack-382d8478bf325099582b4814e0d71ff8522696aa.tar.xz
spack-382d8478bf325099582b4814e0d71ff8522696aa.zip
prototype of new architecture concretization saved as new_concretize_architecture in concretize.py
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/concretize.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 66002492cb..c5041d67be 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -122,6 +122,34 @@ class DefaultConcretizer(object):
return True # changed
+ def new_concretize_architecture(self, spec):
+ """If the spec already has an architecture and it is a an architecture type,
+ return. Otherwise, if it has an architecture that is a string type, generate an
+ architecture based on that type. If it has no architecture and the root of the
+ DAG has an architecture, then use that. Otherwise, take the system's default
+ architecture.
+ """
+ if spec.architecture is not None:
+ if isinstance(spec.architecture,spack.architecture.Target):
+ return False
+ else:
+ arch = spack.architecture.sys_type()
+ spec.architecture = arch.target(spec.architecture)
+ return True #changed
+
+ if spec.root.architecture:
+ if isinstance(spec.root.architecture,spack.architecture.Target):
+ spec.architecture = spec.root.architecture
+ else:
+ arch = spack.architecture.sys_type()
+ spec.architecture = arch.target(spec.root.architecture)
+ else:
+ arch = spack.architecture.sys_type()
+ spec.architecture = arch.target('default')
+
+ return True #changed
+
+
def concretize_variants(self, spec):
"""If the spec already has variants filled in, return. Otherwise, add
the default variants from the package specification.