From patchwork Fri Jun 27 18:04:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Garlick X-Patchwork-Id: 43227 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 602C127BC4A; Fri, 27 Jun 2025 19:06:26 +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 7027527BC49 for ; Fri, 27 Jun 2025 19:06:24 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVDSg-0007kP-4c; Fri, 27 Jun 2025 14:06:06 -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 1uVDSd-0007kC-Ql for guix-patches@gnu.org; Fri, 27 Jun 2025 14:06:04 -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 1uVDSd-0007Mq-EU for guix-patches@gnu.org; Fri, 27 Jun 2025 14:06:03 -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:In-Reply-To:References:Subject; bh=+rAkVMKh85BwQ1YqX1PR4Qp2x2GL//vnlxncNJDiZpc=; b=Ioz95Sy1Ua018GgZKyPT3aPAAvtRTNLxFJx1asW67EJpCXcSY/BHVJloL37m05PgzX+iRHShyPNb/aDl5Q99Pjtf3BdbE2tEbFWdmO5gRkiFJ5IBSYUf2gFPpYABBQi5qtRU6RRrusSQeYW/YsvWhncXb7ZRkcK1zSAdD2LUEyk8MN7M6oNU5lQaWoV9Cg1PF47xwKkaPUIVRYe+qzeqt4oWlzw/EmqNPNDuuhzOXePrbgU+QHuW4HjoaoO2giDt7Wzcd/o7Q/t/U6o1Byx5lpNZyB23kHv6FM3UvzAhe+ENDEyOaBVx9aQUig5VfN+YzA1A7pqpwnaI5Jo09ivY6Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uVDSc-0007tk-UI for guix-patches@gnu.org; Fri, 27 Jun 2025 14:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78878] [PATCH v2] gnu:fenics-dolfin: Fix build with hdf5@1.14. References: <20250623165849.3076997-1-pgarlick@tourbillion-technology.com> In-Reply-To: <20250623165849.3076997-1-pgarlick@tourbillion-technology.com> Resent-From: Paul Garlick Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Jun 2025 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: andreas@enge.fr, 78878@debbugs.gnu.org Cc: Paul Garlick Received: via spool by 78878-submit@debbugs.gnu.org id=B78878.175104754830254 (code B ref 78878); Fri, 27 Jun 2025 18:06:02 +0000 Received: (at 78878) by debbugs.gnu.org; 27 Jun 2025 18:05:48 +0000 Received: from localhost ([127.0.0.1]:40681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uVDSL-0007rZ-0f for submit@debbugs.gnu.org; Fri, 27 Jun 2025 14:05:47 -0400 Received: from smtp.hosts.co.uk ([85.233.160.19]:65265) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uVDSH-0007qV-8g for 78878@debbugs.gnu.org; Fri, 27 Jun 2025 14:05:43 -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=+rAkVMKh85BwQ1YqX1PR4Qp2x2GL//vnlxncNJDiZpc=; b=mS9AwSaTiQ2FG7KgflEUT0fw4m Vz1zyk+VKG6kIt2R7S6IjXeiijBK+7k8nLnRr+dp2kAYLH4HjesA6kGvTQBBmWyyzySwU8cuHXxSS 7F2S4jFy91Ey8KqvMTzagVQZfzkyQS1iGskDUIXvjJmzb56b5ytDlUdYwfdcEdR/3fQA=; 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 1uVDS9-00000000Acg-2ukZ; Fri, 27 Jun 2025 19:05:34 +0100 From: Paul Garlick Date: Fri, 27 Jun 2025 19:04:29 +0100 Message-Id: <20250627180429.3221612-1-pgarlick@tourbillion-technology.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 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 new patch. * gnu/packages/simulation.scm (fenics-dolfin): Run guix style. [source]: Use new patch. [arguments] : 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 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..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 \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. 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