diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-08-13 03:04:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 20:04:03 -0500 |
commit | fa216e5f153f0529c902ecf34fc906338ea9632a (patch) | |
tree | a6e3be4731774ea83981d37b93a33f035dbbc223 /var | |
parent | 075e9428a175ab17d84019c851731c1176e8fa0b (diff) | |
download | spack-fa216e5f153f0529c902ecf34fc906338ea9632a.tar.gz spack-fa216e5f153f0529c902ecf34fc906338ea9632a.tar.bz2 spack-fa216e5f153f0529c902ecf34fc906338ea9632a.tar.xz spack-fa216e5f153f0529c902ecf34fc906338ea9632a.zip |
mpich, mvapich2: fixed setup_*_environment (#18032)
fixes #18028
Since now external packages support multiple modules
the correct thing to do is to check if the name of the
*first* module to be loaded contains the string "cray"
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/mpich/package.py | 6 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/mvapich2/package.py | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 85e884c8d3..af24802b90 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -187,7 +187,8 @@ spack package at this time.''', # their run environments the code to make the compilers available. # For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers. # Cray MPIs always have cray in the module name, e.g. "cray-mpich" - if self.spec.external_modules and 'cray' in self.spec.external_modules: + external_modules = self.spec.external_modules + if external_modules and 'cray' in external_modules[0]: env.set('MPICC', spack_cc) env.set('MPICXX', spack_cxx) env.set('MPIF77', spack_fc) @@ -210,7 +211,8 @@ spack package at this time.''', def setup_dependent_package(self, module, dependent_spec): # For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers. # Cray MPIs always have cray in the module name, e.g. "cray-mpich" - if self.spec.external_modules and 'cray' in self.spec.external_modules: + external_modules = self.spec.external_modules + if external_modules and 'cray' in external_modules[0]: self.spec.mpicc = spack_cc self.spec.mpicxx = spack_cxx self.spec.mpifc = spack_fc diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index f857b58eb2..0f25cb7111 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -240,7 +240,8 @@ class Mvapich2(AutotoolsPackage): def setup_compiler_environment(self, env): # For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers. # Cray MPIs always have cray in the module name, e.g. "cray-mvapich" - if self.spec.external_modules and 'cray' in self.spec.external_modules: + external_modules = self.spec.external_modules + if external_modules and 'cray' in external_modules[0]: env.set('MPICC', spack_cc) env.set('MPICXX', spack_cxx) env.set('MPIF77', spack_fc) @@ -254,7 +255,8 @@ class Mvapich2(AutotoolsPackage): def setup_dependent_package(self, module, dependent_spec): # For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers. # Cray MPIs always have cray in the module name, e.g. "cray-mvapich" - if self.spec.external_modules and 'cray' in self.spec.external_modules: + external_modules = self.spec.external_modules + if external_modules and 'cray' in external_modules[0]: self.spec.mpicc = spack_cc self.spec.mpicxx = spack_cxx self.spec.mpifc = spack_fc |