From b5e78bce069141d827f00d19f129b1860fa1953e Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin Date: Sun, 23 Aug 2020 05:01:41 +0200 Subject: [PATCH] OpenMPI: sanitize dependent build environment. (#15360) --- var/spack/repos/builtin/packages/openmpi/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 2cd70dbc07..7c79e8732d 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -367,6 +367,14 @@ def setup_dependent_build_environment(self, env, dependent_spec): env.set('OMPI_FC', spack_fc) env.set('OMPI_F77', spack_f77) + # See https://www.open-mpi.org/faq/?category=building#installdirs + for suffix in ['PREFIX', 'EXEC_PREFIX', 'BINDIR', 'SBINDIR', + 'LIBEXECDIR', 'DATAROOTDIR', 'DATADIR', 'SYSCONFDIR', + 'SHAREDSTATEDIR', 'LOCALSTATEDIR', 'LIBDIR', + 'INCLUDEDIR', 'INFODIR', 'MANDIR', 'PKGDATADIR', + 'PKGLIBDIR', 'PKGINCLUDEDIR']: + env.unset('OPAL_%s' % suffix) + def setup_dependent_package(self, module, dependent_spec): self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++')