me
/
guix
Archived
1
0
Fork 0

gnu: fenics-dolfin, fenics: Remove input labels.

* 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.
master
Ludovic Courtès 2023-06-15 17:31:56 +02:00 committed by Ludovic Courtès
parent 9a86e2e97f
commit eb64632422
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 206 additions and 201 deletions

View File

@ -569,108 +569,111 @@ FFC is part of the FEniCS Project.")
"$ENV{CATCH_DIR}/include" back "\n"))))))) "$ENV{CATCH_DIR}/include" back "\n")))))))
(build-system cmake-build-system) (build-system cmake-build-system)
(inputs (inputs
`(("blas" ,openblas) (list openblas
("boost" ,boost) boost
("eigen" ,eigen) eigen
("hdf5" ,hdf5-parallel-openmpi) hdf5-parallel-openmpi
("lapack" ,lapack) lapack
("libxml2" ,libxml2) libxml2
("openmpi" ,openmpi) openmpi
("python" ,python-3) python-3
("scotch" ,pt-scotch32) pt-scotch32
("suitesparse" ,suitesparse) suitesparse
("sundials" ,sundials-openmpi) sundials-openmpi
("zlib" ,zlib))) zlib))
(native-inputs (native-inputs
`(("catch" ,catch2-1) (list catch-framework pkg-config))
("pkg-config" ,pkg-config)))
(propagated-inputs (propagated-inputs
`(("ffc" ,python-fenics-ffc) (list python-fenics-ffc petsc-openmpi slepc-openmpi))
("petsc" ,petsc-openmpi)
("slepc" ,slepc-openmpi)))
(arguments (arguments
`(#:configure-flags (list #:configure-flags #~`("-DDOLFIN_ENABLE_DOCS:BOOL=OFF"
`("-DDOLFIN_ENABLE_DOCS:BOOL=OFF" "-DDOLFIN_ENABLE_HDF5:BOOL=ON"
"-DDOLFIN_ENABLE_HDF5:BOOL=ON" "-DDOLFIN_ENABLE_MPI:BOOL=ON"
"-DDOLFIN_ENABLE_MPI:BOOL=ON" "-DDOLFIN_ENABLE_PARMETIS:BOOL=OFF"
"-DDOLFIN_ENABLE_PARMETIS:BOOL=OFF" "-DDOLFIN_ENABLE_SCOTCH:BOOL=ON"
"-DDOLFIN_ENABLE_SCOTCH:BOOL=ON" "-DDOLFIN_ENABLE_SUNDIALS:BOOL=ON"
"-DDOLFIN_ENABLE_SUNDIALS:BOOL=ON" "-DDOLFIN_ENABLE_TRILINOS:BOOL=OFF")
"-DDOLFIN_ENABLE_TRILINOS:BOOL=OFF") #:phases
#:phases #~(modify-phases %standard-phases
(modify-phases %standard-phases (add-after 'patch-usr-bin-file 'mpi-setup
(add-after 'patch-usr-bin-file 'mpi-setup #$%openmpi-setup)
,%openmpi-setup) (add-after 'patch-source-shebangs 'set-paths
(add-after 'patch-source-shebangs 'set-paths (lambda _
(lambda _ ;; Define paths to store locations.
;; Define paths to store locations. (setenv "BLAS_DIR"
(setenv "BLAS_DIR" (assoc-ref %build-inputs "blas")) #$(this-package-input "openblas"))
(setenv "CATCH_DIR" (assoc-ref %build-inputs "catch")) (setenv "CATCH_DIR"
(setenv "LAPACK_DIR" (assoc-ref %build-inputs "lapack")) #$(this-package-input "catch"))
(setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc")) (setenv "LAPACK_DIR"
(setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc")) #$(this-package-input "lapack"))
(setenv "SCOTCH_DIR" (assoc-ref %build-inputs "scotch")) (setenv "PETSC_DIR"
(setenv "SUNDIALS_DIR" (assoc-ref %build-inputs "sundials")) #$(this-package-input "petsc"))
(setenv "UMFPACK_DIR" (assoc-ref %build-inputs "suitesparse")))) (setenv "SLEPC_DIR"
(add-before 'check 'pre-check #$(this-package-input "slepc"))
(lambda _ (setenv "SCOTCH_DIR"
;; The Dolfin repository uses git-lfs, whereby web links are #$(this-package-input "scotch"))
;; substituted for large files. Guix does not currently support (setenv "SUNDIALS_DIR"
;; git-lfs, so only the links are downloaded. The tests that #$(this-package-input "sundials"))
;; require the absent meshes cannot run and are skipped. (setenv "UMFPACK_DIR"
;; #$(this-package-input "suitesparse"))))
;; One serial test fails and is skipped. (add-before 'check 'pre-check
;; i) demo_multimesh-stokes_serial: (lambda _
;; Warning: Found no facets matching domain for boundary ;; The Dolfin repository uses git-lfs, whereby web links are
;; condition. ;; substituted for large files. Guix does not currently support
;; ;; git-lfs, so only the links are downloaded. The tests that
;; One mpi test fails and is skipped. ;; require the absent meshes cannot run and are skipped.
;; i) demo_stokes-iterative_mpi: ;;
;; The MPI_Comm_rank() function was called before MPI_INIT was ;; One serial test fails and is skipped.
;; invoked ;; i) demo_multimesh-stokes_serial:
(call-with-output-file "CTestCustom.cmake" ;; Warning: Found no facets matching domain for boundary
(lambda (port) ;; condition.
(display ;;
(string-append ;; One mpi test fails and is skipped.
"set(CTEST_CUSTOM_TESTS_IGNORE " ;; i) demo_stokes-iterative_mpi:
"demo_bcs_serial " ;; The MPI_Comm_rank() function was called before MPI_INIT was
"demo_bcs_mpi " ;; invoked
"demo_eigenvalue_serial " (call-with-output-file "CTestCustom.cmake"
"demo_eigenvalue_mpi " (lambda (port)
"demo_navier-stokes_serial " (display (string-append
"demo_navier-stokes_mpi " "set(CTEST_CUSTOM_TESTS_IGNORE "
"demo_stokes-taylor-hood_serial " "demo_bcs_serial "
"demo_stokes-taylor-hood_mpi " "demo_bcs_mpi "
"demo_subdomains_serial " "demo_eigenvalue_serial "
"demo_advection-diffusion_serial " "demo_eigenvalue_mpi "
"demo_advection-diffusion_mpi " "demo_navier-stokes_serial "
"demo_auto-adaptive-navier-stokes_serial " "demo_navier-stokes_mpi "
"demo_contact-vi-snes_serial " "demo_stokes-taylor-hood_serial "
"demo_contact-vi-snes_mpi " "demo_stokes-taylor-hood_mpi "
"demo_contact-vi-tao_serial " "demo_subdomains_serial "
"demo_contact-vi-tao_mpi " "demo_advection-diffusion_serial "
"demo_curl-curl_serial " "demo_advection-diffusion_mpi "
"demo_curl-curl_mpi " "demo_auto-adaptive-navier-stokes_serial "
"demo_dg-advection-diffusion_serial " "demo_contact-vi-snes_serial "
"demo_dg-advection-diffusion_mpi " "demo_contact-vi-snes_mpi "
"demo_elasticity_serial " "demo_contact-vi-tao_serial "
"demo_elasticity_mpi " "demo_contact-vi-tao_mpi "
"demo_elastodynamics_serial " "demo_curl-curl_serial "
"demo_elastodynamics_mpi " "demo_curl-curl_mpi "
"demo_lift-drag_serial " "demo_dg-advection-diffusion_serial "
"demo_lift-drag_mpi " "demo_dg-advection-diffusion_mpi "
"demo_mesh-quality_serial " "demo_elasticity_serial "
"demo_mesh-quality_mpi " "demo_elasticity_mpi "
"demo_multimesh-stokes_serial " "demo_elastodynamics_serial "
")\n") port))))) "demo_elastodynamics_mpi "
(replace 'check "demo_lift-drag_serial "
(lambda* (#:key tests? #:allow-other-keys) "demo_lift-drag_mpi "
(when tests? "demo_mesh-quality_serial "
(invoke "make" "unittests") "demo_mesh-quality_mpi "
(invoke "make" "demos") "demo_multimesh-stokes_serial "
(invoke "ctest" "-R" "unittests") ")\n") port)))))
(invoke "ctest" "-R" "demo" "-R" "serial") (replace 'check
(invoke "ctest" "-R" "demo" "-R" "mpi"))))))) (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/") (home-page "https://bitbucket.org/fenics-project/dolfin/")
(synopsis "Problem solving environment for differential equations") (synopsis "Problem solving environment for differential equations")
(description (description
@ -708,112 +711,114 @@ user interface to the FEniCS core components and external libraries.")
(name "fenics") (name "fenics")
(build-system python-build-system) (build-system python-build-system)
(inputs (inputs
`(("pybind11" ,pybind11) (modify-inputs (package-inputs fenics-dolfin)
("python-matplotlib" ,python-matplotlib) (delete "python")
,@(alist-delete "python" (package-inputs fenics-dolfin)))) (prepend pybind11 python-matplotlib)))
(native-inputs (native-inputs
`(("cmake" ,cmake-minimal) (modify-inputs (package-native-inputs fenics-dolfin)
("ply" ,python-ply) (prepend cmake-minimal python-ply python-pytest python-decorator)))
("pytest" ,python-pytest)
("python-decorator" ,python-decorator)
,@(package-native-inputs fenics-dolfin)))
(propagated-inputs (propagated-inputs
`(("dolfin" ,fenics-dolfin) (list fenics-dolfin
("petsc4py" ,python-petsc4py) python-petsc4py
("slepc4py" ,python-slepc4py) python-slepc4py
;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time. ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time.
("python-pkgconfig" ,python-pkgconfig))) python-pkgconfig))
(arguments (arguments
`(#:phases (list #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'relax-requirements (add-after 'unpack 'relax-requirements
(lambda _ (lambda _
(substitute* "python/setup.py" (substitute* "python/setup.py"
(("pybind11==") "pybind11>=")))) (("pybind11==")
(add-after 'unpack 'set-dolfin-pc-file-name "pybind11>="))))
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'set-dolfin-pc-file-name
;; Instead of cluttering the user's 'PKG_CONFIG_PATH' environment (lambda* (#:key inputs #:allow-other-keys)
;; variable, hard-code the 'dolfin.pc' absolute file name. ;; Instead of cluttering the user's 'PKG_CONFIG_PATH' environment
(let ((pc-file (search-input-file inputs ;; variable, hard-code the 'dolfin.pc' absolute file name.
"/lib/pkgconfig/dolfin.pc"))) (let ((pc-file (search-input-file inputs
(substitute* "python/dolfin/jit/jit.py" "/lib/pkgconfig/dolfin.pc")))
(("pkgconfig\\.parse\\(\"dolfin\"\\)") (substitute* "python/dolfin/jit/jit.py"
(string-append "pkgconfig.parse(\"" pc-file "\")")))))) (("pkgconfig\\.parse\\(\"dolfin\"\\)")
(add-after 'patch-source-shebangs 'set-paths (string-append "pkgconfig.parse(\"" pc-file
(lambda _ "\")"))))))
;; Define paths to store locations. (add-after 'patch-source-shebangs 'set-paths
(setenv "PYBIND11_DIR" (assoc-ref %build-inputs "pybind11")) (lambda _
;; Move to python sub-directory. ;; Define paths to store locations.
(chdir "python"))) (setenv "PYBIND11_DIR" #$(this-package-input "pybind11"))
(add-after 'build 'mpi-setup ;; Move to python sub-directory.
,%openmpi-setup) (chdir "python")))
(add-before 'check 'pre-check (add-after 'build 'mpi-setup
(lambda _ #$%openmpi-setup)
;; Exclude three tests that generate (add-before 'check 'pre-check
;; 'NotImplementedError' in matplotlib version 3.1.2. (lambda _
;; See ;; Exclude three tests that generate
;; <https://github.com/matplotlib/matplotlib/issues/15382>. ;; 'NotImplementedError' in matplotlib version 3.1.2.
;; Also exclude tests that require meshes supplied by ;; See
;; git-lfs. ;; <https://github.com/matplotlib/matplotlib/issues/15382>.
(substitute* "demo/test.py" ;; Also exclude tests that require meshes supplied by
(("(.*stem !.*)" line) ;; git-lfs.
(string-append (substitute* "demo/test.py"
line "\n" (("(.*stem !.*)" line)
"excludeList = [\n" (string-append line
"'built-in-meshes', \n" "\n"
"'hyperelasticity', \n" "excludeList = [\n"
"'elasticity', \n" "'built-in-meshes', \n"
"'multimesh-quadrature', \n" "'hyperelasticity', \n"
"'multimesh-marking', \n" "'elasticity', \n"
"'mixed-poisson-sphere', \n" "'multimesh-quadrature', \n"
"'mesh-quality', \n" "'multimesh-marking', \n"
"'lift-drag', \n" "'mixed-poisson-sphere', \n"
"'elastodynamics', \n" "'mesh-quality', \n"
"'dg-advection-diffusion', \n" "'lift-drag', \n"
"'curl-curl', \n" "'elastodynamics', \n"
"'contact-vi-tao', \n" "'dg-advection-diffusion', \n"
"'contact-vi-snes', \n" "'curl-curl', \n"
"'collision-detection', \n" "'contact-vi-tao', \n"
"'buckling-tao', \n" "'contact-vi-snes', \n"
"'auto-adaptive-navier-stokes', \n" "'collision-detection', \n"
"'advection-diffusion', \n" "'buckling-tao', \n"
"'subdomains', \n" "'auto-adaptive-navier-stokes', \n"
"'stokes-taylor-hood', \n" "'advection-diffusion', \n"
"'stokes-mini', \n" "'subdomains', \n"
"'navier-stokes', \n" "'stokes-taylor-hood', \n"
"'eigenvalue']\n" "'stokes-mini', \n"
"demos = [" "'navier-stokes', \n"
"d for d in demos if d[0].stem not in " "'eigenvalue']\n"
"excludeList]\n"))) "demos = ["
(setenv "HOME" (getcwd)) "d for d in demos if d[0].stem not in "
;; Restrict OpenBLAS to MPI-only in preference to MPI+OpenMP. "excludeList]\n")))
(setenv "OPENBLAS_NUM_THREADS" "1"))) (setenv "HOME"
(replace 'check (getcwd))
(lambda* (#:key tests? #:allow-other-keys) ;; Restrict OpenBLAS to MPI-only in preference to MPI+OpenMP.
(when tests? (setenv "OPENBLAS_NUM_THREADS" "1")))
(with-directory-excursion "test" (replace 'check
(invoke (lambda* (#:key tests? #:allow-other-keys)
"pytest" "unit" (when tests?
;; The test test_snes_set_from_options() in the file (with-directory-excursion "test"
;; unit/nls/test_PETScSNES_solver.py fails and is ignored. (invoke "pytest"
"--ignore" "unit/nls/test_PETScSNES_solver.py" "unit"
;; Fails with a segfault. ;; The test test_snes_set_from_options() in the file
"--ignore" "unit/io/test_XDMF.py"))))) ;; unit/nls/test_PETScSNES_solver.py fails and is ignored.
(add-after 'install 'install-demo-files "--ignore"
(lambda* (#:key outputs #:allow-other-keys) "unit/nls/test_PETScSNES_solver.py"
(let* ((demos (string-append ;; Fails with a segfault.
(assoc-ref outputs "out") "--ignore"
"/share/python-dolfin/demo"))) "unit/io/test_XDMF.py")))))
(mkdir-p demos) (add-after 'install 'install-demo-files
(with-directory-excursion "demo" (lambda* (#:key outputs #:allow-other-keys)
(for-each (lambda (file) (let* ((demos (string-append (assoc-ref outputs "out")
(let* ((dir (dirname file)) "/share/python-dolfin/demo")))
(tgt-dir (string-append demos "/" dir))) (mkdir-p demos)
(unless (equal? "." dir) (with-directory-excursion "demo"
(mkdir-p tgt-dir) (for-each (lambda (file)
(install-file file tgt-dir)))) (let* ((dir (dirname file))
(find-files "." ".*\\.(py|gz|xdmf)$"))))))))) (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/") (home-page "https://fenicsproject.org/")
(synopsis "High-level environment for solving differential equations") (synopsis "High-level environment for solving differential equations")
(description (description