GNU bug report logs - #78878
[PATCH] gnu:fenics-dolfin: Fix build with hdf5@1.14.

Previous Next

Package: guix-patches;

Reported by: Paul Garlick <pgarlick <at> tourbillion-technology.com>

Date: Mon, 23 Jun 2025 17:01:01 UTC

Severity: normal

Tags: patch

Done: Andreas Enge <andreas <at> enge.fr>

To reply to this bug, email your comments to 78878 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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#78878; Package guix-patches. (Mon, 23 Jun 2025 17:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Garlick <pgarlick <at> tourbillion-technology.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 23 Jun 2025 17:01:02 GMT) Full text and rfc822 format available.

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

From: Paul Garlick <pgarlick <at> tourbillion-technology.com>
To: guix-patches <at> gnu.org
Cc: Paul Garlick <pgarlick <at> tourbillion-technology.com>
Subject: [PATCH] gnu:fenics-dolfin: Fix build with hdf5 <at> 1.14.
Date: Mon, 23 Jun 2025 17:58:49 +0100
* gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch: New
  patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/simulation.scm (fenics-dolfin)[source]: Use it.
---
 gnu/local.mk                                  |   1 +
 .../fenics-dolfin-hdf5-version-check.patch    |  26 ++
 gnu/packages/simulation.scm                   | 270 +++++++++---------
 3 files changed, 158 insertions(+), 139 deletions(-)
 create mode 100644 gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c569c327a9..d3a2c81bd7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1288,6 +1288,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/fenics-dolfin-demo-init.patch		\
   %D%/packages/patches/fenics-dolfin-boost.patch		\
   %D%/packages/patches/fenics-dolfin-config-slepc.patch		\
+  %D%/packages/patches/fenics-dolfin-hdf5-version-check.patch	\
   %D%/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch	\
   %D%/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch	\
   %D%/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch	\
diff --git a/gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch b/gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch
new file mode 100644
index 0000000000..6128ed5b3c
--- /dev/null
+++ b/gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch
@@ -0,0 +1,26 @@
+This patch checks the HDF5 API version before selecting the appropriate H5O
+function.  A new function name and an extra argument are required for v1.12
+and above.
+
+See <https://support.hdfgroup.org/documentation/hdf5/latest/api-compat-macros.html> for the Technical Notes.
+
+See <https://bitbucket.org/fenics-project/dolfin/commits/4201e172c88dc51eb8846cb350acbbe23c95246d> for the upstream fix.
+
+--- a/dolfin/io/HDF5Interface.cpp
++++ b/dolfin/io/HDF5Interface.cpp
+@@ -282,8 +282,13 @@
+   }
+ 
+   H5O_info_t object_info;
+-  H5Oget_info_by_name(hdf5_file_handle, group_name.c_str(), &object_info,
+-                      lapl_id);
++  #if H5_VERSION_GE(1, 12, 0)
++    H5Oget_info_by_name3(hdf5_file_handle, group_name.c_str(), &object_info,
++                         H5O_INFO_BASIC, lapl_id);
++  #else
++    H5Oget_info_by_name(hdf5_file_handle, group_name.c_str(), &object_info,
++                        lapl_id);
++  #endif
+ 
+   // Close link access properties
+   status = H5Pclose(lapl_id);
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index ebfe477265..451e305fc8 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -744,143 +744,137 @@ (define-public fenics-dolfin
     (name "fenics-dolfin")
     (version "2019.1.0.post0")
     (source
-      (origin
-        (method url-fetch)
-        (uri (string-append
-              "https://bitbucket.org/fenics-project/dolfin/get/"
-              version ".tar.gz"))
-        (file-name (string-append name "-" version ".tar.gz"))
-        (sha256
-          (base32
-           "1m91hwcq5gfj4qqswp8l8kj58nia48f0n4kq13w0xqj4biq7rla0"))
-        (patches (search-patches "fenics-dolfin-algorithm.patch"
-                                 "fenics-dolfin-demo-init.patch"
-                                 "fenics-dolfin-boost.patch"
-                                 "fenics-dolfin-config-slepc.patch"))
-        (modules '((guix build utils)))
-        (snippet
-         '(begin
-            ;; Make sure we don't use the bundled test framework.
-            (delete-file-recursively "test/unit/cpp/catch")
-            (substitute* "test/unit/cpp/main.cpp"
-              ;; Use standard search paths for 'catch' header file.
-              (("#include.*")
-               "#include <catch.hpp>\n"))
-            (substitute* "test/unit/cpp/CMakeLists.txt"
-              ;; Specify directory to find the header file.
-              (("(^set\\(CATCH_INCLUDE_DIR ).*(/catch\\))" _ front back)
-               (string-append front
-                              "$ENV{CATCH_DIR}/include" back "\n")))))))
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://bitbucket.org/fenics-project/dolfin/get/"
+                           version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1m91hwcq5gfj4qqswp8l8kj58nia48f0n4kq13w0xqj4biq7rla0"))
+       (patches (search-patches "fenics-dolfin-algorithm.patch"
+                                "fenics-dolfin-demo-init.patch"
+                                "fenics-dolfin-boost.patch"
+                                "fenics-dolfin-config-slepc.patch"
+                                "fenics-dolfin-hdf5-version-check.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Make sure we don't use the bundled test framework.
+                   (delete-file-recursively "test/unit/cpp/catch")
+                   (substitute* "test/unit/cpp/main.cpp"
+                     ;; Use standard search paths for 'catch' header file.
+                     (("#include.*")
+                      "#include <catch.hpp>\n"))
+                   (substitute* "test/unit/cpp/CMakeLists.txt"
+                     ;; Specify directory to find the header file.
+                     (("(^set\\(CATCH_INCLUDE_DIR ).*(/catch\\))" _ front back)
+                      (string-append front "$ENV{CATCH_DIR}/include" back "\n")))))))
     (build-system cmake-build-system)
