From 0570b075d4793f0e137f70d9ff741c95bd6d9053 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 4 May 2018 16:27:54 +0200 Subject: [PATCH] openmpi: don't build static libraries if slurm is activated (#8021) According to this comment: https://github.com/open-mpi/ompi/issues/4338#issuecomment-383982008 on an OpenMPI issue, using `--enable-static` silently disable slurm support. --- var/spack/repos/builtin/packages/openmpi/package.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index abd1fdde6e..9731558eb0 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -336,8 +336,16 @@ def configure_args(self): spec = self.spec config_args = [ '--enable-shared', - '--enable-static' ] + + # According to this comment on github: + # + # https://github.com/open-mpi/ompi/issues/4338#issuecomment-383982008 + # + # adding --enable-static silently disables slurm support via pmi/pmi2 + if not spec.satisfies('schedulers=slurm'): + config_args.append('--enable-static') + if spec.satisfies('@2.0:'): # for Open-MPI 2.0:, C++ bindings are disabled by default. config_args.extend(['--enable-mpi-cxx'])