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,28 +569,24 @@ FFC is part of the FEniCS Project.")
"$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"
(list #:configure-flags #~`("-DDOLFIN_ENABLE_DOCS:BOOL=OFF"
"-DDOLFIN_ENABLE_HDF5:BOOL=ON"
"-DDOLFIN_ENABLE_MPI:BOOL=ON"
"-DDOLFIN_ENABLE_PARMETIS:BOOL=OFF"
@ -598,20 +594,28 @@ FFC is part of the FEniCS Project.")
"-DDOLFIN_ENABLE_SUNDIALS:BOOL=ON"
"-DDOLFIN_ENABLE_TRILINOS:BOOL=OFF")
#:phases
(modify-phases %standard-phases
#~(modify-phases %standard-phases
(add-after 'patch-usr-bin-file 'mpi-setup
,%openmpi-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"))))
(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
@ -630,8 +634,7 @@ FFC is part of the FEniCS Project.")
;; invoked
(call-with-output-file "CTestCustom.cmake"
(lambda (port)
(display
(string-append
(display (string-append
"set(CTEST_CUSTOM_TESTS_IGNORE "
"demo_bcs_serial "
"demo_bcs_mpi "
@ -708,29 +711,27 @@ user interface to the FEniCS core components and external libraries.")
(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)))
python-pkgconfig))
(arguments
`(#:phases
(modify-phases %standard-phases
(list #:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'relax-requirements
(lambda _
(substitute* "python/setup.py"
(("pybind11==") "pybind11>="))))
(("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
@ -739,15 +740,16 @@ user interface to the FEniCS core components and external libraries.")
"/lib/pkgconfig/dolfin.pc")))
(substitute* "python/dolfin/jit/jit.py"
(("pkgconfig\\.parse\\(\"dolfin\"\\)")
(string-append "pkgconfig.parse(\"" pc-file "\")"))))))
(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"))
(setenv "PYBIND11_DIR" #$(this-package-input "pybind11"))
;; Move to python sub-directory.
(chdir "python")))
(add-after 'build 'mpi-setup
,%openmpi-setup)
#$%openmpi-setup)
(add-before 'check 'pre-check
(lambda _
;; Exclude three tests that generate
@ -758,8 +760,8 @@ user interface to the FEniCS core components and external libraries.")
;; git-lfs.
(substitute* "demo/test.py"
(("(.*stem !.*)" line)
(string-append
line "\n"
(string-append line
"\n"
"excludeList = [\n"
"'built-in-meshes', \n"
"'hyperelasticity', \n"
@ -786,30 +788,33 @@ user interface to the FEniCS core components and external libraries.")
"demos = ["
"d for d in demos if d[0].stem not in "
"excludeList]\n")))
(setenv "HOME" (getcwd))
(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"
(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"
"--ignore"
"unit/nls/test_PETScSNES_solver.py"
;; Fails with a segfault.
"--ignore" "unit/io/test_XDMF.py")))))
"--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")
(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)))
(tgt-dir (string-append
demos "/" dir)))
(unless (equal? "." dir)
(mkdir-p tgt-dir)
(install-file file tgt-dir))))