Using cc -craype-verbose to get cray platform type

This commit is contained in:
Gregory Becker 2016-07-18 14:25:17 -07:00
parent a9ed2296a1
commit 46ee4a3a53

View file

@ -2,6 +2,7 @@
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 @@ def __init__(self):
@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