Allow 'arch=' syntax for specs to allow copying from output
This commit is contained in:
parent
c0661744cc
commit
88bec814eb
@ -344,7 +344,7 @@ def concretize_compiler_flags(self, spec):
|
||||
and flag in p.compiler_flags))
|
||||
if not flag in spec.compiler_flags or \
|
||||
not (sorted(spec.compiler_flags[flag]) >= sorted(nearest.compiler_flags[flag])):
|
||||
if flag in spec.compiler_flag:
|
||||
if flag in spec.compiler_flags:
|
||||
spec.compiler_flags[flag] = list(set(spec.compiler_flags[flag]) |
|
||||
set(nearest.compiler_flags[flag]))
|
||||
else:
|
||||
|
@ -9,16 +9,16 @@ class CrayXc(Platform):
|
||||
back_end = 'ivybridge'
|
||||
default = 'ivybridge'
|
||||
|
||||
front_os = "SuSE"
|
||||
back_os = "CNL"
|
||||
default_os = "CNL"
|
||||
front_os = "SuSE11"
|
||||
back_os = "CNL10"
|
||||
default_os = "CNL10"
|
||||
|
||||
def __init__(self):
|
||||
''' Since cori doesn't have ivybridge as a front end it's better
|
||||
if we use CRAY_CPU_TARGET as the default. This will ensure
|
||||
that if we're on a XC-40 or XC-30 then we can detect the target
|
||||
'''
|
||||
super(CrayXc, self).__init__('crayxc')
|
||||
super(CrayXc, self).__init__('cray_xc')
|
||||
|
||||
# Handle the default here so we can check for a key error
|
||||
if 'CRAY_CPU_TARGET' in os.environ:
|
||||
@ -37,8 +37,8 @@ def __init__(self):
|
||||
self.add_target('haswell',
|
||||
Target('haswell','craype-haswell'))
|
||||
|
||||
self.add_operating_system('SuSE', LinuxDistro())
|
||||
self.add_operating_system('CNL', Cnl())
|
||||
self.add_operating_system('SuSE11', LinuxDistro())
|
||||
self.add_operating_system('CNL10', Cnl())
|
||||
|
||||
@classmethod
|
||||
def detect(self):
|
||||
|
@ -12,10 +12,10 @@ def __init__(self):
|
||||
super(Linux, self).__init__('linux')
|
||||
self.add_target(self.default, Target(self.default))
|
||||
linux_dist = LinuxDistro()
|
||||
self.default_os = linux_dist.name
|
||||
self.front_os = linux_dist.name
|
||||
self.back_os = linux_dist.name
|
||||
self.add_operating_system(linux_dist.name, linux_dist)
|
||||
self.default_os = str(linux_dist)
|
||||
self.front_os = self.default_os
|
||||
self.back_os = self.default._os
|
||||
self.add_operating_system(str(linux_dist), linux_dist)
|
||||
|
||||
@classmethod
|
||||
def detect(self):
|
||||
|
@ -538,13 +538,17 @@ def _add_flag(self, name, value):
|
||||
Known flags currently include "arch"
|
||||
"""
|
||||
valid_flags = FlagMap.valid_compiler_flags()
|
||||
# if name == 'arch' or name == 'architecture':
|
||||
# platform, op_sys, target = value.split('-')
|
||||
# print platform, op_sys, target, '+++++++'
|
||||
# self._set_platform(platform)
|
||||
# self._set_os(op_sys)
|
||||
# self._set_target(target)
|
||||
if name == 'platform':
|
||||
if name == 'arch' or name == 'architecture':
|
||||
platform, op_sys, target = value.split('-')
|
||||
assert(self.architecture.platform is None)
|
||||
assert(self.architecture.platform_os is None)
|
||||
assert(self.architecture.target is None)
|
||||
assert(self.architecture.os_string is None)
|
||||
assert(self.architecture.target_string is None)
|
||||
self._set_platform(platform)
|
||||
self._set_os(op_sys)
|
||||
self._set_target(target)
|
||||
elif name == 'platform':
|
||||
self._set_platform(value)
|
||||
elif name == 'os' or name == 'operating_system':
|
||||
if self.architecture.platform:
|
||||
|
@ -402,7 +402,6 @@ def test_constrain_changed(self):
|
||||
self.check_constrain_changed('libelf', '~debug')
|
||||
self.check_constrain_changed('libelf', 'debug=2')
|
||||
self.check_constrain_changed('libelf', 'cppflags="-O3"')
|
||||
self.check_constrain_changed('libelf', ' arch=bgqos_0')
|
||||
|
||||
platform = spack.architecture.sys_type()
|
||||
self.check_constrain_changed('libelf', 'target='+platform.target('default_target').name)
|
||||
|
Loading…
Reference in New Issue
Block a user