Merge pull request #1245 from LLNL/features/cray-detection-improvement

The /cray_home directory is more consistent than the /cray/craype dir…
This commit is contained in:
Todd Gamblin 2016-07-18 14:36:08 -07:00 committed by GitHub
commit 4a276807b1

View file

@ -2,6 +2,7 @@
from spack.architecture import Platform, Target from spack.architecture import Platform, Target
from spack.operating_systems.linux_distro import LinuxDistro from spack.operating_systems.linux_distro import LinuxDistro
from spack.operating_systems.cnl import Cnl from spack.operating_systems.cnl import Cnl
from spack.util.executable import which
class CrayXc(Platform): class CrayXc(Platform):
priority = 20 priority = 20
@ -42,5 +43,11 @@ def __init__(self):
@classmethod @classmethod
def detect(self): 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