diff mbox series

[bug#66516,1/2] gnu: Add kokkos.

Message ID a2f16a111047b4dfc49e06bcf2efe40a9ce9d724.1697199836.git.paul@apatience.com
State New
Headers show
Series gnu: dealii: Update to 9.5.1. | expand

Commit Message

Paul A. Patience Oct. 13, 2023, 12:35 p.m. UTC
* gnu/packages/maths.scm (kokkos): New variable.
---
 gnu/packages/maths.scm | 51 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

Comments

Paul A. Patience Oct. 13, 2023, 2:27 p.m. UTC | #1
Hi,

Come to think of it, I placed kokkos in gnu/packages/maths.scm only so
that it would be right above trilinos-for-dealii-openmpi, because
Trilinos includes a version of Kokkos.

However, it seems that Kokkos is a project in its own right; perhaps it
should go into gnu/packages/cpp.scm, near where I placed Taskflow in
https://bugs.gnu.org/66521.

If you think this is a good idea, feel free to make the change or
request that I do so.

Best regards,
Paul
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 7a87fcb54e..2762e13a4f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -116,6 +116,7 @@  (define-module (gnu packages maths)
   #:use-module (gnu packages cyrus-sasl)
   #:use-module (gnu packages datamash)
   #:use-module (gnu packages dbm)
+  #:use-module (gnu packages disk)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages emacs)
@@ -6403,6 +6404,56 @@  (define-public lpsolve
 revised simplex and the branch-and-bound methods.")
     (license license:lgpl2.1+)))
 
+(define-public kokkos
+  (package
+    (name "kokkos")
+    (version "4.1.00")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/kokkos/kokkos")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "15kjpa54ssrrbid9h2nr94nh85qna5c4vq2152i4iy7gaagigy3c"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Remove bundled googletest.
+        #~(delete-file-recursively "tpls/gtest"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:configure-flags
+           ;; deal.II uses only the serial backend, so do not enable the
+           ;; others yet.
+           #~(list "-DBUILD_SHARED_LIBS=ON"
+                   "-DKokkos_ENABLE_SERIAL=ON"
+                   "-DKokkos_ENABLE_TESTS=ON"
+                   "-DKokkos_ENABLE_EXAMPLES=ON"
+                   "-DKokkos_ENABLE_HWLOC=ON"
+                   "-DKokkos_ENABLE_MEMKIND=ON")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'install-license-files 'remove-cruft
+                 (lambda _
+                   (delete-file
+                    (string-append #$output "/share/doc/"
+                                   #$name "-" #$version
+                                   "/LICENSE_FILE_HEADER")))))))
+    (native-inputs
+     (list googletest python))
+    (inputs
+     (list `(,hwloc "lib") memkind))
+    (home-page "https://github.com/kokkos/kokkos")
+    (synopsis "C++ abstractions for parallel execution and data management")
+    (description
+     "Kokkos Core implements a programming model in C++ for writing performance
+portable applications targeting all major HPC platforms.  For that purpose it
+provides abstractions for both parallel execution of code and data management.
+Kokkos is designed to target complex node architectures with N-level memory
+hierarchies and multiple types of execution resources.")
+    (license license:asl2.0))) ; With LLVM exception
+
 ;; Private Trilinos package for dealii-openmpi (similar to
 ;; trilinos-serial-xyce and trilinos-parallel-xyce).
 ;; This version is the latest known to be compatible with deal.II [1].