From patchwork Tue Apr 29 13:07:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andreas Enge X-Patchwork-Id: 42140 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 E5CF027BC49; Tue, 29 Apr 2025 14:15:14 +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=ham 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 BA71D27BC49 for ; Tue, 29 Apr 2025 14:15:13 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9knl-0000AW-Sl; Tue, 29 Apr 2025 09:15:09 -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 1u9kni-00009u-80 for guix-patches@gnu.org; Tue, 29 Apr 2025 09:15:07 -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 1u9kng-0003t3-S6 for guix-patches@gnu.org; Tue, 29 Apr 2025 09:15:05 -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:References:In-Reply-To:Date:From:To:Subject; bh=h9OjskrZnoiz0tsVWLr4dt55VEEYcO0uKb0Ys8oIBK0=; b=j0sdFlDP0kUdtDoXgeNHxVZBTB3CYw8LsQe7K3DMzBp47b92Jk1QARCFrhGZvEmQBZmONkn4YiVnAqj+aHcy+eI169+1RIjYviuxdFPENVQn4Wee1S3iptMKkznnlQ9rUcD6URxt4Jjyv7V9geQzzkOoVpAlgJVnYZWvExKg0ByuXfSee4/bnKkBXOdgZ2lydKH3VaKuOrMFYvUKidpM+w62ivE85XnSYxx0zBylB68VtF1kqiwUdpK0gfRZ7mUF1ll9FUbvZB5WGmP1lyLaBEkZW68gtoznoZYFnsBaZDR1hwb95m1Yh64cbsYD7vOXgKpN9iybzDQw/ABkjFeWrQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u9knd-0005eO-TN; Tue, 29 Apr 2025 09:15:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77590] [PATCH v5 1/5] gnu: hdf5: Update to 1.14.6. Resent-From: Andreas Enge Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, bavier@posteo.net, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 29 Apr 2025 13:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77590 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77590@debbugs.gnu.org Cc: David Elsing , Andreas Enge , Andreas Enge , Eric Bavier , Sharlatan Hellseher X-Debbugs-Original-Xcc: Andreas Enge , Eric Bavier , Sharlatan Hellseher Received: via spool by 77590-submit@debbugs.gnu.org id=B77590.174593244721328 (code B ref 77590); Tue, 29 Apr 2025 13:15:01 +0000 Received: (at 77590) by debbugs.gnu.org; 29 Apr 2025 13:14:07 +0000 Received: from localhost ([127.0.0.1]:53406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9kmd-0005WG-SL for submit@debbugs.gnu.org; Tue, 29 Apr 2025 09:14:06 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:46428) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9kmH-0005Rk-31 for 77590@debbugs.gnu.org; Tue, 29 Apr 2025 09:13:47 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id D28576F7; Tue, 29 Apr 2025 15:13:29 +0200 (CEST) Authentication-Results: hera.aquilenet.fr; none X-Virus-Scanned: Debian amavis at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id SDajZNF1LPjt; Tue, 29 Apr 2025 15:13:26 +0200 (CEST) Received: from jurong.lan (176-179-191-150.abo.bbox.fr [176.179.191.150]) by hera.aquilenet.fr (Postfix) with ESMTPSA id B29DA206; Tue, 29 Apr 2025 15:13:24 +0200 (CEST) From: Andreas Enge Date: Tue, 29 Apr 2025 15:07:52 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: D28576F7 X-Spamd-Result: default: False [7.90 / 15.00]; SPAM_FLAG(5.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_SPAM(3.00)[1.000]; FORGED_RECIPIENTS(2.00)[m:andreas@enge.fr,s:andreas.enge@aquilenet.fr]; MID_CONTAINS_FROM(1.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[] X-Spamd-Bar: +++++++ X-Rspamd-Action: add header X-Rspamd-Server: hera X-Spam: Yes 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 From: David Elsing * gnu/packages/maths.scm (hdf5): Update to 1.14.6. Do not inherit from hdf5-1.8. [name, version]: New field. [source]: Switch to git-fetch. Add modules and snippet fields. Use different patch file. [build-system]: New field. Use CMake. [inputs]: New field. [native-inputs]: New field. Add bison, flex and which. [arguments]: Do not inherit from hdf5-1.8. <#:configure-flags>: New field. <#:phases>: New field. Use gexps. Remove 'patch-configure, 'patch-settings, 'patch-references, 'split, 'skip-version-test and 'patch-configure-build-settings phases. Add 'make-gen-deterministic, 'generate-flexbison, 'patch-trace-shebang, 'fix-fortran-i686-test and 'generate-headers phases. [home-page, synopsis, description]: New fields. [license]: New field. Adjust URL. * gnu/packages/patches/hdf5-config-dependencies.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Signed-off-by: Andreas Enge --- gnu/local.mk | 1 + gnu/packages/maths.scm | 193 +++++++++++++----- .../patches/hdf5-config-dependencies.patch | 31 +++ 3 files changed, 171 insertions(+), 54 deletions(-) create mode 100644 gnu/packages/patches/hdf5-config-dependencies.patch diff --git a/gnu/local.mk b/gnu/local.mk index cc57222a91..78b3a03b07 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1574,6 +1574,7 @@ dist_patch_DATA = \ %D%/packages/patches/hdf4-reproducibility.patch \ %D%/packages/patches/hdf4-shared-fortran.patch \ %D%/packages/patches/hdf5-config-date.patch \ + %D%/packages/patches/hdf5-config-dependencies.patch \ %D%/packages/patches/hdf-eos2-build-shared.patch \ %D%/packages/patches/hdf-eos2-remove-gctp.patch \ %D%/packages/patches/hdf-eos2-fortrantests.patch \ diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index bb2b401dd2..a2dd515dc4 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -62,7 +62,7 @@ ;;; Copyright © 2022 Roman Scherer ;;; Copyright © 2023 Jake Leporte ;;; Copyright © 2023 Camilo Q.S. (Distopico) -;;; Copyright © 2023 David Elsing +;;; Copyright © 2023, 2025 David Elsing ;;; Copyright © 2024 Herman Rimm ;;; Copyright © 2024 Foundation Devices, Inc. ;;; Copyright © 2024, 2025 Artyom V. Poptsov @@ -139,6 +139,7 @@ (define-module (gnu packages maths) #:use-module (gnu packages gettext) #:use-module (gnu packages gcc) #:use-module (gnu packages gd) + #:use-module (gnu packages geo) #:use-module (gnu packages ghostscript) #:use-module (gnu packages glib) #:use-module (gnu packages gperf) @@ -1836,44 +1837,141 @@ (define-public hdf5-1.10 (base32 "14gih7kmjx4h3lc7pg4fwcl28hf1qqkf2x7rljpxqvzkjrqbxi00")) (patches (search-patches "hdf5-config-date.patch")))))) -;; When updating this package, please also update hdf-java. (define-public hdf5 (package - (inherit hdf5-1.8) - (version "1.14.3") + (name "hdf5") + (version "1.14.6") (source (origin - (method url-fetch) - (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/" - "hdf5-" (version-major+minor version) - "/hdf5-" version "/src/hdf5-" - version ".tar.bz2") - (string-append "https://support.hdfgroup.org/ftp/HDF5/" - "current" - (apply string-append - (take (string-split version #\.) 2)) - "/src/hdf5-" version ".tar.bz2"))) + (method git-fetch) + (uri (git-reference + (url "https://github.com/HDFGroup/hdf5") + (commit (string-append "hdf5_" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "05zr11y3bivfwrbvzbky1q2gjf6r7n92cvvdnh5jilbmxljg49cl")) - (patches (search-patches "hdf5-config-date.patch")))) + (base32 + "1f7yv0xra465c3qy8c79fzddib653wzj5dsakb0bs02nwp3xm54q")) + (modules '((guix build utils))) + (snippet + '(for-each + delete-file + (append + (find-files "." "Makefile\\.in$") + (find-files "java/lib" "\\.jar$") + (list "aclocal.m4" + "bin/compile" + "bin/config.guess" + "bin/config.sub" + "bin/depcomp" + "bin/install-sh" + "bin/ltmain.sh" + "bin/missing" + "bin/test-driver" + "configure" + "HDF5Examples/aclocal.m4" + "HDF5Examples/compile" + "HDF5Examples/configure" + "HDF5Examples/depcomp" + "HDF5Examples/missing" + "HDF5Examples/test-driver" + "hl/src/H5LTanalyze.c" + "hl/src/H5LTparse.c" + "hl/src/H5LTparse.h" + "hl/tools/gif2h5/testfiles/ex_image2.h5" + "hl/tools/gif2h5/testfiles/h52giftst.h5" + "m4/ax_prog_doxygen.m4" + "m4/libtool.m4" + "m4/lt~obsolete.m4" + "m4/ltoptions.m4" + "m4/ltsugar.m4" + "m4/ltversion.m4" + "src/H5config.h.in" + "src/H5Edefin.h" + "src/H5Einit.h" + "src/H5Epubgen.h" + "src/H5Eterm.h" + "src/H5overflow.h" + "src/H5version.h")))) + (patches (search-patches "hdf5-config-dependencies.patch")))) + (build-system cmake-build-system) (arguments - (substitute-keyword-arguments (package-arguments hdf5-1.8) - ((#:phases phases #~%standard-phases) - #~(modify-phases #$phases - (add-after 'configure 'skip-version-test - (lambda _ - ;; Skip test_check_version since the 'patch-settings' phase - ;; modifies the test reference. - (substitute* "test/test_check_version.sh.in" - (("TESTING\\(\\).*" all) - (string-append all "\nSKIP; exit 0\n"))))) - (add-after 'patch-configure 'patch-configure-build-settings - (lambda _ - (substitute* "src/H5build_settings.autotools.c.in" - ;; Don't record the build-time kernel version to make the - ;; library file reproducible. - (("@UNAME_INFO@") - "Linux")))))))))) + (list + ;; Some of the users, notably Flann, need the C++ interface. + #:configure-flags + #~(list + (string-append "-DHDF5_INSTALL_CMAKE_DIR=" #$output "/lib/cmake") + "-DHDF5_BUILD_CPP_LIB=ON" + "-DHDF5_BUILD_FORTRAN=ON" + ;; Build a thread-safe library. Unfortunately, CMakeLists.txt + ;; invites you to either turn off C++, Fortran, and the high-level + ;; interface (HL), or to enable 'ALLOW_UNSUPPORTED'. Debian + ;; packagers chose to pass '--enable-unsupported' to the 'configure' + ;; script and we follow their lead here. + "-DHDF5_ENABLE_THREADSAFE=ON" + "-DALLOW_UNSUPPORTED=ON" + "-DHDF5_BUILD_DOC=ON") + #:phases + #~(modify-phases %standard-phases + ;; XXX: src/H5private.h includes and fails to find the + ;; stdlib types when the gfortran header is used. Remove gfortran + ;; from CPLUS_INCLUDE_PATH as a workaround. + (add-after 'set-paths 'hide-gfortran + (lambda _ + (let ((gfortran #$(this-package-native-input "gfortran"))) + (setenv "CPLUS_INCLUDE_PATH" + (string-join + (delete (string-append gfortran "/include/c++") + (string-split (getenv "CPLUS_INCLUDE_PATH") #\:)) + ":"))))) + (add-after 'unpack 'make-gen-deterministic + (lambda _ + (substitute* "bin/make_err" + (("keys %major" all) + (string-append "sort " all)) + (("while.*each \\(%section\\).*") + (string-append + "foreach $sect_name (sort keys %section) {\n" + " $sect_desc = $section{$sect_name};\n"))))) + (add-after 'unpack 'generate-flexbison + (lambda _ + (invoke "bash" "bin/genparser" "hl/src"))) + (add-after 'unpack 'patch-trace-shebang + (lambda _ + (for-each patch-shebang + (find-files "bin" (lambda (file stat) + (executable-file? file)))))) + ;; This is a known issue on i686, see + ;; https://github.com/HDFGroup/hdf5/issues/4926 + (add-after 'unpack 'fix-fortran-i686-test + (lambda _ + (substitute* "fortran/test/tH5R.F90" + (((string-append + "CALL h5rget_obj_name_f\\(C_LOC\\(ref_ptr\\(2\\)\\)," + " \"\", error, name_len=buf_size \\)")) + (string-append + "CALL h5rget_obj_name_f(C_LOC(ref_ptr(2))," + " \"xxxxxxxxxxxxxx\", error, name_len=buf_size)"))))) + (add-after 'unpack 'generate-headers + (lambda _ + (invoke "perl" "bin/make_err" "src/H5err.txt") + (invoke "perl" "bin/make_vers" "src/H5vers.txt") + (invoke "perl" "bin/make_overflow" "src/H5overflow.txt")))))) + (inputs (list libaec zlib)) + (native-inputs + (list bison + doxygen + flex + gfortran + graphviz + ;; Needed to generate some headers and for tests + perl + which)) + (home-page "https://www.hdfgroup.org") + (synopsis "Management suite for extremely large and complex data") + (description "HDF5 is a suite that makes possible the management of +extremely large and complex data collections.") + (license (license:x11-style + "https://support.hdfgroup.org/ftp/HDF5/releases/COPYING.html")))) ;; Keep this in sync with the current hdf5 package. (define-public hdf-java @@ -2077,32 +2175,19 @@ (define-public hdf-eos5 (define-public hdf5-parallel-openmpi (package/inherit hdf5 (name "hdf5-parallel-openmpi") - (inputs - `(("mpi" ,openmpi) - ,@(package-inputs hdf5))) + (inputs (modify-inputs (package-inputs hdf5) + (prepend openmpi))) (arguments (substitute-keyword-arguments (package-arguments hdf5) - ((#:configure-flags flags) - #~(cons "--enable-parallel" - (delete "--enable-cxx" - (delete "--enable-threadsafe" #$flags)))) + ((#:configure-flags _ #f) + ''("-DHDF5_ENABLE_THREADSAFE=OFF" + "-DHDF5_ENABLE_PARALLEL=ON" + "-DHDF5_BUILD_CPP_LIB=OFF" + "-DHDF5_BUILD_DOC=ON")) ((#:phases phases) #~(modify-phases #$phases (add-after 'build 'mpi-setup - #$%openmpi-setup) - (add-before 'check 'patch-tests - (lambda _ - ;; OpenMPI's mpirun will exit with non-zero status if it - ;; detects an "abnormal termination", i.e. any process not - ;; calling MPI_Finalize(). Since the test is explicitly - ;; avoiding MPI_Finalize so as not to have at_exit and thus - ;; H5C_flush_cache from being called, mpirun will always - ;; complain, so turn this test off. - (substitute* "testpar/Makefile" - (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back) - (string-append front back "\n"))) - (substitute* "tools/test/h5diff/testph5diff.sh" - (("/bin/sh") (which "sh"))))))))) + #$%openmpi-setup))))) (synopsis "Management suite for data with parallel IO support"))) (define-public hdf5-blosc diff --git a/gnu/packages/patches/hdf5-config-dependencies.patch b/gnu/packages/patches/hdf5-config-dependencies.patch new file mode 100644 index 0000000000..cf448dac44 --- /dev/null +++ b/gnu/packages/patches/hdf5-config-dependencies.patch @@ -0,0 +1,31 @@ +The installed CMake configuration is missing targets for zlib and +libaec. Taken from +https://github.com/microsoft/vcpkg/blob/e36fe7110deac47a3aff8eda3dcc7cfb894a2ebf/ports/hdf5/hdf5_config.patch + +diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in +index 1a3fb7bbf2..79081ce040 100644 +--- a/config/cmake/hdf5-config.cmake.in ++++ b/config/cmake/hdf5-config.cmake.in +@@ -120,12 +114,22 @@ set (${HDF5_PACKAGE_NAME}_VERSION_MINOR @HDF5_VERSION_MINOR@) + # Don't include targets if this file is being picked up by another + # project which has already built hdf5 as a subproject + #----------------------------------------------------------------------------- ++include(CMakeFindDependencyMacro) + if (NOT TARGET "@HDF5_PACKAGE@") + if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) + include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) ++ elseif (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT) ++ find_dependency(ZLIB) + endif () + if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) + include (@PACKAGE_SHARE_INSTALL_DIR@/@LIBAEC_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) ++ elseif (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT) ++ if (${HDF5_PACKAGE_NAME}_BUILD_STATIC_LIBS) ++ set(libaec_USE_STATIC_LIBS ON) ++ else() ++ set(libaec_USE_STATIC_LIBS OFF) ++ endif() ++ find_dependency(libaec) + endif () + include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + endif ()