[PATCH 1/2] gnu: fenics: Make sure 'jit.py' can find 'dolfin.pc'.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Ludovic Courtès
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 15 Jun 2023 17:35
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)
9c787f4f582e4cfebd4349b15a3e88fe253627b9.1686843252.git.ludo@gnu.org
From: Ludovic Courtès <ludovic.courtes@inria.fr>

* gnu/packages/simulation.scm (fenics)[inputs]: Move PYTHON-PKGCONFIG
to...
[propagated-inputs]: ... here.
[arguments]: Add 'set-dolfin-pc-file-name' phase.
---
gnu/packages/simulation.scm | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 059be5a2be..9eeb57babe 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -716,12 +716,14 @@ (define-public fenics
("ply" ,python-ply)
("pytest" ,python-pytest)
("python-decorator" ,python-decorator)
- ("python-pkgconfig" ,python-pkgconfig)
,@(package-native-inputs fenics-dolfin)))
(propagated-inputs
`(("dolfin" ,fenics-dolfin)
("petsc4py" ,python-petsc4py)
- ("slepc4py" ,python-slepc4py)))
+ ("slepc4py" ,python-slepc4py)
+
+ ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time.
+ ("python-pkgconfig" ,python-pkgconfig)))
(arguments
`(#:phases
(modify-phases %standard-phases
@@ -729,6 +731,15 @@ (define-public fenics
(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.

base-commit: 26602f4063a6e0c626e8deb3423166bcd0abeb90
--
2.40.1
L
L
Ludovic Courtès wrote on 15 Jun 2023 17:41
[PATCH 2/2] gnu: fenics-dolfin, fenics: Remove input labels.
(address . 64081@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)
c2c446f1aa48821ae7f10458f3303a7e01acbe8d.1686843252.git.ludo@gnu.org
From: Ludovic Courtès <ludovic.courtes@inria.fr>

* gnu/packages/simulation.scm (fenics-dolfin)[inputs, native-inputs]
[propagated-inputs]: Remove labels.
[arguments]: Rewrite using gexps. Adjust 'set-paths' phase accordingly.
(fenics): Likewise.
---
gnu/packages/simulation.scm | 407 ++++++++++++++++++------------------
1 file changed, 206 insertions(+), 201 deletions(-)

Toggle diff (402 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 9eeb57babe..dfd432dcd3 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 catch2-1 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
- ;; <https://github.com/matplotlib/matplotlib/issues/15382>.
- ;; 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
+ ;; <https://github.com/matplotlib/matplotlib/issues/15382>.
+ ;; 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
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 20 Jun 2023 23:31
[PATCH v2 1/2] gnu: fenics: Make sure 'jit.py' can find 'dolfin.pc'.
(address . 64081@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)
b9fbbb1604d59db15fbe9476856d25dc6ac87892.1687296647.git.ludo@gnu.org
From: Ludovic Courtès <ludovic.courtes@inria.fr>

* gnu/packages/simulation.scm (fenics)[inputs]: Move PYTHON-PKGCONFIG
to...
[propagated-inputs]: ... here.
[arguments]: Add 'set-dolfin-pc-file-name' phase.
---
gnu/packages/simulation.scm | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 059be5a2be..9eeb57babe 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -716,12 +716,14 @@ (define-public fenics
("ply" ,python-ply)
("pytest" ,python-pytest)
("python-decorator" ,python-decorator)
- ("python-pkgconfig" ,python-pkgconfig)
,@(package-native-inputs fenics-dolfin)))
(propagated-inputs
`(("dolfin" ,fenics-dolfin)
("petsc4py" ,python-petsc4py)
- ("slepc4py" ,python-slepc4py)))
+ ("slepc4py" ,python-slepc4py)
+
+ ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time.
+ ("python-pkgconfig" ,python-pkgconfig)))
(arguments
`(#:phases
(modify-phases %standard-phases
@@ -729,6 +731,15 @@ (define-public fenics
(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.

base-commit: bb09f3ac002a4f34177d42fd3ea0332f4b7fe7a6
--
2.40.1
L
L
Ludovic Courtès wrote on 20 Jun 2023 23:31
[PATCH v2 2/2] gnu: fenics-dolfin, fenics: Remove input labels.
(address . 64081@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)
72671db61955d27d2af7ab391b7bb8482556ce99.1687296647.git.ludo@gnu.org
From: Ludovic Courtès <ludovic.courtes@inria.fr>

* 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(-)

Toggle diff (401 lines)
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
- ;; <https://github.com/matplotlib/matplotlib/issues/15382>.
- ;; 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
+ ;; <https://github.com/matplotlib/matplotlib/issues/15382>.
+ ;; 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 pr
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 24 Jun 2023 16:24
Re: bug#64081: [PATCH 1/2] gnu: fenics: Make sure 'jit.py' can find 'dolfin.pc'.
(address . 64081@debbugs.gnu.org)(name . Yann Dupont)(address . yann.dupont@univ-nantes.fr)
87mt0p0wgw.fsf@gnu.org
Hi,

Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (7 lines)
> From: Ludovic Courtès <ludovic.courtes@inria.fr>
>
> * gnu/packages/simulation.scm (fenics)[inputs]: Move PYTHON-PKGCONFIG
> to...
> [propagated-inputs]: ... here.
> [arguments]: Add 'set-dolfin-pc-file-name' phase.

I’m pushing v2 because it fixes a real issue and doesn’t introduce any
regression:


However, the test suite appears to time out, at least occasionally, even
on x86_64:


The log ends like this:

Toggle snippet (8 lines)
10/38 Test #20: demo_periodic_mpi ...................... Passed 9.24 sec
Start 22: demo_poisson_mpi
11/38 Test #22: demo_poisson_mpi ....................... Passed 8.26 sec
Start 24: demo_singular-poisson_mpi
12/38 Test #24: demo_singular-poisson_mpi .............. Passed 12.59 sec
Start 26: demo_stokes-iterative_mpi

Would be good to see if there’s a real problem hiding or if we’re
dealing with a long-running test or something.

This is not a regression AFAICS:

Toggle snippet (34 lines)
$ guix weather fenics-dolfin
computing 1 package derivations for x86_64-linux...
looking for 1 store items on https://ci.guix.gnu.org...
https://ci.guix.gnu.org ?
0.0% substitutes available (0 out of 1)
unknown substitute sizes
0.0 MiB on disk (uncompressed)
0.196 seconds per request (0.2 seconds in total)
5.1 requests per second

0.0% (0 out of 1) of the missing items are queued
0 queued builds
build rate: 12.96 builds per hour
x86_64-linux: 4.93 builds per hour
aarch64-linux: 2.28 builds per hour
i686-linux: 4.00 builds per hour
powerpc64le-linux: 1.85 builds per hour
armhf-linux: 0.05 builds per hour
looking for 1 store items on https://bordeaux.guix.gnu.org...
https://bordeaux.guix.gnu.org ?
0.0% substitutes available (0 out of 1)
unknown substitute sizes
0.0 MiB on disk (uncompressed)
0.153 seconds per request (0.2 seconds in total)
6.5 requests per second
(continuous integration information unavailable)
$ guix describe
Generation 267 Jun 19 2023 00:15:56 (current)
guix bf9afed
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: bf9afedef9c55aa0092b562077d9f2c743d9a29c

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 24 Jun 2023 16:24
control message for bug #64081
(address . control@debbugs.gnu.org)
87leg90wgq.fsf@gnu.org
close 64081
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 64081@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 64081
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch