chameleon: add new package (#30368)

This commit is contained in:
fpruvost 2022-05-04 16:09:54 +02:00 committed by GitHub
parent cb97b25646
commit dc99fe98b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,97 @@
# Copyright 2013-2022 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)
class Chameleon(CMakePackage, CudaPackage):
"""Dense Linear Algebra for Scalable Multi-core Architectures and GPGPUs"""
homepage = "https://gitlab.inria.fr/solverstack/chameleon"
url = "https://gitlab.inria.fr/solverstack/chameleon/uploads/b299d6037d7636c6be16108c89bc2aab/chameleon-1.1.0.tar.gz"
git = "https://gitlab.inria.fr/solverstack/chameleon.git"
version('master', branch='master', submodules=True)
version('1.1.0', 'e64d0438dfaf5effb3740e53f3ab017d12744b85a138b2ef702a81df559126df')
# cmake's specific
variant('shared', default=True, description='Build chameleon as a shared library')
# chameleon's specific
variant(
'runtime', default='starpu', description='Runtime support',
values=('openmp', 'starpu'), multi=False
)
variant('mpi', default=True, when='runtime=starpu', description='Enable MPI')
variant('cuda', default=False, when='runtime=starpu', description='Enable CUDA')
variant('fxt', default=False, when='runtime=starpu', description='Enable FxT tracing support through StarPU')
variant('simgrid', default=False, when='runtime=starpu', description='Enable simulation mode through StarPU+SimGrid')
# dependencies
depends_on("pkg-config", type='build')
with when("runtime=starpu"):
depends_on("starpu")
depends_on("starpu~mpi", when='~mpi')
depends_on("starpu+mpi", when='+mpi')
depends_on("starpu~cuda", when='~cuda')
depends_on("starpu+cuda", when='+cuda')
with when("+simgrid"):
depends_on("starpu+simgrid")
depends_on("starpu+mpi~shared+simgrid", when='+mpi')
with when("~simgrid"):
depends_on("mpi", when='+mpi')
depends_on("cuda", when='+cuda')
with when("+fxt"):
depends_on("fxt")
depends_on("starpu+fxt")
with when("~simgrid"):
depends_on("blas")
depends_on("lapack")
def cmake_args(self):
spec = self.spec
args = [
"-Wno-dev",
self.define("CMAKE_COLOR_MAKEFILE", "ON"),
self.define("CMAKE_VERBOSE_MAKEFILE", "ON"),
self.define("CHAMELEON_ENABLE_EXAMPLE", "ON"),
self.define("CHAMELEON_ENABLE_TESTING", "ON"),
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("CHAMELEON_USE_MPI", "mpi"),
self.define_from_variant("CHAMELEON_USE_CUDA", "cuda"),
self.define_from_variant("CHAMELEON_SIMULATION", "simgrid")
]
if spec.satisfies('runtime=openmp'):
args.extend([self.define("CHAMELEON_SCHED", "OPENMP")])
if spec.satisfies('runtime=starpu'):
args.extend([self.define("CHAMELEON_SCHED", "STARPU")])
if spec.satisfies('+mpi +simgrid'):
args.extend([
self.define("MPI_C_COMPILER", self.spec['simgrid'].smpicc),
self.define("MPI_CXX_COMPILER", self.spec['simgrid'].smpicxx),
self.define("MPI_Fortran_COMPILER", self.spec['simgrid'].smpifc)
])
if spec.satisfies('+mpi ~simgrid'):
args.extend([
self.define("MPI_C_COMPILER", self.spec['mpi'].mpicc),
self.define("MPI_CXX_COMPILER", self.spec['mpi'].mpicxx),
self.define("MPI_Fortran_COMPILER", self.spec['mpi'].mpifc)
])
if spec.satisfies('~simgrid'):
if ('^intel-mkl' in spec or '^intel-parallel-studio+mkl' in spec):
if ('threads=none' in spec):
args.extend([self.define("BLA_VENDOR", "Intel10_64lp_seq")])
else:
args.extend([self.define("BLA_VENDOR", "Intel10_64lp")])
elif '^netlib-lapack' in spec:
args.extend([self.define("BLA_VENDOR", "Generic")])
elif '^openblas' in spec:
args.extend([self.define("BLA_VENDOR", "OpenBLAS")])
return args