summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/intel-mpi/package.py3
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py20
2 files changed, 13 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/intel-mpi/package.py b/var/spack/repos/builtin/packages/intel-mpi/package.py
index 76bc35b0ca..91eaf9b4a6 100644
--- a/var/spack/repos/builtin/packages/intel-mpi/package.py
+++ b/var/spack/repos/builtin/packages/intel-mpi/package.py
@@ -59,6 +59,9 @@ class IntelMpi(IntelPackage):
provides('mpi')
+ variant('external-libfabric', default=False, description='Enable external libfabric dependency')
+ depends_on('libfabric', when='+external-libfabric', type=('build', 'link', 'run'))
+
def setup_dependent_build_environment(self, *args):
# Handle in callback, conveying client's compilers in additional arg.
# CAUTION - DUP code in:
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
index 2672613c5a..789931f9c7 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
@@ -4,9 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-import glob
import platform
-import subprocess
from spack import *
@@ -38,11 +36,11 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage):
variant('ilp64', default=False,
description='Build with ILP64 support')
+ variant('external-libfabric', default=False, description='Enable external libfabric dependency')
+ depends_on('libfabric', when='+external-libfabric', type=('link', 'run'))
provides('mpi@:3.1')
- depends_on('patchelf', type='build')
-
@property
def component_dir(self):
return 'mpi'
@@ -87,17 +85,19 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage):
libs += find_libraries(['libmpicxx', 'libmpifort'], lib_dir)
libs += find_libraries('libmpi', release_lib_dir)
libs += find_system_libraries(['libdl', 'librt', 'libpthread'])
+
+ # Find libfabric for libmpi.so
+ if '+external-libfabric' in self.spec:
+ libs += self.spec['libfabric'].libs
+ else:
+ libs += find_libraries(['libfabric'],
+ join_path(self.component_path, 'libfabric', 'lib'))
+
return libs
def install(self, spec, prefix):
super(IntelOneapiMpi, self).install(spec, prefix)
- # Patch libmpi.so rpath so it can find libfabric
- libfabric_rpath = join_path(self.component_path, 'libfabric', 'lib')
- for libmpi in glob.glob(join_path(self.component_path,
- 'lib', '**', 'libmpi*.so')):
- subprocess.call(['patchelf', '--set-rpath', libfabric_rpath, libmpi])
-
# When spack builds from source
# fix I_MPI_SUBSTITUTE_INSTALLDIR and
# __EXEC_PREFIX_TO_BE_FILLED_AT_INSTALL_TIME__