Fix an issue where cray module files may not have CRAY_MPICH_DIR set (#24267)

This commit is contained in:
Harmen Stoppels 2021-06-17 12:28:25 +02:00 committed by GitHub
parent b8ad621907
commit 75675de02a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,13 @@ def external_prefix(self):
if "CRAY_MPICH_DIR" in line: if "CRAY_MPICH_DIR" in line:
return get_path_args_from_module_line(line)[0] return get_path_args_from_module_line(line)[0]
# Fixes an issue on Archer2 cray-mpich/8.0.16 where there is
# no CRAY_MPICH_DIR variable in the module file.
for line in mpich_module:
if "CRAY_LD_LIBRARY_PATH" in line:
libdir = get_path_args_from_module_line(line)[0]
return os.path.dirname(os.path.normpath(libdir))
def setup_run_environment(self, env): def setup_run_environment(self, env):
env.set('MPICC', spack_cc) env.set('MPICC', spack_cc)
env.set('MPICXX', spack_cxx) env.set('MPICXX', spack_cxx)