From 4eb25620506d4c8bb4e74382efdfc33b9ba0b7c0 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 19 Nov 2024 10:13:13 +0100 Subject: [PATCH] Unset PMIX variables when configuring OpenMPI --- easybuild/easyblocks/o/openmpi.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/easybuild/easyblocks/o/openmpi.py b/easybuild/easyblocks/o/openmpi.py index ebdbd02391..55669152cd 100644 --- a/easybuild/easyblocks/o/openmpi.py +++ b/easybuild/easyblocks/o/openmpi.py @@ -32,6 +32,7 @@ import re from easybuild.tools import LooseVersion +import easybuild.tools.environment as env import easybuild.tools.toolchain as toolchain from easybuild.easyblocks.generic.configuremake import ConfigureMake from easybuild.framework.easyconfig.constants import EASYCONFIG_CONSTANTS @@ -140,6 +141,13 @@ def config_opt_used(key, enable_opt=False): else: self.cfg.update('configopts', '--without-verbs') + if '--with-pmix' in self.cfg['configopts']: + # Unset PMIX variables potentially set by SLURM which may cause configure errors such as + # > configure: WARNING: OPAL_VAR_SCOPE_PUSH called on "PMIX_VERSION", + # > configure: WARNING: but it is already defined with value "3.2.3" + # > configure: WARNING: This usually indicates an error in configure. + # > configure: error: Cannot continue + env.unset_env_vars([v for v in os.environ if v.startswith("PMIX_")]) super(EB_OpenMPI, self).configure_step() def test_step(self):