Create pykokkos-base package (#24054)

This commit is contained in:
Jonathan R. Madsen 2021-06-01 12:50:03 -07:00 committed by GitHub
parent e8afc5db15
commit 314329deea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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