From 99c3ed56fae3b4a70a03a60aa645a282136a025d Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 27 Jun 2016 02:19:26 -0700 Subject: [PATCH] Add new sys_type method that prints out the *full* arch descriptor. --- lib/spack/spack/architecture.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index 5bfd052f2ac..a7cda2bf681 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -516,3 +516,20 @@ def platform(): for platform_cls in platform_list: if platform_cls.detect(): return platform_cls() + + +@memoized +def sys_type(): + """Print out the "default" platform-os-target tuple for this machine. + + On machines with only one target OS/target, prints out the + platform-os-target for the frontend. For machines with a frontend + and a backend, prints the default backend. + + TODO: replace with use of more explicit methods to get *all* the + backends, as client code should really be aware of cross-compiled + architectures. + + """ + arch = Arch(platform(), 'default_os', 'default_target') + return str(arch)