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))
|
and flag in p.compiler_flags))
|
||||||
if not flag in spec.compiler_flags or \
|
if not flag in spec.compiler_flags or \
|
||||||
not (sorted(spec.compiler_flags[flag]) >= sorted(nearest.compiler_flags[flag])):
|
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]) |
|
spec.compiler_flags[flag] = list(set(spec.compiler_flags[flag]) |
|
||||||
set(nearest.compiler_flags[flag]))
|
set(nearest.compiler_flags[flag]))
|
||||||
else:
|
else:
|
||||||
|
@ -9,16 +9,16 @@ class CrayXc(Platform):
|
|||||||
back_end = 'ivybridge'
|
back_end = 'ivybridge'
|
||||||
default = 'ivybridge'
|
default = 'ivybridge'
|
||||||
|
|
||||||
front_os = "SuSE"
|
front_os = "SuSE11"
|
||||||
back_os = "CNL"
|
back_os = "CNL10"
|
||||||
default_os = "CNL"
|
default_os = "CNL10"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
''' Since cori doesn't have ivybridge as a front end it's better
|
''' 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
|
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
|
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
|
# Handle the default here so we can check for a key error
|
||||||
if 'CRAY_CPU_TARGET' in os.environ:
|
if 'CRAY_CPU_TARGET' in os.environ:
|
||||||
@ -37,8 +37,8 @@ def __init__(self):
|
|||||||
self.add_target('haswell',
|
self.add_target('haswell',
|
||||||
Target('haswell','craype-haswell'))
|
Target('haswell','craype-haswell'))
|
||||||
|
|
||||||
self.add_operating_system('SuSE', LinuxDistro())
|
self.add_operating_system('SuSE11', LinuxDistro())
|
||||||
self.add_operating_system('CNL', Cnl())
|
self.add_operating_system('CNL10', Cnl())
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
|
@ -12,10 +12,10 @@ def __init__(self):
|
|||||||
super(Linux, self).__init__('linux')
|
super(Linux, self).__init__('linux')
|
||||||
self.add_target(self.default, Target(self.default))
|
self.add_target(self.default, Target(self.default))
|
||||||
linux_dist = LinuxDistro()
|
linux_dist = LinuxDistro()
|
||||||
self.default_os = linux_dist.name
|
self.default_os = str(linux_dist)
|
||||||
self.front_os = linux_dist.name
|
self.front_os = self.default_os
|
||||||
self.back_os = linux_dist.name
|
self.back_os = self.default._os
|
||||||
self.add_operating_system(linux_dist.name, linux_dist)
|
self.add_operating_system(str(linux_dist), linux_dist)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
|
@ -538,13 +538,17 @@ def _add_flag(self, name, value):
|
|||||||
Known flags currently include "arch"
|
Known flags currently include "arch"
|
||||||
"""
|
"""
|
||||||
valid_flags = FlagMap.valid_compiler_flags()
|
valid_flags = FlagMap.valid_compiler_flags()
|
||||||
# if name == 'arch' or name == 'architecture':
|
if name == 'arch' or name == 'architecture':
|
||||||
# platform, op_sys, target = value.split('-')
|
platform, op_sys, target = value.split('-')
|
||||||
# print platform, op_sys, target, '+++++++'
|
assert(self.architecture.platform is None)
|
||||||
# self._set_platform(platform)
|
assert(self.architecture.platform_os is None)
|
||||||
# self._set_os(op_sys)
|
assert(self.architecture.target is None)
|
||||||
# self._set_target(target)
|
assert(self.architecture.os_string is None)
|
||||||
if name == 'platform':
|
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)
|
self._set_platform(value)
|
||||||
elif name == 'os' or name == 'operating_system':
|
elif name == 'os' or name == 'operating_system':
|
||||||
if self.architecture.platform:
|
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')
|
||||||
self.check_constrain_changed('libelf', 'debug=2')
|
self.check_constrain_changed('libelf', 'debug=2')
|
||||||
self.check_constrain_changed('libelf', 'cppflags="-O3"')
|
self.check_constrain_changed('libelf', 'cppflags="-O3"')
|
||||||
self.check_constrain_changed('libelf', ' arch=bgqos_0')
|
|
||||||
|
|
||||||
platform = spack.architecture.sys_type()
|
platform = spack.architecture.sys_type()
|
||||||
self.check_constrain_changed('libelf', 'target='+platform.target('default_target').name)
|
self.check_constrain_changed('libelf', 'target='+platform.target('default_target').name)
|
||||||
|
Loading…
Reference in New Issue
Block a user