From 5e5cc991470475d77c2ad6dda2a7cc288e00bafe Mon Sep 17 00:00:00 2001 From: Sajid Ali <30510036+s-sajid-ali@users.noreply.github.com> Date: Thu, 9 Jul 2020 16:14:49 -0500 Subject: [PATCH] clear mpicc and friends before each build (#17450) * clear mpi env vars --- lib/spack/spack/build_environment.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 1b8aae31dc..7ef2126766 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -174,6 +174,14 @@ def clean_environment(): for v in build_system_vars: env.unset(v) + # Unset mpi environment vars. These flags should only be set by + # mpi providers for packages with mpi dependencies + mpi_vars = [ + 'MPICC', 'MPICXX', 'MPIFC', 'MPIF77', 'MPIF90' + ] + for v in mpi_vars: + env.unset(v) + build_lang = spack.config.get('config:build_language') if build_lang: # Override language-related variables. This can be used to force