New package: cray-mpich (#20076)

Cray's version of MPICH uses a different versioning system than
MPICH, so it has been split into its own package. It is an
external-only package (always provided by the system, never
installed by Spack).
This commit is contained in:
Harmen Stoppels 2020-12-17 22:13:21 +01:00 committed by GitHub
parent 105ee757bc
commit a879c875dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 69 additions and 27 deletions

View File

@ -0,0 +1,60 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class CrayMpich(Package):
"""Cray's MPICH is a high performance and widely portable implementation of
the Message Passing Interface (MPI) standard."""
homepage = "https://docs.nersc.gov/development/compilers/wrappers/"
has_code = False # Skip attempts to fetch source that is not available
maintainers = ['haampie']
version('8.1.0')
version('8.0.16')
version('8.0.14')
version('8.0.11')
version('8.0.9')
version('7.7.16')
version('7.7.15')
version('7.7.14')
version('7.7.13')
provides('mpi@3')
def setup_run_environment(self, env):
env.set('MPICC', spack_cc)
env.set('MPICXX', spack_cxx)
env.set('MPIF77', spack_fc)
env.set('MPIF90', spack_fc)
def setup_dependent_build_environment(self, env, dependent_spec):
self.setup_run_environment(env)
env.set('MPICH_CC', spack_cc)
env.set('MPICH_CXX', spack_cxx)
env.set('MPICH_F77', spack_f77)
env.set('MPICH_F90', spack_fc)
env.set('MPICH_FC', spack_fc)
def setup_dependent_package(self, module, dependent_spec):
spec = self.spec
spec.mpicc = spack_cc
spec.mpicxx = spack_cxx
spec.mpifc = spack_fc
spec.mpif77 = spack_f77
spec.mpicxx_shared_libs = [
join_path(self.prefix.lib, 'libmpicxx.{0}'.format(dso_suffix)),
join_path(self.prefix.lib, 'libmpi.{0}'.format(dso_suffix))
]
def install(self, spec, prefix):
raise InstallError(
self.spec.format('{name} is not installable, you need to specify '
'it as an external package in packages.yaml'))

View File

@ -301,19 +301,10 @@ def setup_build_environment(self, env):
def setup_run_environment(self, env):
# Because MPI implementations provide compilers, they have to add to
# their run environments the code to make the compilers available.
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mpich"
external_modules = self.spec.external_modules
if external_modules and 'cray' in external_modules[0]:
env.set('MPICC', spack_cc)
env.set('MPICXX', spack_cxx)
env.set('MPIF77', spack_fc)
env.set('MPIF90', spack_fc)
else:
env.set('MPICC', join_path(self.prefix.bin, 'mpicc'))
env.set('MPICXX', join_path(self.prefix.bin, 'mpic++'))
env.set('MPIF77', join_path(self.prefix.bin, 'mpif77'))
env.set('MPIF90', join_path(self.prefix.bin, 'mpif90'))
env.set('MPICC', join_path(self.prefix.bin, 'mpicc'))
env.set('MPICXX', join_path(self.prefix.bin, 'mpic++'))
env.set('MPIF77', join_path(self.prefix.bin, 'mpif77'))
env.set('MPIF90', join_path(self.prefix.bin, 'mpif90'))
def setup_dependent_build_environment(self, env, dependent_spec):
self.setup_run_environment(env)
@ -327,21 +318,12 @@ def setup_dependent_build_environment(self, env, dependent_spec):
def setup_dependent_package(self, module, dependent_spec):
spec = self.spec
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mpich"
external_modules = spec.external_modules
if external_modules and 'cray' in external_modules[0]:
spec.mpicc = spack_cc
spec.mpicxx = spack_cxx
spec.mpifc = spack_fc
spec.mpif77 = spack_f77
else:
spec.mpicc = join_path(self.prefix.bin, 'mpicc')
spec.mpicxx = join_path(self.prefix.bin, 'mpic++')
spec.mpicc = join_path(self.prefix.bin, 'mpicc')
spec.mpicxx = join_path(self.prefix.bin, 'mpic++')
if '+fortran' in spec:
spec.mpifc = join_path(self.prefix.bin, 'mpif90')
spec.mpif77 = join_path(self.prefix.bin, 'mpif77')
if '+fortran' in spec:
spec.mpifc = join_path(self.prefix.bin, 'mpif90')
spec.mpif77 = join_path(self.prefix.bin, 'mpif77')
spec.mpicxx_shared_libs = [
join_path(self.prefix.lib, 'libmpicxx.{0}'.format(dso_suffix)),