-    (inputs
-     (list openblas
-           boost
-           eigen
-           hdf5-parallel-openmpi
-           libxml2
-           openmpi
-           python-3
-           pt-scotch32
-           suitesparse
-           sundials-openmpi
-           zlib))
-    (native-inputs
-     (list catch-framework pkg-config))
-    (propagated-inputs
-     (list python-fenics-ffc petsc-openmpi slepc-openmpi))
+    (inputs (list openblas
+                  boost
+                  eigen
+                  hdf5-parallel-openmpi
+                  libxml2
+                  openmpi
+                  python-3
+                  pt-scotch32
+                  suitesparse
+                  sundials-openmpi
+                  zlib))
+    (native-inputs (list catch-framework pkg-config))
+    (propagated-inputs (list python-fenics-ffc petsc-openmpi slepc-openmpi))
     (arguments
-     (list #:configure-flags #~`("-DDOLFIN_ENABLE_DOCS:BOOL=OFF"
-                                 "-DDOLFIN_ENABLE_HDF5:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_MPI:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_PARMETIS:BOOL=OFF"
-                                 "-DDOLFIN_ENABLE_SCOTCH:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_SUNDIALS:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_TRILINOS:BOOL=OFF")
-           #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'patch-usr-bin-file 'mpi-setup
-                 #$%openmpi-setup)
-               (add-after 'patch-source-shebangs 'set-paths
-                 (lambda _
-                   ;; Define paths to store locations.
-                   (setenv "BLAS_DIR"
-                           #$(this-package-input "openblas"))
-                   (setenv "CATCH_DIR"
-                           #$(this-package-input "catch"))
-                   (setenv "LAPACK_DIR"
-                           #$(this-package-input "openblas"))
-                   (setenv "PETSC_DIR"
-                           #$(this-package-input "petsc"))
-                   (setenv "SLEPC_DIR"
-                           #$(this-package-input "slepc"))
-                   (setenv "SCOTCH_DIR"
-                           #$(this-package-input "scotch"))
-                   (setenv "SUNDIALS_DIR"
-                           #$(this-package-input "sundials"))
-                   (setenv "UMFPACK_DIR"
-                           #$(this-package-input "suitesparse"))))
-               (add-before 'check 'pre-check
-                 (lambda _
-                   ;; The Dolfin repository uses git-lfs, whereby web links are
-                   ;; substituted for large files.  Guix does not currently support
-                   ;; git-lfs, so only the links are downloaded.  The tests that
-                   ;; require the absent meshes cannot run and are skipped.
-                   ;;
-                   ;; One serial test fails and is skipped.
-                   ;; i) demo_multimesh-stokes_serial:
-                   ;;   Warning: Found no facets matching domain for boundary
-                   ;;   condition.
-                   ;;
-                   ;; One mpi test fails and is skipped.
-                   ;; i) demo_stokes-iterative_mpi:
-                   ;;   The MPI_Comm_rank() function was called before MPI_INIT was
-                   ;;   invoked
-                   (call-with-output-file "CTestCustom.cmake"
-                     (lambda (port)
-                       (display (string-append
-                                 "set(CTEST_CUSTOM_TESTS_IGNORE "
-                                 "demo_bcs_serial "
-                                 "demo_bcs_mpi "
-                                 "demo_eigenvalue_serial "
-                                 "demo_eigenvalue_mpi "
-                                 "demo_navier-stokes_serial "
-                                 "demo_navier-stokes_mpi "
-                                 "demo_stokes-taylor-hood_serial "
-                                 "demo_stokes-taylor-hood_mpi "
-                                 "demo_subdomains_serial "
-                                 "demo_advection-diffusion_serial "
-                                 "demo_advection-diffusion_mpi "
-                                 "demo_auto-adaptive-navier-stokes_serial "
-                                 "demo_contact-vi-snes_serial "
-                                 "demo_contact-vi-snes_mpi "
-                                 "demo_contact-vi-tao_serial "
-                                 "demo_contact-vi-tao_mpi "
-                                 "demo_curl-curl_serial "
-                                 "demo_curl-curl_mpi "
-                                 "demo_dg-advection-diffusion_serial "
-                                 "demo_dg-advection-diffusion_mpi "
-                                 "demo_elasticity_serial "
-                                 "demo_elasticity_mpi "
-                                 "demo_elastodynamics_serial "
-                                 "demo_elastodynamics_mpi "
-                                 "demo_lift-drag_serial "
-                                 "demo_lift-drag_mpi "
-                                 "demo_mesh-quality_serial "
-                                 "demo_mesh-quality_mpi "
-                                 "demo_multimesh-stokes_serial "
-                                 ")\n") port)))))
-               (replace 'check
-                 (lambda* (#:key tests? #:allow-other-keys)
-                   (when tests?
-                     (invoke "make" "unittests")
-                     (invoke "make" "demos")
-                     (invoke "ctest" "-R" "unittests")
-                     (invoke "ctest" "-R" "demo" "-R" "serial")
-                     (invoke "ctest" "-R" "demo" "-R" "mpi")))))))
+     (list
+      #:configure-flags
+      #~`("-DDOLFIN_ENABLE_DOCS:BOOL=OFF" "-DDOLFIN_ENABLE_HDF5:BOOL=ON"
+          "-DDOLFIN_ENABLE_MPI:BOOL=ON"
+          "-DDOLFIN_ENABLE_PARMETIS:BOOL=OFF"
+          "-DDOLFIN_ENABLE_SCOTCH:BOOL=ON"
+          "-DDOLFIN_ENABLE_SUNDIALS:BOOL=ON"
+          "-DDOLFIN_ENABLE_TRILINOS:BOOL=OFF")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'patch-usr-bin-file 'mpi-setup
+            #$%openmpi-setup)
+          (add-after 'patch-source-shebangs 'set-paths
+            (lambda _
+              ;; Define paths to store locations.
+              (setenv "BLAS_DIR"
+                      #$(this-package-input "openblas"))
+              (setenv "CATCH_DIR"
+                      #$(this-package-input "catch"))
+              (setenv "LAPACK_DIR"
+                      #$(this-package-input "openblas"))
+              (setenv "PETSC_DIR"
+                      #$(this-package-input "petsc"))
+              (setenv "SLEPC_DIR"
+                      #$(this-package-input "slepc"))
+              (setenv "SCOTCH_DIR"
+                      #$(this-package-input "scotch"))
+              (setenv "SUNDIALS_DIR"
+                      #$(this-package-input "sundials"))
+              (setenv "UMFPACK_DIR"
+                      #$(this-package-input "suitesparse"))))
+          (add-before 'check 'pre-check
+            (lambda _
+              ;; The Dolfin repository uses git-lfs, whereby web links are
+              ;; substituted for large files.  Guix does not currently support
+              ;; git-lfs, so only the links are downloaded.  The tests that
+              ;; require the absent meshes cannot run and are skipped.
+              ;;
+              ;; One serial test fails and is skipped.
+              ;; i) demo_multimesh-stokes_serial:
+              ;; Warning: Found no facets matching domain for boundary
+              ;; condition.
+              ;;
+              ;; One mpi test fails and is skipped.
+              ;; i) demo_stokes-iterative_mpi:
+              ;; The MPI_Comm_rank() function was called before MPI_INIT was
+              ;; invoked
+              (call-with-output-file "CTestCustom.cmake"
+                (lambda (port)
+                  (display (string-append "set(CTEST_CUSTOM_TESTS_IGNORE "
+                            "demo_bcs_serial "
+                            "demo_bcs_mpi "
+                            "demo_eigenvalue_serial "
+                            "demo_eigenvalue_mpi "
+                            "demo_navier-stokes_serial "
+                            "demo_navier-stokes_mpi "
+                            "demo_stokes-taylor-hood_serial "
+                            "demo_stokes-taylor-hood_mpi "
+                            "demo_subdomains_serial "
+                            "demo_advection-diffusion_serial "
+                            "demo_advection-diffusion_mpi "
+                            "demo_auto-adaptive-navier-stokes_serial "
+                            "demo_contact-vi-snes_serial "
+                            "demo_contact-vi-snes_mpi "
+                            "demo_contact-vi-tao_serial "
+                            "demo_contact-vi-tao_mpi "
+                            "demo_curl-curl_serial "
+                            "demo_curl-curl_mpi "
+                            "demo_dg-advection-diffusion_serial "
+                            "demo_dg-advection-diffusion_mpi "
+                            "demo_elasticity_serial "
+                            "demo_elasticity_mpi "
+                            "demo_elastodynamics_serial "
+                            "demo_elastodynamics_mpi "
+                            "demo_lift-drag_serial "
+                            "demo_lift-drag_mpi "
+                            "demo_mesh-quality_serial "
+                            "demo_mesh-quality_mpi "
+                            "demo_multimesh-stokes_serial "
+                            ")\n") port)))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "make" "unittests")
+                (invoke "make" "demos")
+                (invoke "ctest" "-R" "unittests")
+                (invoke "ctest" "-R" "demo" "-R" "serial")
+                (invoke "ctest" "-R" "demo" "-R" "mpi")))))))
     (home-page "https://bitbucket.org/fenics-project/dolfin/")
     (synopsis "Problem solving environment for differential equations")
     (description
-      "DOLFIN is a computational framework for finding numerical
+     "DOLFIN is a computational framework for finding numerical
 solutions to problems described by differential equations.  Numerical
 models in DOLFIN are constructed using general families of finite
 elements.  Data structures are provided for discretizing the governing
@@ -896,17 +890,15 @@ (define-public fenics-dolfin
     ;; following exceptions:
     ;;
     ;; public-domain: dolfin/geometry/predicates.cpp
-    ;;                dolfin/geometry/predicates.h
+    ;; dolfin/geometry/predicates.h
     ;;
     ;; zlib:          dolfin/io/base64.cpp
-    ;;                dolfin/io/base64.h
+    ;; dolfin/io/base64.h
     ;;
     ;; expat:         dolfin/io/pugiconfig.hpp
-    ;;                dolfin/io/pugixml.cpp
-    ;;                dolfin/io/pugixml.hpp
-    (license (list license:public-domain
-                   license:zlib
-                   license:expat
+    ;; dolfin/io/pugixml.cpp
+    ;; dolfin/io/pugixml.hpp
+    (license (list license:public-domain license:zlib license:expat
                    license:lgpl3+))))
 
 (define-public fenics
-- 
2.39.5





Information forwarded to guix-patches <at> gnu.org:
bug#78878; Package guix-patches. (Wed, 25 Jun 2025 19:37:03 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: Paul Garlick <pgarlick <at> tourbillion-technology.com>
Cc: 78878 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu:fenics-dolfin: Fix build with hdf5 <at> 1.14.
Date: Wed, 25 Jun 2025 21:36:28 +0200
Hello Paul,

thanks a lot for this patch! It looks generally good, but I get one test
failure on my own machine:

      Start 26: demo_stokes-iterative_mpi
13/38 Test #26: demo_stokes-iterative_mpi ..............***Failed  142.07 sec
...
97% tests passed, 1 tests failed out of 38

Total Test time (real) = 1215.38 sec

The following tests FAILED:
         26 - demo_stokes-iterative_mpi (Failed)
Errors while running CTest


It has not yet been built on QA.

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#78878; Package guix-patches. (Fri, 27 Jun 2025 18:06:02 GMT) Full text and rfc822 format available.

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

From: Paul Garlick <pgarlick <at> tourbillion-technology.com>
To: andreas <at> enge.fr,
	78878 <at> debbugs.gnu.org
Cc: Paul Garlick <pgarlick <at> tourbillion-technology.com>
Subject: [PATCH v2] gnu:fenics-dolfin: Fix build with hdf5 <at> 1.14.
Date: Fri, 27 Jun 2025 19:04:29 +0100
* gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch: New
  patch.
* gnu/local.mk (dist_patch_DATA): Register new patch.
* gnu/packages/simulation.scm (fenics-dolfin): Run guix style.
[source]: Use new patch. [arguments] <phases>: Update 'pre-check' comment.
Add 'demo_stokes-iterative_mpi' test to list of skipped tests.
---
 gnu/local.mk                                  |   1 +
 .../fenics-dolfin-hdf5-version-check.patch    |  26 ++
 gnu/packages/simulation.scm                   | 271 +++++++++---------
 3 files changed, 159 insertions(+), 139 deletions(-)
 create mode 100644 gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c569c327a9..d3a2c81bd7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1288,6 +1288,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/fenics-dolfin-demo-init.patch		\
   %D%/packages/patches/fenics-dolfin-boost.patch		\
   %D%/packages/patches/fenics-dolfin-config-slepc.patch		\
+  %D%/packages/patches/fenics-dolfin-hdf5-version-check.patch	\
   %D%/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch	\
   %D%/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch	\
   %D%/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch	\
diff --git a/gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch b/gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch
new file mode 100644
index 0000000000..6128ed5b3c
--- /dev/null
+++ b/gnu/packages/patches/fenics-dolfin-hdf5-version-check.patch
@@ -0,0 +1,26 @@
+This patch checks the HDF5 API version before selecting the appropriate H5O
+function.  A new function name and an extra argument are required for v1.12
+and above.
+
+See <https://support.hdfgroup.org/documentation/hdf5/latest/api-compat-macros.html> for the Technical Notes.
+
+See <https://bitbucket.org/fenics-project/dolfin/commits/4201e172c88dc51eb8846cb350acbbe23c95246d> for the upstream fix.
+
+--- a/dolfin/io/HDF5Interface.cpp
++++ b/dolfin/io/HDF5Interface.cpp
+@@ -282,8 +282,13 @@
+   }
+ 
+   H5O_info_t object_info;
+-  H5Oget_info_by_name(hdf5_file_handle, group_name.c_str(), &object_info,
+-                      lapl_id);
++  #if H5_VERSION_GE(1, 12, 0)
++    H5Oget_info_by_name3(hdf5_file_handle, group_name.c_str(), &object_info,
++                         H5O_INFO_BASIC, lapl_id);
++  #else
++    H5Oget_info_by_name(hdf5_file_handle, group_name.c_str(), &object_info,
++                        lapl_id);
++  #endif
+ 
+   // Close link access properties
+   status = H5Pclose(lapl_id);
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index ebfe477265..e6f86fb736 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -744,143 +744,138 @@ (define-public fenics-dolfin
     (name "fenics-dolfin")
     (version "2019.1.0.post0")
     (source
-      (origin
-        (method url-fetch)
-        (uri (string-append
-              "https://bitbucket.org/fenics-project/dolfin/get/"
-              version ".tar.gz"))
-        (file-name (string-append name "-" version ".tar.gz"))
-        (sha256
-          (base32
-           "1m91hwcq5gfj4qqswp8l8kj58nia48f0n4kq13w0xqj4biq7rla0"))
-        (patches (search-patches "fenics-dolfin-algorithm.patch"
-                                 "fenics-dolfin-demo-init.patch"
-                                 "fenics-dolfin-boost.patch"
-                                 "fenics-dolfin-config-slepc.patch"))
-        (modules '((guix build utils)))
-        (snippet
-         '(begin
-            ;; Make sure we don't use the bundled test framework.
-            (delete-file-recursively "test/unit/cpp/catch")
-            (substitute* "test/unit/cpp/main.cpp"
-              ;; Use standard search paths for 'catch' header file.
-              (("#include.*")
-               "#include <catch.hpp>\n"))
-            (substitute* "test/unit/cpp/CMakeLists.txt"
-              ;; Specify directory to find the header file.
-              (("(^set\\(CATCH_INCLUDE_DIR ).*(/catch\\))" _ front back)
-               (string-append front
-                              "$ENV{CATCH_DIR}/include" back "\n")))))))
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://bitbucket.org/fenics-project/dolfin/get/"
+                           version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1m91hwcq5gfj4qqswp8l8kj58nia48f0n4kq13w0xqj4biq7rla0"))
+       (patches (search-patches "fenics-dolfin-algorithm.patch"
+                                "fenics-dolfin-demo-init.patch"
+                                "fenics-dolfin-boost.patch"
+                                "fenics-dolfin-config-slepc.patch"
+                                "fenics-dolfin-hdf5-version-check.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Make sure we don't use the bundled test framework.
+                   (delete-file-recursively "test/unit/cpp/catch")
+                   (substitute* "test/unit/cpp/main.cpp"
+                     ;; Use standard search paths for 'catch' header file.
+                     (("#include.*")
+                      "#include <catch.hpp>\n"))
+                   (substitute* "test/unit/cpp/CMakeLists.txt"
+                     ;; Specify directory to find the header file.
+                     (("(^set\\(CATCH_INCLUDE_DIR ).*(/catch\\))" _ front back)
+                      (string-append front "$ENV{CATCH_DIR}/include" back "\n")))))))
     (build-system cmake-build-system)
-    (inputs
-     (list openblas
-           boost
-           eigen
-           hdf5-parallel-openmpi
-           libxml2
-           openmpi
-           python-3
-           pt-scotch32
-           suitesparse
-           sundials-openmpi
-           zlib))
-    (native-inputs
-     (list catch-framework pkg-config))
-    (propagated-inputs
-     (list python-fenics-ffc petsc-openmpi slepc-openmpi))
+    (inputs (list openblas
+                  boost
+                  eigen
+                  hdf5-parallel-openmpi
+                  libxml2
+                  openmpi
+                  python-3
+                  pt-scotch32
+                  suitesparse
+                  sundials-openmpi
+                  zlib))
+    (native-inputs (list catch-framework pkg-config))
+    (propagated-inputs (list python-fenics-ffc petsc-openmpi slepc-openmpi))
     (arguments
-     (list #:configure-flags #~`("-DDOLFIN_ENABLE_DOCS:BOOL=OFF"
-                                 "-DDOLFIN_ENABLE_HDF5:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_MPI:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_PARMETIS:BOOL=OFF"
-                                 "-DDOLFIN_ENABLE_SCOTCH:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_SUNDIALS:BOOL=ON"
-                                 "-DDOLFIN_ENABLE_TRILINOS:BOOL=OFF")
-           #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'patch-usr-bin-file 'mpi-setup
-                 #$%openmpi-setup)
-               (add-after 'patch-source-shebangs 'set-paths
-                 (lambda _
-                   ;; Define paths to store locations.
-                   (setenv "BLAS_DIR"
-                           #$(this-package-input "openblas"))
-                   (setenv "CATCH_DIR"
-                           #$(this-package-input "catch"))
-                   (setenv "LAPACK_DIR"
-                           #$(this-package-input "openblas"))
-                   (setenv "PETSC_DIR"
-                           #$(this-package-input "petsc"))
-                   (setenv "SLEPC_DIR"
-                           #$(this-package-input "slepc"))
-                   (setenv "SCOTCH_DIR"
-                           #$(this-package-input "scotch"))
-                   (setenv "SUNDIALS_DIR"
-                           #$(this-package-input "sundials"))
-                   (setenv "UMFPACK_DIR"
-                           #$(this-package-input "suitesparse"))))
-               (add-before 'check 'pre-check
-                 (lambda _
-                   ;; The Dolfin repository uses git-lfs, whereby web links are
-                   ;; substituted for large files.  Guix does not currently support
-                   ;; git-lfs, so only the links are downloaded.  The tests that
-                   ;; require the absent meshes cannot run and are skipped.
-                   ;;
-                   ;; One serial test fails and is skipped.
-                   ;; i) demo_multimesh-stokes_serial:
-                   ;;   Warning: Found no facets matching domain for boundary
-                   ;;   condition.
-                   ;;
-                   ;; One mpi test fails and is skipped.
-                   ;; i) demo_stokes-iterative_mpi:
-                   ;;   The MPI_Comm_rank() function was called before MPI_INIT was
-                   ;;   invoked
-                   (call-with-output-file "CTestCustom.cmake"
-                     (lambda (port)
-                       (display (string-append
-                                 "set(CTEST_CUSTOM_TESTS_IGNORE "
-                                 "demo_bcs_serial "
-                                 "demo_bcs_mpi "
-                                 "demo_eigenvalue_serial "
-                                 "demo_eigenvalue_mpi "
-                                 "demo_navier-stokes_serial "
-                                 "demo_navier-stokes_mpi "
-                                 "demo_stokes-taylor-hood_serial "
-                                 "demo_stokes-taylor-hood_mpi "
-                                 "demo_subdomains_serial "
-                                 "demo_advection-diffusion_serial "
-                                 "demo_advection-diffusion_mpi "
-                                 "demo_auto-adaptive-navier-stokes_serial "
-                                 "demo_contact-vi-snes_serial "
-                                 "demo_contact-vi-snes_mpi "
-                                 "demo_contact-vi-tao_serial "
-                                 "demo_contact-vi-tao_mpi "
-                                 "demo_curl-curl_serial "
-                                 "demo_curl-curl_mpi "
-                                 "demo_dg-advection-diffusion_serial "
-                                 "demo_dg-advection-diffusion_mpi "
-                                 "demo_elasticity_serial "
-                                 "demo_elasticity_mpi "
-                                 "demo_elastodynamics_serial "
-                                 "demo_elastodynamics_mpi "
-                                 "demo_lift-drag_serial "
-                                 "demo_lift-drag_mpi "
-                                 "demo_mesh-quality_serial "
-                                 "demo_mesh-quality_mpi "
-                                 "demo_multimesh-stokes_serial "
-                                 ")\n") port)))))
-               (replace 'check
-                 (lambda* (#:key tests? #:allow-other-keys)
-                   (when tests?
-                     (invoke "make" "unittests")
-                     (invoke "make" "demos")
-                     (invoke "ctest" "-R" "unittests")
-                     (invoke "ctest" "-R" "demo" "-R" "serial")
-                     (invoke "ctest" "-R" "demo" "-R" "mpi")))))))
+     (list
+      #:configure-flags
+      #~`("-DDOLFIN_ENABLE_DOCS:BOOL=OFF" "-DDOLFIN_ENABLE_HDF5:BOOL=ON"
+          "-DDOLFIN_ENABLE_MPI:BOOL=ON"
+          "-DDOLFIN_ENABLE_PARMETIS:BOOL=OFF"
+          "-DDOLFIN_ENABLE_SCOTCH:BOOL=ON"
+          "-DDOLFIN_ENABLE_SUNDIALS:BOOL=ON"
+          "-DDOLFIN_ENABLE_TRILINOS:BOOL=OFF")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'patch-usr-bin-file 'mpi-setup
+            #$%openmpi-setup)
+          (add-after 'patch-source-shebangs 'set-paths
+            (lambda _
+              ;; Define paths to store locations.
+              (setenv "BLAS_DIR"
+                      #$(this-package-input "openblas"))
+              (setenv "CATCH_DIR"
+                      #$(this-package-input "catch"))
+              (setenv "LAPACK_DIR"
+                      #$(this-package-input "openblas"))
+              (setenv "PETSC_DIR"
+                      #$(this-package-input "petsc"))
+              (setenv "SLEPC_DIR"
+                      #$(this-package-input "slepc"))
+              (setenv "SCOTCH_DIR"
+                      #$(this-package-input "scotch"))
+              (setenv "SUNDIALS_DIR"
+                      #$(this-package-input "sundials"))
+              (setenv "UMFPACK_DIR"
+                      #$(this-package-input "suitesparse"))))
+          (add-before 'check 'pre-check
+            (lambda _
+              ;; The Dolfin repository uses git-lfs, whereby web links are
+              ;; substituted for large files.  Only the links are downloaded.
+              ;; The tests that require the absent meshes cannot run and are
+              ;; skipped.
+              ;;
+              ;; One serial test fails and is skipped.
+              ;; i) demo_multimesh-stokes_serial:
+              ;; Warning: Found no facets matching domain for boundary
+              ;; condition.
+              ;;
+              ;; One mpi test fails and is skipped.
+              ;; i) demo_stokes-iterative_mpi:
+              ;; The MPI_Comm_rank() function was called before MPI_INIT was
+              ;; invoked.
+              (call-with-output-file "CTestCustom.cmake"
+                (lambda (port)
+                  (display (string-append "set(CTEST_CUSTOM_TESTS_IGNORE "
+                            "demo_bcs_serial "
+                            "demo_bcs_mpi "
+                            "demo_eigenvalue_serial "
+                            "demo_eigenvalue_mpi "
+                            "demo_navier-stokes_serial "
+                            "demo_navier-stokes_mpi "
+                            "demo_stokes-taylor-hood_serial "
+                            "demo_stokes-taylor-hood_mpi "
+                            "demo_subdomains_serial "
+                            "demo_advection-diffusion_serial "
+                            "demo_advection-diffusion_mpi "
+                            "demo_auto-adaptive-navier-stokes_serial "
+                            "demo_contact-vi-snes_serial "
+                            "demo_contact-vi-snes_mpi "
+                            "demo_contact-vi-tao_serial "
+                            "demo_contact-vi-tao_mpi "
+                            "demo_curl-curl_serial "
+                            "demo_curl-curl_mpi "
+                            "demo_dg-advection-diffusion_serial "
+                            "demo_dg-advection-diffusion_mpi "
+                            "demo_elasticity_serial "
+                            "demo_elasticity_mpi "
+                            "demo_elastodynamics_serial "
+                            "demo_elastodynamics_mpi "
+                            "demo_lift-drag_serial "
+                            "demo_lift-drag_mpi "
+                            "demo_mesh-quality_serial "
+                            "demo_mesh-quality_mpi "
+                            "demo_multimesh-stokes_serial "
+                            "demo_stokes-iterative_mpi"
+                            ")\n") port)))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "make" "unittests")
+                (invoke "make" "demos")
+                (invoke "ctest" "-R" "unittests")
+                (invoke "ctest" "-R" "demo" "-R" "serial")
+                (invoke "ctest" "-R" "demo" "-R" "mpi")))))))
     (home-page "https://bitbucket.org/fenics-project/dolfin/")
     (synopsis "Problem solving environment for differential equations")
     (description
-      "DOLFIN is a computational framework for finding numerical
+     "DOLFIN is a computational framework for finding numerical
 solutions to problems described by differential equations.  Numerical
 models in DOLFIN are constructed using general families of finite
 elements.  Data structures are provided for discretizing the governing
@@ -896,17 +891,15 @@ (define-public fenics-dolfin
     ;; following exceptions:
     ;;
     ;; public-domain: dolfin/geometry/predicates.cpp
-    ;;                dolfin/geometry/predicates.h
+    ;; dolfin/geometry/predicates.h
     ;;
     ;; zlib:          dolfin/io/base64.cpp
-    ;;                dolfin/io/base64.h
+    ;; dolfin/io/base64.h
     ;;
     ;; expat:         dolfin/io/pugiconfig.hpp
-    ;;                dolfin/io/pugixml.cpp
-    ;;                dolfin/io/pugixml.hpp
-    (license (list license:public-domain
-                   license:zlib
-                   license:expat
+    ;; dolfin/io/pugixml.cpp
+    ;; dolfin/io/pugixml.hpp
+    (license (list license:public-domain license:zlib license:expat
                    license:lgpl3+))))
 
 (define-public fenics
-- 
2.39.5





Information forwarded to guix-patches <at> gnu.org:
bug#78878; Package guix-patches. (Fri, 27 Jun 2025 18:19:03 GMT) Full text and rfc822 format available.

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

From: Paul Garlick <pgarlick <at> tourbillion-technology.com>
To: Andreas Enge <andreas <at> enge.fr>
Cc: 78878 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu:fenics-dolfin: Fix build with hdf5 <at> 1.14.
Date: Fri, 27 Jun 2025 19:18:15 +0100
Hello Andreas,

On Wed, 2025-06-25 at 21:36 +0200, Andreas Enge wrote:

> The following tests FAILED:
>          26 - demo_stokes-iterative_mpi (Failed)
> Errors while running CTest

Thanks, I have been able to repeat this failure.

It seems to be intermittent, possibly related to the so-called "static
initialization order fiasco".  Something to investigate on another day,
perhaps.

In the meantime, I have added this test to the list of skipped tests
and re-submitted the patch.

Best regards,

Paul.




Reply sent to Andreas Enge <andreas <at> enge.fr>:
You have taken responsibility. (Sat, 28 Jun 2025 14:39:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Garlick <pgarlick <at> tourbillion-technology.com>:
bug acknowledged by developer. (Sat, 28 Jun 2025 14:39:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: Paul Garlick <pgarlick <at> tourbillion-technology.com>
Cc: 78878-done <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu:fenics-dolfin: Fix build with hdf5 <at> 1.14.
Date: Sat, 28 Jun 2025 16:38:24 +0200
Hello Paul,

Am Fri, Jun 27, 2025 at 07:18:15PM +0100 schrieb Paul Garlick:
> Thanks, I have been able to repeat this failure.
> It seems to be intermittent, possibly related to the so-called "static
> initialization order fiasco".  Something to investigate on another day,
> perhaps.
> In the meantime, I have added this test to the list of skipped tests
> and re-submitted the patch.

that sounds very reasonable, I could build and have pushed the commit.
Thank you for all that work!

Andreas





This bug report was last modified 28 days ago.

Previous Next


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