summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2020-06-08 18:44:07 -0500
committerGitHub <noreply@github.com>2020-06-08 16:44:07 -0700
commitbcf8ebff4ff3ca25c17e690187b1e7cf46657ee5 (patch)
tree99d2768d66bb31f4bbbf9b2f29ca67d54c40e042 /lib
parent6f9bfec32ec98bff24d00324ef7f9128e74ba87e (diff)
downloadspack-bcf8ebff4ff3ca25c17e690187b1e7cf46657ee5.tar.gz
spack-bcf8ebff4ff3ca25c17e690187b1e7cf46657ee5.tar.bz2
spack-bcf8ebff4ff3ca25c17e690187b1e7cf46657ee5.tar.xz
spack-bcf8ebff4ff3ca25c17e690187b1e7cf46657ee5.zip
Cray: fix Blue Waters support and user-built MPIs on Cray (#16593)
* Cray: fix Blue Waters support * pkg-config env vars needed on Blue Waters * cray platform: fix support for user-build MPI on cray machines * reintroduce cray environment cleaning behind cnl version guard * cray platform: fix support for user-build MPI on cray machines Co-authored-by: Gregory <becker33@llnl.gov>
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py24
-rw-r--r--lib/spack/spack/platforms/cray.py6
2 files changed, 19 insertions, 11 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index f57ecd1e58..435de8594e 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -53,6 +53,7 @@ import spack.main
import spack.paths
import spack.schema.environment
import spack.store
+import spack.architecture as arch
from spack.util.string import plural
from spack.util.environment import (
env_flag, filter_system_paths, get_path, is_system_path,
@@ -141,17 +142,21 @@ def clean_environment():
# can affect how some packages find libraries. We want to make
# sure that builds never pull in unintended external dependencies.
env.unset('LD_LIBRARY_PATH')
- env.unset('CRAY_LD_LIBRARY_PATH')
env.unset('LIBRARY_PATH')
env.unset('CPATH')
env.unset('LD_RUN_PATH')
env.unset('DYLD_LIBRARY_PATH')
env.unset('DYLD_FALLBACK_LIBRARY_PATH')
- # Remove all pkgconfig stuff from craype
- for varname in os.environ.keys():
- if 'PKGCONF' in varname:
- env.unset(varname)
+ # On Cray systems newer than CNL5, unset CRAY_LD_LIBRARY_PATH to avoid
+ # interference with Spack dependencies. CNL5 (e.g. Blue Waters) requires
+ # these variables to be set.
+ hostarch = arch.Arch(arch.platform(), 'default_os', 'default_target')
+ if str(hostarch.platform) == 'cray' and str(hostarch.os) != 'cnl5':
+ env.unset('CRAY_LD_LIBRARY_PATH')
+ for varname in os.environ.keys():
+ if 'PKGCONF' in varname:
+ env.unset(varname)
build_lang = spack.config.get('config:build_language')
if build_lang:
@@ -355,10 +360,6 @@ def set_build_environment_variables(pkg, env, dirty):
extra_rpaths = ':'.join(compiler.extra_rpaths)
env.set('SPACK_COMPILER_EXTRA_RPATHS', extra_rpaths)
- implicit_rpaths = compiler.implicit_rpaths()
- if implicit_rpaths:
- env.set('SPACK_COMPILER_IMPLICIT_RPATHS', ':'.join(implicit_rpaths))
-
# Add bin directories from dependencies to the PATH for the build.
for prefix in build_prefixes:
for dirname in ['bin', 'bin64']:
@@ -733,6 +734,11 @@ def setup_package(pkg, dirty):
load_external_modules(pkg)
+ implicit_rpaths = pkg.compiler.implicit_rpaths()
+ if implicit_rpaths:
+ build_env.set('SPACK_COMPILER_IMPLICIT_RPATHS',
+ ':'.join(implicit_rpaths))
+
# Make sure nothing's strange about the Spack environment.
validate(build_env, tty.warn)
build_env.apply_modifications()
diff --git a/lib/spack/spack/platforms/cray.py b/lib/spack/spack/platforms/cray.py
index 2fccf2fe55..9c8770c368 100644
--- a/lib/spack/spack/platforms/cray.py
+++ b/lib/spack/spack/platforms/cray.py
@@ -22,7 +22,9 @@ _craype_name_to_target_name = {
'x86-naples': 'zen',
'x86-rome': 'zen', # Cheating because we have the wrong modules on rzcrayz
'x86-skylake': 'skylake_avx512',
- 'mic-knl': 'mic_knl'
+ 'mic-knl': 'mic_knl',
+ 'interlagos': 'bulldozer',
+ 'abudhabi': 'piledriver',
}
@@ -176,7 +178,7 @@ class Cray(Platform):
craype_default_path = '/opt/cray/pe/craype/default/modulefiles'
if os.path.isdir(craype_default_path):
return os.listdir(craype_default_path)
- return None
+ return []
if getattr(self, '_craype_targets', None) is None:
strategies = [