From patchwork Mon Jun 23 16:58:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Garlick X-Patchwork-Id: 43222 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 68C0F27BC4A; Mon, 23 Jun 2025 18:01:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0266B27BC49 for ; Mon, 23 Jun 2025 18:01:39 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uTkXe-0006bB-Tu; Mon, 23 Jun 2025 13:01:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uTkXW-0006UR-Og for guix-patches@gnu.org; Mon, 23 Jun 2025 13:01:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uTkXW-00015r-FG for guix-patches@gnu.org; Mon, 23 Jun 2025 13:01:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=+EnXwMDqZxFOsck2q2NRrG/DomlvaciMZ5bPxErgrk0=; b=gaeTwI85W5q2/S8C3Jet2ssCHpHj2eNGyOzwQmtR6ywAnGOjALpCad2wUq1IzyWWoE4zz9l/JABKcOXwnoaaUJ7y4qMWhVEWwBcUu9gImCzl4ahRoKb0/Gzus070kfQVnqKqyyNvQNVG4Qy3xXxQJwnxVoTT3ljpwbXUpPnIw6MLKvEtc3rhojuW4H8Uj1sdSm0QLADpeEzlKeYXIVF7XrqFa/c1ENDAwyJrqf07b5MH83c5aS98IRVwRNsai0+isxKYcPc9weMnQoyYu2cS7Do4HAWuGdKAyLBAAhpbr4l0fiJdwOdJfOIuqpcgzSSrumH/A7CnMf4ovIH2Q2X3Sw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uTkXW-0003Gi-5a for guix-patches@gnu.org; Mon, 23 Jun 2025 13:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78878] [PATCH] gnu:fenics-dolfin: Fix build with hdf5@1.14. Resent-From: Paul Garlick Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 Jun 2025 17:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78878@debbugs.gnu.org Cc: Paul Garlick X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175069801011793 (code B ref -1); Mon, 23 Jun 2025 17:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jun 2025 17:00:10 +0000 Received: from localhost ([127.0.0.1]:56843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uTkWa-00033L-B5 for submit@debbugs.gnu.org; Mon, 23 Jun 2025 13:00:09 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58950) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uTkWV-00031T-3B for submit@debbugs.gnu.org; Mon, 23 Jun 2025 13:00:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uTkWM-0005oq-4Y for guix-patches@gnu.org; Mon, 23 Jun 2025 12:59:50 -0400 Received: from smtp.hosts.co.uk ([85.233.160.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uTkWJ-0000TR-7I for guix-patches@gnu.org; Mon, 23 Jun 2025 12:59:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tourbillion-technology.com; s=2025040300; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Content-Type:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=+EnXwMDqZxFOsck2q2NRrG/DomlvaciMZ5bPxErgrk0=; b=0FL20hZPjWBkQJcmHjRnlq3R9G OIM1k2gZwcxLqpnq2pifkgP8hBVmr8oobYIutxVlJF7l1U16AmJWvEwZKRlXfNnKILQOieBGcfVhZ xUROPDKh50DiHs5ytmI5JOq5Hh81eAw/zMOrcuJh5QltpDymAPlb59avoarzlQM0qugg=; Received: from maikeh336.claranet.co.uk ([79.123.23.187] helo=pumpernickel.tourbillion-technology.com) by smtp.hosts.co.uk with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1uTkWC-000000000Vb-8PRV; Mon, 23 Jun 2025 17:59:41 +0100 From: Paul Garlick Date: Mon, 23 Jun 2025 17:58:49 +0100 Message-Id: <20250623165849.3076997-1-pgarlick@tourbillion-technology.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Received-SPF: pass client-ip=85.233.160.19; envelope-from=pgarlick@tourbillion-technology.com; helo=smtp.hosts.co.uk X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 for the Technical Notes. + +See 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 \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 \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