From patchwork Tue Jun 20 21:31:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 51110 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 DCB4127BBE9; Tue, 20 Jun 2023 22:32:53 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED,URIBL_SBL_A 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 E228D27BBE2 for ; Tue, 20 Jun 2023 22:32:50 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBixg-0003mf-IV; Tue, 20 Jun 2023 17:32:28 -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 1qBixI-0003kG-62 for guix-patches@gnu.org; Tue, 20 Jun 2023 17:32:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBixH-0006ux-Li for guix-patches@gnu.org; Tue, 20 Jun 2023 17:32:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qBixH-0008BB-GZ for guix-patches@gnu.org; Tue, 20 Jun 2023 17:32:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64081] [PATCH v2 2/2] gnu: fenics-dolfin, fenics: Remove input labels. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Jun 2023 21:32:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64081@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 64081-submit@debbugs.gnu.org id=B64081.168729671331377 (code B ref 64081); Tue, 20 Jun 2023 21:32:03 +0000 Received: (at 64081) by debbugs.gnu.org; 20 Jun 2023 21:31:53 +0000 Received: from localhost ([127.0.0.1]:59987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBix5-00089y-TV for submit@debbugs.gnu.org; Tue, 20 Jun 2023 17:31:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBix2-00089V-GH for 64081@debbugs.gnu.org; Tue, 20 Jun 2023 17:31:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBiww-0006s2-V9; Tue, 20 Jun 2023 17:31:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=1kw5fhd1Y1gmJrgHHPJLhzPVPLWMgZy9yhot7feuWEM=; b=Vx3QuqtsL2DS5XNjld00 Fv9jd4rXQEXYbgNq1BUZu6Ly7wtzF7qC+pdGXr5sFRFMiIabBrUaNq+X8qRaofumcj1QAvWkwtDuA cSfbnUWJqM16EraaYtOT8qoksPYntcoLQ63JtkYRGFDwNM9dMEWRP22YZwOa7pICHBbknsDD2+Vcp nPlsrW7TvmbhKFAz5jSomtZwyeAGxmI3cj1G50VGPCHAEdqo7FCJUk6LNmYoSpVa20RyyJ0HeKThf KcitJTtpL0/bMkszPK9fdvEEpkHDz6QkRBsyGXFqsRch5pNvdKgGWYqcMlq3G0EfBJOxSdOqVvD4l DJLokm8QVqlO0Q==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBiww-0004wE-7G; Tue, 20 Jun 2023 17:31:42 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Tue, 20 Jun 2023 23:31:22 +0200 Message-Id: <72671db61955d27d2af7ab391b7bb8482556ce99.1687296647.git.ludo@gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 From: Ludovic Courtès * gnu/packages/simulation.scm (fenics-dolfin)[inputs, native-inputs] [propagated-inputs]: Remove labels. Replace CATCH2-1, which was actually unused, by CATCH-FRAMEWORK. [arguments]: Rewrite using gexps. Adjust 'set-paths' phase accordingly. (fenics): Likewise. --- gnu/packages/simulation.scm | 407 ++++++++++++++++++------------------ 1 file changed, 206 insertions(+), 201 deletions(-) diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm index 9eeb57babe..a4aac0ebf8 100644 --- a/gnu/packages/simulation.scm +++ b/gnu/packages/simulation.scm @@ -569,108 +569,111 @@ (define-public fenics-dolfin "$ENV{CATCH_DIR}/include" back "\n"))))))) (build-system cmake-build-system) (inputs - `(("blas" ,openblas) - ("boost" ,boost) - ("eigen" ,eigen) - ("hdf5" ,hdf5-parallel-openmpi) - ("lapack" ,lapack) - ("libxml2" ,libxml2) - ("openmpi" ,openmpi) - ("python" ,python-3) - ("scotch" ,pt-scotch32) - ("suitesparse" ,suitesparse) - ("sundials" ,sundials-openmpi) - ("zlib" ,zlib))) + (list openblas + boost + eigen + hdf5-parallel-openmpi + lapack + libxml2 + openmpi + python-3 + pt-scotch32 + suitesparse + sundials-openmpi + zlib)) (native-inputs - `(("catch" ,catch2-1) - ("pkg-config" ,pkg-config))) + (list catch-framework pkg-config)) (propagated-inputs - `(("ffc" ,python-fenics-ffc) - ("petsc" ,petsc-openmpi) - ("slepc" ,slepc-openmpi))) + (list python-fenics-ffc petsc-openmpi slepc-openmpi)) (arguments - `(#: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" (assoc-ref %build-inputs "blas")) - (setenv "CATCH_DIR" (assoc-ref %build-inputs "catch")) - (setenv "LAPACK_DIR" (assoc-ref %build-inputs "lapack")) - (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc")) - (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc")) - (setenv "SCOTCH_DIR" (assoc-ref %build-inputs "scotch")) - (setenv "SUNDIALS_DIR" (assoc-ref %build-inputs "sundials")) - (setenv "UMFPACK_DIR" (assoc-ref %build-inputs "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 "lapack")) + (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 @@ -708,112 +711,114 @@ (define-public fenics (name "fenics") (build-system python-build-system) (inputs - `(("pybind11" ,pybind11) - ("python-matplotlib" ,python-matplotlib) - ,@(alist-delete "python" (package-inputs fenics-dolfin)))) + (modify-inputs (package-inputs fenics-dolfin) + (delete "python") + (prepend pybind11 python-matplotlib))) (native-inputs - `(("cmake" ,cmake-minimal) - ("ply" ,python-ply) - ("pytest" ,python-pytest) - ("python-decorator" ,python-decorator) - ,@(package-native-inputs fenics-dolfin))) + (modify-inputs (package-native-inputs fenics-dolfin) + (prepend cmake-minimal python-ply python-pytest python-decorator))) (propagated-inputs - `(("dolfin" ,fenics-dolfin) - ("petsc4py" ,python-petsc4py) - ("slepc4py" ,python-slepc4py) + (list fenics-dolfin + python-petsc4py + python-slepc4py - ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time. - ("python-pkgconfig" ,python-pkgconfig))) + ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time. + python-pkgconfig)) (arguments - `(#: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" (assoc-ref %build-inputs "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 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)$"))))))))) (home-page "https://fenicsproject.org/") (synopsis "High-level environment for solving differential equations") (description