mpicxx does not work with icpx (#30098)

This commit is contained in:
Martin Diehl 2022-06-03 17:40:02 +02:00 committed by GitHub
parent 1bd33d88bd
commit 38ccefbe84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,10 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage):
variant('ilp64', default=False, variant('ilp64', default=False,
description='Build with ILP64 support') description='Build with ILP64 support')
variant('external-libfabric', default=False, description='Enable external libfabric dependency') variant('generic-names', default=False,
description='Use generic names, e.g mpicc instead of mpiicc')
variant('external-libfabric', default=False,
description='Enable external libfabric dependency')
depends_on('libfabric', when='+external-libfabric', type=('link', 'run')) depends_on('libfabric', when='+external-libfabric', type=('link', 'run'))
provides('mpi@:3.1') provides('mpi@:3.1')
@ -60,10 +63,16 @@ def component_dir(self):
def setup_dependent_package(self, module, dep_spec): def setup_dependent_package(self, module, dep_spec):
dir = join_path(self.component_path, 'bin') dir = join_path(self.component_path, 'bin')
self.spec.mpicc = join_path(dir, 'mpicc') if '+generic-names' in self.spec:
self.spec.mpicxx = join_path(dir, 'mpicxx') self.spec.mpicc = join_path(dir, 'mpicc')
self.spec.mpif77 = join_path(dir, 'mpif77') self.spec.mpicxx = join_path(dir, 'mpicxx')
self.spec.mpifc = join_path(dir, 'mpifc') self.spec.mpif77 = join_path(dir, 'mpif77')
self.spec.mpifc = join_path(dir, 'mpifc')
else:
self.spec.mpicc = join_path(dir, 'mpiicc')
self.spec.mpicxx = join_path(dir, 'mpiicpc')
self.spec.mpif77 = join_path(dir, 'mpiifort')
self.spec.mpifc = join_path(dir, 'mpiifort')
def setup_dependent_build_environment(self, env, dependent_spec): def setup_dependent_build_environment(self, env, dependent_spec):
env.set('MPICH_CC', spack_cc) env.set('MPICH_CC', spack_cc)
@ -74,11 +83,18 @@ def setup_dependent_build_environment(self, env, dependent_spec):
# Set compiler wrappers for dependent build stage # Set compiler wrappers for dependent build stage
dir = join_path(self.component_path, 'bin') dir = join_path(self.component_path, 'bin')
env.set('MPICC', join_path(dir, 'mpicc')) if '+generic-names' in self.spec:
env.set('MPICXX', join_path(dir, 'mpicxx')) env.set('MPICC', join_path(dir, 'mpicc'))
env.set('MPIF77', join_path(dir, 'mpif77')) env.set('MPICXX', join_path(dir, 'mpicxx'))
env.set('MPIF90', join_path(dir, 'mpif90')) env.set('MPIF77', join_path(dir, 'mpif77'))
env.set('MPIFC', join_path(dir, 'mpifc')) env.set('MPIF90', join_path(dir, 'mpif90'))
env.set('MPIFC', join_path(dir, 'mpifc'))
else:
env.set('MPICC', join_path(dir, 'mpiicc'))
env.set('MPICXX', join_path(dir, 'mpiicpc'))
env.set('MPIF77', join_path(dir, 'mpiifort'))
env.set('MPIF90', join_path(dir, 'mpiifort'))
env.set('MPIFC', join_path(dir, 'mpiifort'))
env.set('I_MPI_ROOT', self.component_path) env.set('I_MPI_ROOT', self.component_path)