GNU bug report logs - #66516
[PATCH 0/2] gnu: dealii: Update to 9.5.1.

Previous Next

Package: guix-patches;

Reported by: "Paul A. Patience" <paul <at> apatience.com>

Date: Fri, 13 Oct 2023 12:35:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66516 in the body.
You can then email your comments to 66516 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#66516; Package guix-patches. (Fri, 13 Oct 2023 12:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Paul A. Patience" <paul <at> apatience.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 13 Oct 2023 12:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Paul A. Patience" <paul <at> apatience.com>
To: guix-patches <at> gnu.org
Cc: "Paul A. Patience" <paul <at> apatience.com>
Subject: [PATCH 0/2] gnu: dealii: Update to 9.5.1.
Date: Fri, 13 Oct 2023 12:33:17 +0000
Hi,

The prerequisite-patch-id refers to the Trilinos build fix [1], which is not
strictly required (dealii-openmpi will just not build without it).

Unfortunately, I am flummoxed by the unset-cpath phase's fixing the build with
Kokkos.

[1]: https://bugs.gnu.org/66462

Paul A. Patience (2):
  gnu: Add kokkos.
  gnu: dealii: Update to 9.5.1.

 gnu/packages/maths.scm | 79 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 74 insertions(+), 5 deletions(-)


base-commit: f4e8baf3806e79d7111d2943859865ae4ee0b59d
prerequisite-patch-id: 15b686dd7cb363b42432fb9bc83701cd33bed641
-- 
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#66516; Package guix-patches. (Fri, 13 Oct 2023 12:37:03 GMT) Full text and rfc822 format available.

Message #8 received at 66516 <at> debbugs.gnu.org (full text, mbox):

From: "Paul A. Patience" <paul <at> apatience.com>
To: 66516 <at> debbugs.gnu.org
Cc: "Paul A. Patience" <paul <at> apatience.com>
Subject: [PATCH 1/2] gnu: Add kokkos.
Date: Fri, 13 Oct 2023 12:35:37 +0000
* gnu/packages/maths.scm (kokkos): New variable.
---
 gnu/packages/maths.scm | 51 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

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].
-- 
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#66516; Package guix-patches. (Fri, 13 Oct 2023 12:37:03 GMT) Full text and rfc822 format available.

Message #11 received at 66516 <at> debbugs.gnu.org (full text, mbox):

