From 46ee4a3a5360010e77f77f201ffd5e4289516cc4 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Mon, 18 Jul 2016 14:25:17 -0700 Subject: Using cc -craype-verbose to get cray platform type --- lib/spack/spack/platforms/cray_xc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/spack/platforms/cray_xc.py b/lib/spack/spack/platforms/cray_xc.py index e710303e23..8dc575bb71 100644 --- a/lib/spack/spack/platforms/cray_xc.py +++ b/lib/spack/spack/platforms/cray_xc.py @@ -2,6 +2,7 @@ import os from spack.architecture import Platform, Target from spack.operating_systems.linux_distro import LinuxDistro from spack.operating_systems.cnl import Cnl +from spack.util.executable import which class CrayXc(Platform): priority = 20 @@ -42,5 +43,11 @@ class CrayXc(Platform): @classmethod def detect(self): - return os.path.exists('/opt/cray/craype') + if os.path.exists('/cray_home'): + cc_verbose = which('cc') + cc_verbose.add_default_arg('-craype-verbose') + text = cc_verbose(output=str, error=str, ignore_errors=True).split() + if '-D__CRAYXC' in text: + return True + return False -- cgit v1.2.3-60-g2f50