From 5b59e883c1bb30b5893bb6bd3d6ea6be2e3c294e Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Wed, 17 Jun 2020 17:53:30 -0500 Subject: cray module do not work without CRAY_LD_LIBRARY_PATH (#17031) Co-authored-by: Gregory Becker --- lib/spack/spack/build_environment.py | 12 ++++++++---- lib/spack/spack/util/module_cmd.py | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 435de8594e..f997110b4c 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -32,6 +32,7 @@ There are two parts to the build environment: Skimming this module is a nice way to get acquainted with the types of calls you can make from within the install() function. """ +import re import inspect import multiprocessing import os @@ -148,11 +149,14 @@ def clean_environment(): env.unset('DYLD_LIBRARY_PATH') env.unset('DYLD_FALLBACK_LIBRARY_PATH') - # 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. + # On Cray "cluster" systems, unset CRAY_LD_LIBRARY_PATH to avoid + # interference with Spack dependencies. + # CNL requires these variables to be set (or at least some of them, + # depending on the CNL version). hostarch = arch.Arch(arch.platform(), 'default_os', 'default_target') - if str(hostarch.platform) == 'cray' and str(hostarch.os) != 'cnl5': + on_cray = str(hostarch.platform) == 'cray' + using_cnl = re.match(r'cnl\d+', str(hostarch.os)) + if on_cray and not using_cnl: env.unset('CRAY_LD_LIBRARY_PATH') for varname in os.environ.keys(): if 'PKGCONF' in varname: diff --git a/lib/spack/spack/util/module_cmd.py b/lib/spack/spack/util/module_cmd.py index a5ebe73c84..7017b2ecb6 100644 --- a/lib/spack/spack/util/module_cmd.py +++ b/lib/spack/spack/util/module_cmd.py @@ -127,7 +127,7 @@ def get_path_args_from_module_line(line): # OPERATION VAR_NAME PATH_ARG words = line.split() if len(words) > 2: - path_arg = line.split()[2] + path_arg = words[2] else: return [] -- cgit v1.2.3-70-g09d2