summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/architecture.py12
-rw-r--r--lib/spack/spack/main.py3
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index c67b63cba0..53cbc44ca5 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -493,3 +493,15 @@ def sys_type():
"""
arch = Arch(platform(), 'default_os', 'default_target')
return str(arch)
+
+
+@memoized
+def compatible_sys_types():
+ """Returns a list of all the systypes compatible with the current host."""
+ compatible_archs = []
+ current_host = cpu.host()
+ compatible_targets = [current_host] + current_host.ancestors
+ for target in compatible_targets:
+ arch = Arch(platform(), 'default_os', target)
+ compatible_archs.append(str(arch))
+ return compatible_archs
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py
index a2220a9ba8..c3746b6b26 100644
--- a/lib/spack/spack/main.py
+++ b/lib/spack/spack/main.py
@@ -585,7 +585,8 @@ def print_setup_info(*info):
# print sys type
shell_set('_sp_sys_type', spack.architecture.sys_type())
-
+ shell_set('_sp_compatible_sys_types',
+ ':'.join(spack.architecture.compatible_sys_types()))
# print roots for all module systems
module_roots = spack.config.get('config:module_roots')
module_to_roots = {