commit:     2faee57e680fdc28e2b5af03ccfbcdb6515a46a2
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  8 00:32:23 2026 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Sun Mar  8 00:33:26 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2faee57e

dev-cpp/kokkos: add 5.0.2

Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>

 dev-cpp/kokkos/Manifest            |   1 +
 dev-cpp/kokkos/kokkos-5.0.2.ebuild | 112 +++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/dev-cpp/kokkos/Manifest b/dev-cpp/kokkos/Manifest
index 26cc03fc5274..e297bb22da68 100644
--- a/dev-cpp/kokkos/Manifest
+++ b/dev-cpp/kokkos/Manifest
@@ -1,3 +1,4 @@
 DIST kokkos-4.0.1.tar.gz 2322402 BLAKE2B 
a4aba2f7ffe7b7c93051ad65d398f442b753975eceb3f83ed1bff0b8c468e4ffdcb6437989e740c65fc550f17ef8ddf78ca50ca881d3953f886309dc7d6fc597
 SHA512 
cf6742f4be777b52673858b49cf68fdf335e760509688483e62ef41af5026070f69dcf39d010134c85dc6c4868f82a38900872be11ed43190432c8530b90deee
 DIST kokkos-4.3.1.tar.gz 2431142 BLAKE2B 
158ceea3c62449f386613b17e996e4d11e9b95c38a92f69fb3c487b90cf5f07dffdafb6ee0a37eff5299e7d1db50efaed4b26b9baebeeea9d675d0d98dd420e4
 SHA512 
8180ecdec2f0a6167a85dd1eb268996b0310e82098f2329eccf658aff90118a7c85c2f7607984602de2ca48dc45c1dbf30a4843b35c42590e58d4b03beff474a
 DIST kokkos-4.6.2.tar.gz 2477557 BLAKE2B 
3d8a93ca8e27bc0a3a5542680b0a2daf7ca862826a1a45973012f09a6f0a39938628efdb532bb2d013cb669b912785eac12bcf1b17712cb3e098106e858f3fe3
 SHA512 
bef5afc0009d6e3ac555dbaebc471fe0823ac1d1add79dcacbed82bee4d2a9a34cf4342fbef8fd00beefc6bd0a2f569e9f0cbe987ec60d087fde803479eff426
+DIST kokkos-5.0.2.tar.gz 1787648 BLAKE2B 
c951a2fdae309a61c1cdc042a12aa27636e58fd39a3ef4426bca9f659d6f8056774298e56ccc7c94d0b356319e3b913e9637dd0c3850313a77470dc8abe5e1c5
 SHA512 
d0c622aad2333cc5f944d82f633cf24201323d1b9787c730aaaee3e80805caf1c39bec36cabd5fd46d8104aaf95c68ffe478d8ff8cd4b864c47298f2aa929ecd

diff --git a/dev-cpp/kokkos/kokkos-5.0.2.ebuild 
b/dev-cpp/kokkos/kokkos-5.0.2.ebuild
new file mode 100644
index 000000000000..3879a12dbe94
--- /dev/null
+++ b/dev-cpp/kokkos/kokkos-5.0.2.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake cuda toolchain-funcs
+
+DESCRIPTION="C++ Performance Portability Programming EcoSystem"
+HOMEPAGE="https://github.com/kokkos";
+
+if [[ ${PV} = *9999* ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/kokkos/kokkos.git";
+else
+       SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${PV}.tar.gz 
-> ${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cuda +openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sys-apps/hwloc:="
+RDEPEND="${DEPEND}"
+
+#
+# Try to translate the "${CUDAARCHS}" number coming from __nvcc_device_query
+# into an option string that Kokkos' CMake configuration understands:
+#
+kokkos_arch_option() {
+       case "${1}" in
+               3[0257]) echo "-DKokkos_ARCH_KEPLER${1}=ON"     ;;
+               5[023])  echo "-DKokkos_ARCH_MAXWELL${1}=ON"    ;;
+               6[01])   echo "-DKokkos_ARCH_PASCAL${1}=ON"     ;;
+               7[02])   echo "-DKokkos_ARCH_VOLTA${1}=ON"      ;;
+               75)      echo "-DKokkos_ARCH_TURING${1}=ON"     ;;
+               8[06])   echo "-DKokkos_ARCH_AMPERE${1}=ON"     ;;
+               89)      echo "-DKokkos_ARCH_ADA${1}=ON"        ;;
+               90)      echo "-DKokkos_ARCH_HOPPER${1}=ON"     ;;
+               1[02]0)  echo "-DKokkos_ARCH_BLACKWELL${1}=ON"  ;;
+               *)       die "Unknown CUDA architecture »${1}«" ;;
+       esac
+}
+
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DCMAKE_INSTALL_INCLUDEDIR=include/kokkos
+               -DKokkos_ENABLE_TESTS="$(usex test)"
+               -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON
+               -DKokkos_ENABLE_SERIAL=ON
+               -DKokkos_ENABLE_HWLOC=ON
+               -DKokkos_ENABLE_CUDA="$(usex cuda)"
+               -DKokkos_ENABLE_CUDA_CONSTEXPR="$(usex cuda)"
+               -DKokkos_HWLOC_DIR="${EPREFIX}/usr"
+               -DKokkos_ENABLE_OPENMP="$(usex openmp)"
+               -DBUILD_SHARED_LIBS=ON
+       )
+
+       if use cuda; then
+               cuda_add_sandbox -w
+
+               if [[ ! -n "${CUDAARCHS}" ]]; then
+                       if ! SANDBOX_WRITE=/dev/nvidiactl test -w 
/dev/nvidiactl ; then
+                               eerror
+                               eerror "Can not access the GPU at 
/dev/nvidiactl."
+                               eerror "User $(id -nu) is not in the group 
\"video\"."
+                               eerror
+                               ewarn
+                               ewarn "Can not query the native device. You 
will need to set one of the"
+                               ewarn "supported Kokkos_ARCH_{..} CMake 
variables, or the CUDAARCHS"
+                               ewarn "environment variable to the appropriate 
architecture by hand..."
+                               ewarn
+                       else
+                               local CUDAARCHS
+                               CUDAARCHS="$(__nvcc_device_query || eerror 
"failed to query the native device")"
+                       fi
+               fi
+
+               if [[ -n "${CUDAARCHS}" ]]; then
+                       einfo "Building with CUDAARCHS=${CUDAARCHS}"
+                       mycmakeargs+=(
+                               $(kokkos_arch_option "${CUDAARCHS}")
+                       )
+               fi
+       fi
+
+       cmake_src_configure
+}
+
+src_test() {
+       local myctestargs=(
+               # Contains "death tests" which are known/expected(?) to fail
+               # https://github.com/kokkos/kokkos/issues/3033
+               # bug #791514
+               -E "(KokkosCore_UnitTest_OpenMP|KokkosCore_UnitTest_Serial)"
+       )
+
+       cmake_src_test
+}

Reply via email to