Merge pull request #1315 from LLNL/improved-cray-detection
Improved cray detection
This commit is contained in:
commit
79e066d53c
@ -4,6 +4,7 @@
|
|||||||
from spack.operating_systems.cnl import Cnl
|
from spack.operating_systems.cnl import Cnl
|
||||||
from spack.util.executable import which
|
from spack.util.executable import which
|
||||||
|
|
||||||
|
|
||||||
class CrayXc(Platform):
|
class CrayXc(Platform):
|
||||||
priority = 20
|
priority = 20
|
||||||
front_end = 'sandybridge'
|
front_end = 'sandybridge'
|
||||||
@ -35,7 +36,7 @@ def __init__(self):
|
|||||||
self.add_target('ivybridge',
|
self.add_target('ivybridge',
|
||||||
Target('ivybridge', 'craype-ivybridge'))
|
Target('ivybridge', 'craype-ivybridge'))
|
||||||
self.add_target('haswell',
|
self.add_target('haswell',
|
||||||
Target('haswell','craype-haswell'))
|
Target('haswell', 'craype-haswell'))
|
||||||
|
|
||||||
# Front end of the cray platform is a linux distro.
|
# Front end of the cray platform is a linux distro.
|
||||||
linux_dist = LinuxDistro()
|
linux_dist = LinuxDistro()
|
||||||
@ -45,10 +46,14 @@ def __init__(self):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
if os.path.exists('/cray_home'):
|
try:
|
||||||
cc_verbose = which('cc')
|
cc_verbose = which('ftn')
|
||||||
cc_verbose.add_default_arg('-craype-verbose')
|
text = cc_verbose('-craype-verbose',
|
||||||
text = cc_verbose(output=str, error=str, ignore_errors=True).split()
|
output=str, error=str,
|
||||||
|
ignore_errors=True).split()
|
||||||
if '-D__CRAYXC' in text:
|
if '-D__CRAYXC' in text:
|
||||||
return True
|
return True
|
||||||
return False
|
else:
|
||||||
|
return False
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user