From e6d462589f2437997c4d3c05305b89b986f7f57f Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 4 Jan 2021 19:05:11 -0800 Subject: [PATCH] OpenMPI: Depends on hwlock & libevent (#20658) * OpenMPI: Depends on hwlock & libevent Both hwlock & libevent are required dependencies of Open MPI. While they are also shipped internally, newer releases (>=4.0) will start looking for external packages by default. This caused build issues of Open MPI 4.0.5 with Fortran on macOS 10.15. * Open MPI 4.0: libevent external Internally shipped libevent just works fine for prior releases. --- var/spack/repos/builtin/packages/openmpi/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index c66e2b830a..fb5d70f34f 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -266,6 +266,8 @@ class Openmpi(AutotoolsPackage): depends_on('pkgconfig', type='build') + depends_on('libevent@2.0:', when='@4:') + depends_on('hwloc@2.0:', when='@4:') # ompi@:3.0.0 doesn't support newer hwloc releases: # "configure: error: OMPI does not currently support hwloc v2 API" @@ -676,6 +678,9 @@ def configure_args(self): if spec.satisfies('+lustre'): lustre_opt = '--with-lustre={0}'.format(spec['lustre'].prefix) config_args.append(lustre_opt) + # external libevent + if spec.satisfies('@4.0.0:'): + config_args.append('--with-libevent={0}'.format(spec['libevent'].prefix)) # Hwloc support if spec.satisfies('@1.5.2:'): config_args.append('--with-hwloc={0}'.format(spec['hwloc'].prefix))