made the compiler strategy more easily controllable
This commit is contained in:
parent
61b03b72b0
commit
51bd91edc0
@ -55,19 +55,20 @@ class Target(object):
|
|||||||
they came from using the set_architecture method. Targets will have compiler finding strategies
|
they came from using the set_architecture method. Targets will have compiler finding strategies
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self,name, module_name=None):
|
def __init__(self, name, compiler_strategy, module_name=None):
|
||||||
self.name = name # case of cray "ivybridge" but if it's x86_64
|
self.name = name # case of cray "ivybridge" but if it's x86_64
|
||||||
|
self.compiler_strategy = compiler_strategy
|
||||||
self.module_name = module_name # craype-ivybridge
|
self.module_name = module_name # craype-ivybridge
|
||||||
|
|
||||||
def set_architecture(self, architecture): # Target should get the architecture class.
|
def set_architecture(self, architecture): # Target should get the architecture class.
|
||||||
self.architecture = architecture
|
self.architecture = architecture
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def compiler_strategy(self):
|
# def compiler_strategy(self):
|
||||||
if self.module_name: # If there is a module_name given then use MODULES
|
# if self.module_name: # If there is a module_name given then use MODULES
|
||||||
return "MODULES"
|
# return "MODULES"
|
||||||
else:
|
# else:
|
||||||
return "PATH"
|
# return "PATH"
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
d = {}
|
d = {}
|
||||||
|
@ -10,8 +10,8 @@ class Bgq(Architecture):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Bgq, self).__init__('cray')
|
super(Bgq, self).__init__('cray')
|
||||||
self.add_target(self.front_end, Target(self.front_end))
|
self.add_target(self.front_end, Target(self.front_end, 'PATH'))
|
||||||
self.add_target(self.back_end, Target(self.back_end))
|
self.add_target(self.back_end, Target(self.back_end, 'PATH'))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
|
@ -26,10 +26,10 @@ def __init__(self):
|
|||||||
|
|
||||||
# Could switch to use modules and fe targets for front end
|
# Could switch to use modules and fe targets for front end
|
||||||
# Currently using compilers by path for front end.
|
# Currently using compilers by path for front end.
|
||||||
self.add_target(self.front_end, Target(self.front_end))
|
self.add_target(self.front_end, Target(self.front_end, 'PATH'))
|
||||||
# Back End compiler needs the proper target module loaded.
|
# Back End compiler needs the proper target module loaded.
|
||||||
self.add_target(self.back_end, Target(self.front_end,'craype-'+ self.back_end))
|
# self.add_target(self.back_end, Target(self.front_end, 'MODULES', 'craype-'+ self.back_end))
|
||||||
self.add_target(self.default, Target(self.default,'craype-' + self.default))
|
self.add_target(self.default, Target(self.default, 'MODULES', 'craype-' + self.default))
|
||||||
# This is kludgy and the order matters when the targets are all haswell
|
# This is kludgy and the order matters when the targets are all haswell
|
||||||
# This is because the last one overwrites the others when they have the
|
# This is because the last one overwrites the others when they have the
|
||||||
# same name.
|
# same name.
|
||||||
|
@ -9,7 +9,7 @@ class Darwin(Architecture):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Darwin, self).__init__('darwin')
|
super(Darwin, self).__init__('darwin')
|
||||||
self.add_target(self.default, Target(self.default))
|
self.add_target(self.default, Target(self.default, 'PATH'))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
|
@ -9,7 +9,7 @@ class Linux(Architecture):
|
|||||||
|
|
||||||
def __init__(self):
|
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, 'PATH'))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
|
@ -226,7 +226,7 @@ def set_build_environment_variables(pkg):
|
|||||||
pkg_config_dirs.append(pcdir)
|
pkg_config_dirs.append(pcdir)
|
||||||
path_put_first("PKG_CONFIG_PATH", pkg_config_dirs)
|
path_put_first("PKG_CONFIG_PATH", pkg_config_dirs)
|
||||||
|
|
||||||
if pkg.spec.architecture.compiler_strategy.lower() == 'module':
|
if pkg.spec.architecture.module_name:
|
||||||
load_module(pkg.spec.architecture.module_name)
|
load_module(pkg.spec.architecture.module_name)
|
||||||
|
|
||||||
def set_module_variables_for_package(pkg):
|
def set_module_variables_for_package(pkg):
|
||||||
|
Loading…
Reference in New Issue
Block a user