From patchwork Fri Jul 4 10:10:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Garlick X-Patchwork-Id: 43235 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 90BDF27BC4A; Fri, 4 Jul 2025 13:35:45 +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 6EB3927BC49 for ; Fri, 4 Jul 2025 13:35:43 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXfdd-0001Uw-QO; Fri, 04 Jul 2025 08:35:33 -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 1uXfdA-0001Cw-CI for guix-patches@gnu.org; Fri, 04 Jul 2025 08:35:05 -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 1uXfd9-0004SN-QQ for guix-patches@gnu.org; Fri, 04 Jul 2025 08:35: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:Subject; bh=LbzIpTqNAuYPHV+/BRrEl/QoE+0geilXNU3khqD1cAo=; b=JJVHVC21XgjUXxApsgcA0HWQ5/GooTKYTRmL7EBVc3ARIPwsX2fudKYcVI115BeJX3ustn17CWV7jNlGBeagaKtWb6WLPzExARub+w75JKMwrXmBa4Gz8Tk6hKQZizR04l7vHUhxhrPLqq5wuVE6612NDN3Iqtis4+wTxcdoLgKok0DwsohjkmpMlV57Os63PEhXIpoGhQ5erPm0ZY9b4a2LfN35FwsOYBS+l+E34SgnBMMYGswui+xC4LV3Q0k/N8m8qeX2Hb7RvsZWNA804vdBw/IwNFFJtNfPHzu4I1b7qTBBAunIe/gUJ5HpxYjKXXogVVSoZas+IN5oZjI+sA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uXfd8-0007W3-Tr for guix-patches@gnu.org; Fri, 04 Jul 2025 08:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78954] [PATCH] gnu: fenics: Fix build. Resent-From: Paul Garlick Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 04 Jul 2025 12:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78954 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78954@debbugs.gnu.org Cc: Paul Garlick X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175163248728775 (code B ref -1); Fri, 04 Jul 2025 12:35:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Jul 2025 12:34:47 +0000 Received: from localhost ([127.0.0.1]:59085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uXfck-0007Sb-26 for submit@debbugs.gnu.org; Fri, 04 Jul 2025 08:34:47 -0400 Received: from lists.gnu.org ([2001:470:142::17]:50882) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uXfce-0007Ql-NL for submit@debbugs.gnu.org; Fri, 04 Jul 2025 08:34:35 -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 1uXfcW-0000vW-1Q for guix-patches@gnu.org; Fri, 04 Jul 2025 08:34:25 -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 1uXfcQ-0004MN-Vj for guix-patches@gnu.org; Fri, 04 Jul 2025 08:34:23 -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=LbzIpTqNAuYPHV+/BRrEl/QoE+0geilXNU3khqD1cAo=; b=jXrYiwSJj6xqpCkAMDbM1VHHhy OJOs2cOqTQRvUxL/o9/r0hcXbiyJ8wxG47rH1WKLAxR23/+/jrKQOHGQ5j5i/vj3YsUmJhdXA8egx bXniYExQOKpkXncNSrx6n5G3kmrE4IuNn1DMKw5LvVa1zY1STFMUONvcNx+gDBnF/qf8=; 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 1uXdNc-000000004O2-3AnI; Fri, 04 Jul 2025 11:10:53 +0100 From: Paul Garlick Date: Fri, 4 Jul 2025 11:10:21 +0100 Message-Id: <20250704101021.3534721-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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_CERTIFIED_BLOCKED=0.218, RCVD_IN_VALIDITY_RPBL_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/simulation.scm (fenics): Run guix style, improve formatting. [arguments] : Remove test module references to expired numpy aliases in the 'pre-check' phase. Use '--deselect' instead of '--ignore' to skip a test in the 'check' phase. Add a FIXME note to enable reading and writing files in the binary HDF5 format. --- gnu/packages/simulation.scm | 196 ++++++++++++++++++------------------ 1 file changed, 99 insertions(+), 97 deletions(-) diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm index e6f86fb736..7d7668f117 100644 --- a/gnu/packages/simulation.scm +++ b/gnu/packages/simulation.scm @@ -917,108 +917,110 @@ (define-public fenics (list fenics-dolfin python-petsc4py python-slepc4py - - ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time. + ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at runtime. python-pkgconfig)) (arguments - (list #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'relax-requirements - (lambda _ - (substitute* "python/setup.py" - (("pybind11==") - "pybind11>=")))) - (add-after 'unpack 'set-dolfin-pc-file-name - (lambda* (#:key inputs #:allow-other-keys) - ;; Instead of cluttering the user's 'PKG_CONFIG_PATH' environment - ;; variable, hard-code the 'dolfin.pc' absolute file name. - (let ((pc-file (search-input-file inputs - "/lib/pkgconfig/dolfin.pc"))) - (substitute* "python/dolfin/jit/jit.py" - (("pkgconfig\\.parse\\(\"dolfin\"\\)") - (string-append "pkgconfig.parse(\"" pc-file - "\")")))))) - (add-after 'patch-source-shebangs 'set-paths - (lambda _ - ;; Define paths to store locations. - (setenv "PYBIND11_DIR" #$(this-package-input "pybind11")) - ;; Move to python sub-directory. - (chdir "python"))) - (add-after 'build 'mpi-setup - #$%openmpi-setup) - (add-before 'check 'pre-check - (lambda _ - ;; Exclude three tests that generate - ;; 'NotImplementedError' in matplotlib version 3.1.2. - ;; See - ;; . - ;; Also exclude tests that require meshes supplied by - ;; git-lfs. - (substitute* "demo/test.py" - (("(.*stem !.*)" line) - (string-append line - "\n" - "excludeList = [\n" - "'built-in-meshes', \n" - "'hyperelasticity', \n" - "'elasticity', \n" - "'multimesh-quadrature', \n" - "'multimesh-marking', \n" - "'mixed-poisson-sphere', \n" - "'mesh-quality', \n" - "'lift-drag', \n" - "'elastodynamics', \n" - "'dg-advection-diffusion', \n" - "'curl-curl', \n" - "'contact-vi-tao', \n" - "'contact-vi-snes', \n" - "'collision-detection', \n" - "'buckling-tao', \n" - "'auto-adaptive-navier-stokes', \n" - "'advection-diffusion', \n" - "'subdomains', \n" - "'stokes-taylor-hood', \n" - "'stokes-mini', \n" - "'navier-stokes', \n" - "'eigenvalue']\n" - "demos = [" - "d for d in demos if d[0].stem not in " - "excludeList]\n"))) - (setenv "HOME" - (getcwd)) - ;; Restrict OpenBLAS to MPI-only in preference to MPI+OpenMP. - (setenv "OPENBLAS_NUM_THREADS" "1"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (with-directory-excursion "test" - (invoke "pytest" - "unit" - ;; The test test_snes_set_from_options() in the file - ;; unit/nls/test_PETScSNES_solver.py fails and is ignored. - "--ignore" - "unit/nls/test_PETScSNES_solver.py" - ;; Fails with a segfault. - "--ignore" - "unit/io/test_XDMF.py"))))) - (add-after 'install 'install-demo-files - (lambda* (#:key outputs #:allow-other-keys) - (let* ((demos (string-append (assoc-ref outputs "out") - "/share/python-dolfin/demo"))) - (mkdir-p demos) - (with-directory-excursion "demo" - (for-each (lambda (file) - (let* ((dir (dirname file)) - (tgt-dir (string-append - demos "/" dir))) - (unless (equal? "." dir) - (mkdir-p tgt-dir) - (install-file file tgt-dir)))) - (find-files "." ".*\\.(py|gz|xdmf)$"))))))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'relax-requirements + (lambda _ + (substitute* "python/setup.py" + (("pybind11==") "pybind11>=")))) + (add-after 'unpack 'set-dolfin-pc-file-name + (lambda* (#:key inputs #:allow-other-keys) + ;; Instead of cluttering the user's PKG_CONFIG_PATH environment + ;; variable, hard-code the 'dolfin.pc' absolute file name. + (let ((pc-file (search-input-file inputs + "/lib/pkgconfig/dolfin.pc"))) + (substitute* "python/dolfin/jit/jit.py" + (("pkgconfig\\.parse\\(\"dolfin\"\\)") + (string-append "pkgconfig.parse(\"" pc-file "\")")))))) + (add-after 'patch-source-shebangs 'set-paths + (lambda _ + ;; Define paths to store locations. + (setenv "PYBIND11_DIR" #$(this-package-input "pybind11")) + ;; Move to python sub-directory. + (chdir "python"))) + (add-after 'build 'mpi-setup + #$%openmpi-setup) + (add-before 'check 'pre-check + (lambda _ + ;; Exclude three tests that generate 'NotImplementedError' in + ;; matplotlib v3.1.2. See + ;; . + ;; Also exclude tests that require meshes supplied by git-lfs. + (substitute* "demo/test.py" + (("(.*stem !.*)" line) + (string-append line + "\n" + "excludeList = [\n" + "'built-in-meshes', \n" + "'hyperelasticity', \n" + "'elasticity', \n" + "'multimesh-quadrature', \n" + "'multimesh-marking', \n" + "'mixed-poisson-sphere', \n" + "'mesh-quality', \n" + "'lift-drag', \n" + "'elastodynamics', \n" + "'dg-advection-diffusion', \n" + "'curl-curl', \n" + "'contact-vi-tao', \n" + "'contact-vi-snes', \n" + "'collision-detection', \n" + "'buckling-tao', \n" + "'auto-adaptive-navier-stokes', \n" + "'advection-diffusion', \n" + "'subdomains', \n" + "'stokes-taylor-hood', \n" + "'stokes-mini', \n" + "'navier-stokes', \n" + "'eigenvalue']\n" + "demos = [" + "d for d in demos if d[0].stem not " + "in excludeList]\n"))) + ;; Do not test for expired numpy aliases. + (substitute* "test/unit/la/test_vector.py" + ((" numpy.float\\(42.0\\),") "") + (("^.*numpy.int\\(42.0\\).*$") "")) + (substitute* "test/unit/la/test_la_basic.py" + ((" int,") " ") + (("\\[int,") "[")) + (setenv "HOME" (getcwd)) + ;; Restrict OpenBLAS to MPI-only in preference to MPI+OpenMP. + (setenv "OPENBLAS_NUM_THREADS" "1"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "test" + (invoke "pytest" + "unit" + ;; This test fails and is ignored. + "--deselect" + "unit/nls/test_PETScSNES_solver.py::test_snes_set_from_options" + ;; FIXME: Tests with binary encoded hdf5 files fail with a + ;; segfault. See fenics-project DOLFIN commit 6fbc9fb. + "--ignore" + "unit/io/test_XDMF.py"))))) + (add-after 'install 'install-demo-files + (lambda* (#:key outputs #:allow-other-keys) + (let* ((demos (string-append (assoc-ref outputs "out") + "/share/python-dolfin/demo"))) + (mkdir-p demos) + (with-directory-excursion "demo" + (for-each (lambda (file) + (let* ((dir (dirname file)) + (tgt-dir (string-append demos + "/" dir))) + (unless (equal? "." dir) + (mkdir-p tgt-dir) + (install-file file tgt-dir)))) + (find-files "." ".*\\.(py|gz|xdmf)$"))))))))) (home-page "https://fenicsproject.org/") (synopsis "High-level environment for solving differential equations") (description - "@code{fenics} is a computing platform for solving general classes of + "@code{fenics} is a computing platform for solving general classes of problems that involve differential equations. @code{fenics} facilitates access to efficient methods for dealing with ordinary differential equations (ODEs) and partial differential equations (PDEs). Systems of