From: "Paul A. Patience" <paul <at> apatience.com>
To: 66516 <at> debbugs.gnu.org
Cc: "Paul A. Patience" <paul <at> apatience.com>
Subject: [PATCH 2/2] gnu: dealii: Update to 9.5.1.
Date: Fri, 13 Oct 2023 12:35:45 +0000
* gnu/packages/maths.scm (dealii): Update to 9.5.1.
[propagated-inputs]: Add kokkos.
[arguments]<#:phases>: Add 'unset-cpath' phase.
(dealii-openmpi)[propagated-inputs]: Remove kokkos.
[arguments]<#:phases>: Delete 'unset-cpath' phase.
---
 gnu/packages/maths.scm | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2762e13a4f..e8d3cfed99 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -6613,17 +6613,17 @@ (define trilinos-for-dealii-openmpi
 (define-public dealii
   (package
     (name "dealii")
-    (version "9.4.0")
+    (version "9.5.1")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/dealii/dealii/releases/"
                            "download/v" version "/dealii-" version ".tar.gz"))
        (sha256
-        (base32 "0v73q6f35f2yrjihaq6vh9lma07qc4cdv75nwmc3c5yrdh07g1i3"))
+        (base32 "0phgcfnil4rb41xipsdbm4lxrymlqxbiccakg3pkm3a8wqsva658"))
        (modules '((guix build utils)))
        (snippet
-        ;; Remove bundled boost, muparser, TBB and UMFPACK.
+        ;; Remove bundled boost, Kokkos, muparser, TBB and UMFPACK.
         #~(delete-file-recursively "bundled"))))
     (build-system cmake-build-system)
     (outputs '("out" "doc"))
@@ -6647,6 +6647,7 @@ (define-public dealii
      ;; the requisite interpreter to its native inputs.
      (list boost
            hdf5
+           kokkos
            suitesparse                  ; For UMFPACK.
            sundials
            tbb))
@@ -6671,6 +6672,18 @@ (define-public dealii
                                     "/examples")))
            #:phases
            #~(modify-phases %standard-phases
+               ;; Without unsetting CPATH, the build fails with the following
+               ;; error (similar to <https://bugs.gnu.org/30756>):
+               ;;
+               ;;   /gnu/store/…-gcc-11.3.0/include/c++/math.h:30:16: fatal error: math.h: No such file or directory
+               ;;      30 | # include_next <math.h>
+               ;;         |                ^~~~~~~~
+               ;;
+               ;; Why does unsetting CPATH magically fix the error?
+               ;; TODO: Properly fix this issue.
+               (add-after 'set-paths 'unset-cpath
+                 (lambda _
+                   (unsetenv "CPATH")))
                (add-after 'install 'remove-build-logs
                  ;; These build logs leak the name of the build directory by
                  ;; storing the values of CMAKE_SOURCE_DIR and
@@ -6702,7 +6715,7 @@ (define-public dealii-openmpi
                 scalapack)))
     (propagated-inputs
      (modify-inputs (package-propagated-inputs dealii)
-       (delete "hdf5" "sundials")
+       (delete "hdf5" "kokkos" "sundials")
        (prepend hdf5-parallel-openmpi
                 openmpi
                 p4est-openmpi
@@ -6713,7 +6726,12 @@ (define-public dealii-openmpi
     (arguments
      (substitute-keyword-arguments (package-arguments dealii)
        ((#:configure-flags flags)
-        #~(cons "-DDEAL_II_WITH_MPI=ON" #$flags))))
+        #~(cons "-DDEAL_II_WITH_MPI=ON" #$flags))
+       ((#:phases phases #~%standard-phases)
+        #~(modify-phases #$phases
+            ;; The build failure fixed by this phase does not manifest when
+            ;; Kokkos is included via Trilinos.
+            (delete 'unset-cpath)))))
     (synopsis "Finite element library (with MPI support)")))
 
 (define-public flann
-- 
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#66516; Package guix-patches. (Fri, 13 Oct 2023 14:29:01 GMT) Full text and rfc822 format available.

Message #14 received at 66516 <at> debbugs.gnu.org (full text, mbox):

From: "Paul A. Patience" <paul <at> apatience.com>
To: 66516 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: Add kokkos.
Date: Fri, 13 Oct 2023 14:27:24 +0000
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





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 14 Oct 2023 20:41:02 GMT) Full text and rfc822 format available.

Notification sent to "Paul A. Patience" <paul <at> apatience.com>:
bug acknowledged by developer. (Sat, 14 Oct 2023 20:41:02 GMT) Full text and rfc822 format available.

Message #19 received at 66516-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: "Paul A. Patience" <paul <at> apatience.com>
Cc: 66516-done <at> debbugs.gnu.org
Subject: Re: [bug#66516] [PATCH 0/2] gnu: dealii: Update to 9.5.1.
Date: Sat, 14 Oct 2023 22:39:32 +0200
"Paul A. Patience" <paul <at> apatience.com> skribis:

> The prerequisite-patch-id refers to the Trilinos build fix [1], which is not
> strictly required (dealii-openmpi will just not build without it).
>
> Unfortunately, I am flummoxed by the unset-cpath phase's fixing the build with
> Kokkos.

Yeah, #include_next is super sensitive to CPATH and duplicated entries
therein, so I’m unfortunately not surprised.

>   gnu: Add kokkos.
>   gnu: dealii: Update to 9.5.1.

Applied, and I moved Kokkos to cpp.scm as you suggested.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 12 Nov 2023 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.