Using cc -craype-verbose to get cray platform type
This commit is contained in:
parent
a9ed2296a1
commit
46ee4a3a53
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue