diff options
author | Jonathan R. Madsen <jrmadsen@users.noreply.github.com> | 2021-06-01 12:50:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 19:50:03 +0000 |
commit | 314329deea33968b9e8b5fe738dbf0a4a06be3c8 (patch) | |
tree | ddfc057c379567959c20ca299af67a2f9d921eed /var | |
parent | e8afc5db15ed71f8a4cc19db7d3bb0794780d412 (diff) | |
download | spack-314329deea33968b9e8b5fe738dbf0a4a06be3c8.tar.gz spack-314329deea33968b9e8b5fe738dbf0a4a06be3c8.tar.bz2 spack-314329deea33968b9e8b5fe738dbf0a4a06be3c8.tar.xz spack-314329deea33968b9e8b5fe738dbf0a4a06be3c8.zip |
Create pykokkos-base package (#24054)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-pykokkos-base/package.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-pykokkos-base/package.py b/var/spack/repos/builtin/packages/py-pykokkos-base/package.py new file mode 100644 index 0000000000..cfe0744fb9 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pykokkos-base/package.py @@ -0,0 +1,62 @@ +# Copyright 2013-2021 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 PyPykokkosBase(CMakePackage, PythonPackage): + '''Minimal set of bindings for Kokkos interoperability with Python + (initialize, finalize, View, DynRankView, Kokkos-tools)''' + + homepage = 'https://github.com/kokkos/pykokkos-base.git' + git = 'https://github.com/kokkos/pykokkos-base.git' + maintainers = ['jrmadsen'] + + version('main', branch='main', submodules=False) + version('0.0.5', commit='45f6e892c007ab124fabb3a545f4744537eafb55', submodules=False) + version('0.0.4', commit='2efe1220d0128d3f2d371c9ed5234c4978d73a77', submodules=False) + version('0.0.3', commit='4fe4421ac624ba2efe1eee265153e690622a18a5', submodules=False) + + variant( + 'layouts', + default=True, + description='Build Kokkos View/DynRankView with layout variants', + ) + variant( + 'memory_traits', + default=True, + description='Build Kokkos View/DynRankView with memory trait variants', + ) + variant( + 'view_ranks', + default='4', + description='Max Kokkos View dimensions', + values=('1', '2', '3', '4', '5', '6', '7'), + multi=False, + ) + + extends('python') + depends_on('cmake@3.16:', type='build') + depends_on('py-pybind11', type='build') + depends_on('kokkos@3.4.00:', type=('build', 'run')) + depends_on('python@3:', type=('build', 'run')) + + def cmake_args(self): + spec = self.spec + + args = [ + self.define('ENABLE_INTERNAL_KOKKOS', False), + self.define('ENABLE_INTERNAL_PYBIND11', False), + self.define('PYTHON_EXECUTABLE', spec['python'].command.path), + self.define('Python3_EXECUTABLE', spec['python'].command.path), + self.define_from_variant('ENABLE_VIEW_RANKS', 'view_ranks'), + ] + + for dep in ('layouts', 'memory_traits'): + args.append(self.define_from_variant('ENABLE_' + dep.upper(), dep)) + + return args |