Set default link type to dynamic on cray. Includes hooks for platform-based environment changes

This commit is contained in:
Gregory Becker 2016-07-20 11:35:13 -07:00
parent 106147716a
commit f4fb9a0771
3 changed files with 19 additions and 0 deletions

View File

@ -190,6 +190,12 @@ def operating_system(self, name):
return self.operating_sys.get(name, None)
@classmethod
def setup_platform_environment(self, env):
""" Subclass can override this method if it requires any
platform-specific build environment modifications.
"""
pass
@classmethod
def detect(self):

View File

@ -248,6 +248,11 @@ def set_build_environment_variables(pkg, env, dirty=False):
ci = join_path(item, 'case-insensitive')
if os.path.isdir(ci):
env_paths.append(ci)
# for item in pkg.spec.platform.env_paths:
# env_paths.append(item)
# TODO: move platform-specific knowledge to platform.
# (join_path(spack.build_env_path, 'cray'))
for item in reversed(env_paths):
env.prepend_path('PATH', item)
@ -444,6 +449,7 @@ def setup_package(pkg, dirty=False):
set_compiler_environment_variables(pkg, spack_env)
set_build_environment_variables(pkg, spack_env, dirty)
pkg.spec.architecture.platform.setup_platform_environment(spack_env)
load_external_modules(pkg)
# traverse in postorder so package can use vars from its dependencies
spec = pkg.spec

View File

@ -44,6 +44,13 @@ def __init__(self):
self.add_operating_system(str(linux_dist), linux_dist)
self.add_operating_system('CNL10', Cnl())
@classmethod
def setup_platform_environment(self, env):
""" Change the linker to default dynamic to be more
similar to linux/standard linker behavior
"""
env.set('CRAYPE_LINK_TYPE', 'dynamic')
@classmethod
def detect(self):
try: