[PATCH 00/10] Add the FEniCS Project

  • Done
  • quality assurance status badge
Details
4 participants
  • Efraim Flashner
  • Eric Bavier
  • Ludovic Courtès
  • Paul Garlick
Owner
unassigned
Submitted by
Paul Garlick
Severity
normal
P
P
Paul Garlick wrote on 16 Oct 2018 11:17
(address . guix-patches@gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539681428-6399-1-git-send-email-pgarlick@tourbillion-technology.com
Hi Guix,

This set of patches adds definitions and dependencies for the FEniCS Project.
FEniCS provides a problem-solving environment for general classes of problems
that involve differential equations. It is particularly well-suited to
problems that can be solved using the Finite Element Method.

There are two main packages;

i) fenics-dolfin: C++ library plus interface
ii) python-fenics-dolfin: Python interface

There are four FEniCS dependencies:

i) python-fenics-ffc
ii) python-fenics-fiat
iii) python-fenics-ufl
iv) python-fenics-dijitso

There are three external dependencies:

i) python-slepc4py
ii) python-petsc4py
iii) python-mpi4py

There is an extra package 'fenics' that inherits its defintion from
python-fenics-dolfin. This is to provide a sensible default for users
expecting to find a package of this name.

Best regards,

Paul.

Paul Garlick (10):
gnu: Add python-mpi4py.
gnu: Add python-petsc4py.
gnu: Add python-slepc4py.
gnu: Add python-fenics-dijitso.
gnu: Add python-fenics-ufl.
gnu: Add python-fenics-fiat.
gnu: Add python-fenics-ffc.
gnu: Add fenics-dolfin.
gnu: Add python-fenics-dolfin.
gnu: Add fenics.

gnu/packages/simulation.scm | 688 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 687 insertions(+), 1 deletion(-)

--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 01/10] gnu: Add python-mpi4py.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-1-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-mpi4py): New variable.
---
gnu/packages/simulation.scm | 45 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)

Toggle diff (74 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index a5b661e..857d856 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
+;;; Copyright © 2017, 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -36,6 +36,7 @@
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages readline)
+ #:use-module (gnu packages ssh)
#:use-module (gnu packages tls)
#:use-module (gnu packages version-control)
#:use-module (gnu packages xml)
@@ -43,6 +44,7 @@
#:use-module (guix download)
#:use-module (guix build utils)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system python)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -221,3 +223,44 @@ with gas/liquid interfaces. Large problems may be split into smaller, connected
problems for efficient solution on parallel systems.")
(license license:gpl3+)
(home-page "https://openfoam.org")))
+
+(define-public python-mpi4py
+ (package
+ (name "python-mpi4py")
+ (version "3.0.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "mpi4py" version))
+ (sha256
+ (base32
+ "1mzgd26dfv4vwbci8gq77ss9f0x26i9aqzq9b9vs9ndxhlnv0mxl"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'mpi-setup
+ ,%openmpi-setup)
+ (add-before 'check 'pre-check
+ (lambda _
+ ;; Skip BaseTestSpawn class (causes error 'ompi_dpm_dyn_init()
+ ;; failed --> Returned "Unreachable"' in chroot environment).
+ (substitute* "test/test_spawn.py"
+ (("unittest.skipMPI\\('openmpi\\(<3.0.0\\)'\\)")
+ "unittest.skipMPI('openmpi')"))
+ #t)))))
+ (inputs
+ `(("openmpi" ,openmpi)))
+ (home-page
+ "https://bitbucket.org/mpi4py/mpi4py/")
+ (synopsis "Python bindings for the Message Passing Interface standard")
+ (description "MPI for Python (mpi4py) provides bindings of the Message
+Passing Interface (MPI) standard for the Python programming language, allowing
+any Python program to exploit multiple processors.
+
+mpi4py is constructed on top of the MPI-1/MPI-2 specification and provides an
+object oriented interface which closely follows MPI-2 C++ bindings. It
+supports point-to-point and collective communications of any picklable Python
+object as well as optimized communications of Python objects (such as NumPy
+arrays) that expose a buffer interface.")
+ (license license:bsd-3)))
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 02/10] gnu: Add python-petsc4py.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-2-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-petsc4py): New variable.
---
gnu/packages/simulation.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (55 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 857d856..3f6b73f 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -35,6 +35,7 @@
#:use-module (gnu packages mpi)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
+ #:use-module (gnu packages python)
#:use-module (gnu packages readline)
#:use-module (gnu packages ssh)
#:use-module (gnu packages tls)
@@ -264,3 +265,40 @@ supports point-to-point and collective communications of any picklable Python
object as well as optimized communications of Python objects (such as NumPy
arrays) that expose a buffer interface.")
(license license:bsd-3)))
+
+(define-public python-petsc4py
+ (package
+ (name "python-petsc4py")
+ (version "3.9.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "petsc4py" version))
+ (sha256
+ (base32
+ "1f8zd1ac9irsgkyqmzq30d9kl10fy1nh6zk312dhs43g449fkkhc"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'pre-build
+ (lambda _
+ ;; Define path to PETSc installation.
+ (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
+ #t))
+ (add-before 'check 'mpi-setup
+ ,%openmpi-setup))))
+ (inputs
+ `(("petsc" ,petsc-openmpi)
+ ("python-numpy" ,python-numpy)))
+ (home-page
+ "https://bitbucket.org/petsc/petsc4py/")
+ (synopsis "Python bindings for PETSc")
+ (description "PETSc, the Portable, Extensible Toolkit for
+Scientific Computation, is a suite of data structures and routines for
+the scalable (parallel) solution of scientific applications modeled by
+partial differential equations. It employs the MPI standard for all
+message-passing communication. @code{petsc4py} provides Python
+bindings to almost all functions of PETSc.")
+ (license license:bsd-3)))
+
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 03/10] gnu: Add python-slepc4py.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-3-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-slepc4py): New variable.
---
gnu/packages/simulation.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 3f6b73f..72528c0 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -302,3 +302,41 @@ message-passing communication. @code{petsc4py} provides Python
bindings to almost all functions of PETSc.")
(license license:bsd-3)))
+(define-public python-slepc4py
+ (package
+ (name "python-slepc4py")
+ (version "3.9.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "slepc4py" version))
+ (sha256
+ (base32
+ "02xr0vndgibgkz3rgprqk05n3mk5mpgqw550sr4681vcsgz4zvb7"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'pre-build
+ (lambda _
+ ;; Define path to PETSc installation.
+ (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
+ ;; Define path to SLEPc installation.
+ (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
+ #t))
+ (add-before 'check 'mpi-setup
+ ,%openmpi-setup))))
+ (inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-petsc4py" ,python-petsc4py)
+ ("slepc" ,slepc-openmpi)))
+ (home-page
+ "https://bitbucket.org/slepc/slepc4py/")
+ (synopsis "Python bindings for SLEPc")
+ (description "SLEPc, the Scalable Library for Eigenvalue Problem
+Computations, is based on PETSc, the Portable, Extensible Toolkit for
+Scientific Computation. It employs the MPI standard for all
+message-passing communication. @code{slepc4py} provides Python
+bindings to almost all functions of SLEPc.")
+ (license license:bsd-3)))
+
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 04/10] gnu: Add python-fenics-dijitso.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-4-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-dijitso): New varaible.
---
gnu/packages/simulation.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)

Toggle diff (68 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 72528c0..8bbf435 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -22,6 +22,7 @@
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
+ #:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages flex)
#:use-module (gnu packages gettext)
@@ -339,4 +340,52 @@ Scientific Computation. It employs the MPI standard for all
message-passing communication. @code{slepc4py} provides Python
bindings to almost all functions of SLEPc.")
(license license:bsd-3)))
-
+
+(define-public python-fenics-dijitso
+ (package
+ (name "python-fenics-dijitso")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-dijitso" version))
+ (sha256
+ (base32
+ "1qax2f52qsjbd1h5lk5i5shp448qlakxabjjybrfc1w823p0yql9"))))
+ (build-system python-build-system)
+ (inputs
+ `(("openmpi" ,openmpi)
+ ("python-numpy" ,python-numpy)))
+ (native-inputs
+ `(("python-pytest-cov" ,python-pytest-cov)))
+ (propagated-inputs
+ `(("python-mpi4py" ,python-mpi4py)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'mpi-setup
+ ,%openmpi-setup)
+ (replace 'check
+ (lambda _
+ (setenv "HOME" "/tmp")
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (chdir "test")
+ (invoke "./runtests.sh")
+ (chdir "..")
+ #t)))))
+ (home-page
+ "https://bitbucket.org/fenics-project/dijitso/")
+ (synopsis
+ "Distributed just-in-time building of shared libraries")
+ (description
+ "Dijitso provides a core component of the @code{FEniCS} framework,
+namely the just-in-time compilation of C++ code that is generated from
+Python modules. It is called from within a C++ library, using ctypes
+to import the dynamic shared library directly.
+
+As long as the compiled code can provide a simple factory function to
+a class implementing a predefined C++ interface, there is no limit to
+the complexity of that interface. Parallel support depends on the
+@code{mpi4py} interface.")
+ (license license:lgpl3+)))
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 05/10] gnu: Add python-fenics-ufl.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-5-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-ufl): New variable.
---
gnu/packages/simulation.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 8bbf435..214a834 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -389,3 +389,42 @@ a class implementing a predefined C++ interface, there is no limit to
the complexity of that interface. Parallel support depends on the
@code{mpi4py} interface.")
(license license:lgpl3+)))
+
+(define-public python-fenics-ufl
+ (package
+ (name "python-fenics-ufl")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-ufl" version))
+ (sha256
+ (base32
+ "1fq8yc86s1s3c8c0b1rc2vf265q0hrkzg57100fg1nghcz0p4vla"))))
+ (build-system python-build-system)
+ (inputs
+ `(("python-numpy" ,python-numpy)))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (chdir "test")
+ (invoke "py.test")
+ (chdir "..")
+ #t)))))
+ (home-page
+ "https://bitbucket.org/fenics-project/ufl/")
+ (synopsis "Unified language for form-compilers")
+ (description "The Unified Form Language (UFL) is a domain specific
+language for declaration of finite element discretizations of
+variational forms. More precisely, it defines a flexible interface
+for choosing finite element spaces and defining expressions for weak
+forms in a notation close to mathematical notation.
+
+UFL is part of the FEniCS Project.")
+ (license license:lgpl3+)))
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 06/10] gnu: Add python-fenics-fiat.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-6-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-fiat): New variable.
---
gnu/packages/simulation.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 214a834..3a5e6cb 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -428,3 +428,47 @@ forms in a notation close to mathematical notation.
UFL is part of the FEniCS Project.")
(license license:lgpl3+)))
+
+(define-public python-fenics-fiat
+ (package
+ (name "python-fenics-fiat")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-fiat" version))
+ (sha256
+ (base32
+ "0fmjd93r6bwf6xs8csw86qzphrnr66xwv7f372w59gmq8mg6rljc"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-sympy" ,python-sympy)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (chdir "test")
+ (invoke "py.test" "unit/")
+ (chdir "..")
+ #t)))))
+ (home-page
+ "https://bitbucket.org/fenics-project/fiat/")
+ (synopsis "Tabulation of finite element function spaces")
+ (description
+ "The FInite element Automatic Tabulator (FIAT) supports
+generation of arbitrary order instances of the Lagrange elements on
+lines, triangles, and tetrahedra. It is also capable of generating
+arbitrary order instances of Jacobi-type quadrature rules on the same
+element shapes. Further, H(div) and H(curl) conforming finite element
+spaces such as the families of Raviart-Thomas, Brezzi-Douglas-Marini
+and Nedelec are supported on triangles and tetrahedra. Upcoming
+versions will also support Hermite and nonconforming elements.
+
+FIAT is part of the FEniCS Project.")
+ (license license:lgpl3+)))
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 07/10] gnu: Add python-fenics-ffc.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-7-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-ffc): New variable.
---
gnu/packages/simulation.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (64 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 3a5e6cb..f6ad966 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -472,3 +472,57 @@ versions will also support Hermite and nonconforming elements.
FIAT is part of the FEniCS Project.")
(license license:lgpl3+)))
+
+(define-public python-fenics-ffc
+ (package
+ (name "python-fenics-ffc")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-ffc" version))
+ (sha256
+ (base32
+ "1b2ia5vlkw298x7rf0k2p3ihlpwkwgc98p3s6sbpds3hqmfrzdz9"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (propagated-inputs
+ `(("python-fenics-dijitso" ,python-fenics-dijitso)
+ ("python-fenics-fiat" ,python-fenics-fiat)
+ ("python-fenics-ufl" ,python-fenics-ufl)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (setenv "HOME" (getcwd))
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (chdir "test")
+ ;; FIXME: the tests in subdirectory
+ ;; 'unit/ufc/finite_element' require the ffc_factory
+ ;; extension module. This module, located in the 'libs'
+ ;; subdirectory, needs to be built and made accessible
+ ;; prior to running the tests.
+ (invoke "py.test" "unit/" "--ignore=unit/ufc/")
+ (chdir "uflacs")
+ (invoke "py.test" "unit/")
+ (chdir "../..")
+ #t)))))
+ (home-page
+ "https://bitbucket.org/fenics-project/ffc/")
+ (synopsis "Compiler for finite element variational forms")
+ (description "The FEniCS Form Compiler (FFC) is a compiler for
+finite element variational forms. From a high-level description of
+the form, it generates efficient low-level C++ code that can be used
+to assemble the corresponding discrete operator (tensor). In
+particular, a bilinear form may be assembled into a matrix and a
+linear form may be assembled into a vector. FFC may be used either
+from the command line (by invoking the @code{ffc} command) or as a
+Python module (@code{import ffc}).
+
+FFC is part of the FEniCS Project.")
+ ;; There are two files released with a public domain licence;
+ ;; ufc.h and ufc_geometry.h, in subdirectory 'ffc/backends/ufc'.
+ (license (list license:public-domain license:lgpl3+))))
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 08/10] gnu: Add fenics-dolfin.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-8-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (fenics-dolfin): New variable.
---
gnu/packages/simulation.scm | 228 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 228 insertions(+)

Toggle diff (264 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index f6ad966..3594f07 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -18,11 +18,13 @@
(define-module (gnu packages simulation)
#:use-module (gnu packages)
+ #:use-module (gnu packages algebra)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
+ #:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages flex)
#:use-module (gnu packages gettext)
@@ -36,6 +38,7 @@
#:use-module (gnu packages mpi)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages readline)
#:use-module (gnu packages ssh)
@@ -45,6 +48,7 @@
#:use-module (gnu packages xorg)
#:use-module (guix download)
#:use-module (guix build utils)
+ #:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module ((guix licenses) #:prefix license:)
@@ -526,3 +530,227 @@ FFC is part of the FEniCS Project.")
;; There are two files released with a public domain licence;
;; ufc.h and ufc_geometry.h, in subdirectory 'ffc/backends/ufc'.
(license (list license:public-domain license:lgpl3+))))
+
+(define-public fenics-dolfin
+ (package
+ (name "fenics-dolfin")
+ (version "2018.1.0.post1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://bitbucket.org/fenics-project/dolfin/get/"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "12zkk8j3xsg6l8p0ggwsl03084vlcivw4h99b7z9kndg7k89b3ya"))))
+ (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)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (propagated-inputs
+ `(("ffc" ,python-fenics-ffc)
+ ("petsc" ,petsc-openmpi)
+ ("slepc" ,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 "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"))
+ #t))
+ (add-before 'configure 'pre-configure
+ (lambda _
+ (use-modules (ice-9 regex)
+ (ice-9 rdelim)
+ (guix build utils)
+ (rnrs io ports))
+ ;; Add extra include directories required by the unit tests.
+ (with-atomic-file-replacement "test/unit/cpp/CMakeLists.txt"
+ (let ((rx (make-regexp "target_link_libraries")))
+ (lambda (in out)
+ (let loop ()
+ (let ((line (read-line in 'concat)))
+ (if (eof-object? line)
+ #t
+ (begin
+ (display line out)
+ (when (regexp-exec rx line)
+ (display
+ (string-append
+ "target_include_directories("
+ "unittests PRIVATE "
+ "${DOLFIN_SOURCE_DIR} "
+ "${DOLFIN_SOURCE_DIR}/dolfin "
+ "${DOLFIN_BINARY_DIR})\n") out))
+ (loop))))))))
+ ;; Add extra include directories required by the demo tests.
+ (with-atomic-file-replacement "demo/CMakeLists.txt"
+ (let ((rx (make-regexp "find_package")))
+ (lambda (in out)
+ (let loop ()
+ (let ((line (read-line in 'concat)))
+ (if (eof-object? line)
+ #t
+ (begin
+ (display line out)
+ (when (regexp-exec rx line)
+ (display
+ (string-append
+ "include_directories("
+ "${DOLFIN_SOURCE_DIR} "
+ "${DOLFIN_SOURCE_DIR}/dolfin "
+ "${DOLFIN_BINARY_DIR})\n") out))
+ (loop))))))))))
+ (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.
+ ;;
+ ;; Two other serial tests fail and are skipped.
+ ;; i) demo_stokes-iterative_serial,
+ ;; The MPI_Comm_rank() function was called before MPI_INIT was
+ ;; invoked
+ ;; ii) 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 "
+ "demo_stokes-iterative_serial "
+ "demo_stokes-iterative_mpi "
+ ")\n") port)))
+ #t))
+ (replace 'check
+ (lambda _
+ (and (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
+ "DOLFIN is a computational framework for finding numerical
+solutions to problems described by differential equations. Numerical
+models in DOLFIN are constructed using general families of finite
+elements. Data structures are provided for discretizing the governing
+system on a computational mesh. A compact syntax, similar to
+mathematical notation, is made available for defining function spaces
+and expressing variational forms. Interfaces to specialized matrix
+solvers are provided for solving the resultant linear systems.
+
+@code{fenics-dolfin} is part of the FEniCS project. It is the C++
+user interface to the FEniCS core components and external libraries.")
+ ;; The source code files for the DOLFIN C++ library are licensed under the
+ ;; GNU Lesser General Public License, version 3 or later, with the
+ ;; following exceptions:
+ ;;
+ ;; bsd-2: cmake/modules/FindAMD.cmake
+ ;; cmake/modules/FindBLASHeader.cmake
+ ;; cmake/modules/FindCHOLMOD.cmake
+ ;; cmake/modules/FindEigen3.cmake
+ ;; cmake/modules/FindMPFR.cmake
+ ;; cmake/modules/FindNumPy.cmake
+ ;; cmake/modules/FindPETSc.cmake
+ ;; cmake/modules/FindPETSc4py.cmake
+ ;; cmake/modules/FindParMETIS.cmake
+ ;; cmake/modules/FindSCOTCH.cmake
+ ;; cmake/modules/FindSLEPc.cmake
+ ;; cmake/modules/FindSLEPc4py.cmake
+ ;; cmake/modules/FindSphinx.cmake
+ ;; cmake/modules/FindSUNDIALS.cmake
+ ;; cmake/modules/FindUFC.cmake
+ ;;
+ ;; bsd-3: cmake/modules/FindBLAS.cmake
+ ;; cmake/modules/FindLAPACK.cmake
+ ;; cmake/modules/FindMPI.cmake
+ ;;
+ ;; public-domain: dolfin/geometry/predicates.cpp
+ ;; dolfin/geometry/predicates.h
+ ;;
+ ;; zlib: dolfin/io/base64.cpp
+ ;; dolfin/io/base64.h
+ ;;
+ ;; expat: dolfin/io/pugiconfig.hpp
+ ;; dolfin/io/pugixml.cpp
+ ;; dolfin/io/pugixml.hpp
+ ;;
+ ;; boost1.0: test/unit/cpp/catch/catch.hpp
+ (license (list license:bsd-2
+ license:bsd-3
+ license:public-domain
+ license:zlib
+ license:expat
+ license:boost1.0
+ license:lgpl3+))))
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 09/10] gnu: Add python-fenics-dolfin.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-9-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-dolfin): New variable.
---
gnu/packages/simulation.scm | 147 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 147 insertions(+)

Toggle diff (157 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 3594f07..c0617b3 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -754,3 +754,150 @@ user interface to the FEniCS core components and external libraries.")
license:expat
license:boost1.0
license:lgpl3+))))
+
+(define-public python-fenics-dolfin
+ (package (inherit fenics-dolfin)
+ (name "python-fenics-dolfin")
+ (build-system python-build-system)
+ (inputs
+ `(("pybind11" ,pybind11)
+ ("python-matplotlib" ,python-matplotlib)
+ ,@(alist-delete "python" (package-inputs fenics-dolfin))))
+ (native-inputs
+ `(("cmake" ,cmake)
+ ("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)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (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")
+ #t))
+ (add-after 'build 'mpi-setup
+ ,%openmpi-setup)
+ (add-before 'check 'pre-check
+ (lambda _
+ (use-modules (ice-9 regex)
+ (ice-9 rdelim)
+ (guix build utils)
+ (rnrs io ports))
+ ;; Exclude tests that require meshes supplied by git-lfs.
+ (with-atomic-file-replacement "demo/test.py"
+ (let ((rx (make-regexp "stem !")))
+ (lambda (in out)
+ (let loop ()
+ (let ((line (read-line in 'concat)))
+ (if (eof-object? line)
+ #t
+ (begin
+ (display line out)
+ (when (regexp-exec rx line)
+ (display
+ (string-append
+ "excludeList = [\n"
+ "'multimesh-quadrature', \n"
+ "'multimesh-marking', \n"
+ "'mixed-poisson-sphere', \n"
+ "'mesh-quality', \n"
+ "'lift-drag', \n"
+ "'elastodynamics', \n"
+ "'dg-advection-diffusion', \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") out))
+ (loop))))))))
+ (setenv "HOME" (getcwd))
+ (setenv "PYTHONPATH"
+ (string-append
+ (getcwd) "/build/lib.linux-x86_64-"
+ ,(version-major+minor (package-version python)) ":"
+ (getenv "PYTHONPATH")))
+ ;; Restrict OpenBLAS to MPI-only in preference to MPI+OpenMP.
+ (setenv "OPENBLAS_NUM_THREADS" "1")
+ #t))
+ (replace 'check
+ (lambda _
+ (chdir "test")
+ ;; Note: The test test_snes_set_from_options() in the file
+ ;; unit/nls/test_PETScSNES_solver.py fails and is ignored.
+ (and (invoke "py.test" "unit"
+ "--ignore" "unit/nls/test_PETScSNES_solver.py")
+ (invoke "mpirun" "-np" "3" "python" "-B" "-m" "pytest" "unit"
+ "--ignore" "unit/nls/test_PETScSNES_solver.py"))
+ (chdir "../demo")
+ ;; Check demos.
+ (invoke "python" "generate-demo-files.py")
+ (and (invoke "python" "-m" "pytest" "-v" "test.py")
+ (invoke "python" "-m" "pytest" "-v" "test.py"
+ "--mpiexec=mpiexec" "--num-proc=3"))
+ (chdir "..")
+ #t))
+ (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)$"))))
+ #t)))))
+ (home-page
+ "https://bitbucket.org/fenics-project/dolfin/")
+ (synopsis
+ "High-level problem solving environment for differential equations")
+ (description
+ "DOLFIN is a computational framework for finding numerical
+solutions to problems described by differential equations. Numerical
+models in DOLFIN are constructed using general families of finite
+elements. Data structures are provided for discretizing the governing
+system on a computational mesh. A compact syntax, similar to
+mathematical notation, is made available for defining function spaces
+and expressing variational forms. Interfaces to specialized matrix
+solvers are provided for solving the resultant linear systems.
+
+@code{python-fenics-dolfin} is part of the FEniCS project. It is the
+python user interface to the FEniCS core components and external
+libraries.")
+ ;; The python files in DOLFIN are licensed under the GNU Lesser
+ ;; General Public License, version 3 or later, with the following
+ ;; exceptions:
+ ;;
+ ;; bsd-2: python/cmake/FindPETSc4py.cmake
+ ;;
+ ;; bsd-3: site-packages/dolfin_utils/cppparser/CppHeaderParser.py
+ ;;
+ ;; expat: site-packages/dolfin_utils/ordereddict.py
+ ;;
+ ;; gpl2+: utils/pylit/pylit.py
+ (license (list license:bsd-2
+ license:bsd-3
+ license:expat
+ license:gpl2+
+ license:lgpl3+))))
--
1.8.3.1
P
P
Paul Garlick wrote on 16 Oct 2018 11:31
[PATCH 10/10] gnu: Add fenics.
(address . 33059@debbugs.gnu.org)(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1539682284-6446-10-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (fenics): New variable.
---
gnu/packages/simulation.scm | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (16 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index c0617b3..2e47067 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -901,3 +901,9 @@ libraries.")
license:expat
license:gpl2+
license:lgpl3+))))
+
+;; The FEniCS Project.
+(define-public fenics
+ (package
+ (inherit python-fenics-dolfin)
+ (name "fenics")))
--
1.8.3.1
E
E
Efraim Flashner wrote on 16 Oct 2018 20:30
Re: [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
20181016183057.GB12881@macbook41
On Tue, Oct 16, 2018 at 10:31:18AM +0100, Paul Garlick wrote:

Toggle quote (4 lines)
> + (chdir "test")
> + (invoke "./runtests.sh")
> + (chdir "..")
>
for this part you may want to look into 'with-directory-excursion'

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlvGLmEACgkQQarn3Mo9
g1Gj9A/+IU6gnxB9FxcC/yZUB5qHT5zlsA7VQqLEb2g0N/+vbNgpEJ58Pjcf8ewn
5T/JyPDXJrX6q8G70YFbhk2HBegAmbjL92CymWcqfzkQdmD9HzvZBGMWtNIDn0V4
ZbogBxLzXnvIyUMZqC8buRLG1zUltZAGHlS/SEq8yItWOCfXuv09xSX4pm2G7wZg
nM1AlOzQxb+FuPlKeR5mlX1z+9sklrut3oVBKBw9kyxpaDfcSC2MQPZxOvMr1P5+
a4uRNij/CuQ7ZKhBCck/9vXpnh58ZkCeq1sS6KL5zsmCGI69ji3tTvvfGjqFgN4q
zWT4VJG1d35zr5sZB9vKkjEaD6zoVzgFwVuhXBvMdGYN2SxdNM76Z7PI5+aComPb
n1xiew20sAViCMNGZ2e1CFn+9bYc41ylQP2SnXfluKIhZPMhzwjNXsAzkQ9273KT
Hg36MtiQqClpc6pvZOxOwrCatiqWZcFCUa5gCBl+OwMZNyQFCCDRzXScuWuVlCa3
mCQHOjXW8sZ5aIuaFRLDpIzh2LiXLJePdU6WlkwfcqWdKaxp97/0rxlKjMleZhQ1
AxWwE4ug5hP8wt98P4Myx5lxHDGo0wWmyNKo7JBLS3bzFJSP/PnN77amqFKuo599
0+/qmE3VGEUE6wVMIfPtosecaOhLzM9oGHdMhTNnU3lZI5/8XpU=
=aChx
-----END PGP SIGNATURE-----


P
P
Paul Garlick wrote on 17 Oct 2018 11:09
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 33059@debbugs.gnu.org)
1539767389.2698.6.camel@tourbillion-technology.com
Hi Efraim,

Toggle quote (6 lines)
> > +             (chdir "test")
> > +             (invoke "./runtests.sh")
> > +             (chdir "..")
> >
> for this part you may want to look into 'with-directory-excursion'

Thanks.  Will do.

In fact, in these patches there is a need to change directories a few
times, so I will unify the treatment throughout with 'with-directory-
excursion'.

Best regards,

Paul.
E
E
Eric Bavier wrote on 19 Oct 2018 18:03
Re: [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
20181019110334.776232e9@centurylink.net
On Tue, 16 Oct 2018 10:31:15 +0100
Paul Garlick <pgarlick@tourbillion-technology.com> wrote:

Toggle quote (5 lines)
> * gnu/packages/simulation.scm (python-mpi4py): New variable.
> ---
> gnu/packages/simulation.scm | 45 ++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 44 insertions(+), 1 deletion(-)

I haven't done a proper review yet, but... Would this package be better
put in (gnu packages mpi). Same with the petsc4py and slepc4py, in
(gnu packages maths).

`~Eric
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlvKAFYACgkQ/XPKxxnT
JWYG5w/+LciVY83m8tVz1yX4vI7U5SBjGjCJq0aX2zBalZx+ARS5pzhJz5HYCGe1
rTbmTAkE83fJS5OXwTpazoKnuLpQ0widkBTxoMakPn/P8h9uagfdUNmHREuaboDR
+5nJroDL5auiLx3XDNkd1s7IWUynkFdD+D3NrKkj88ihTeNxtTux5RX5m2+6lwKT
C5c7+Kb7EDE7+OLFlWx9Nzq+f3EwvCMpsMmq5UT5kUKh8LQvdH75q0SMD3X/xzeA
8qNQsRhaRHwaKRtAPFTkzZSJY86ad2MS7OjtZBUgjpzyWNd16gkvIrjfA75G9AjL
Hlsbfg3RJ4JcjECx7gJKEpKA+RsVuULSIsd3LuJ6pXZ7QSeHrJLeSKOxiGOKZqGG
nCuxraoChUCE6lb4eLO1pEE29cvBBqZ1fbPcoSE4XigufoxxLYfgG2SGLm5wfHvG
NRIFIaMwDmBnfFLxclh/HmK+jrg2J0tmieJjbpTA/4hQXpkb0dtYaaWslIkj5e+L
UemqFr/XA6kKGUg31oiS7zWZMEOlqx2LxOHjpXqT5xehgSrUe3Hjve8q8eAHutDl
fYFygNMEuKo/oIHVJ8Cfwm2J/QYXjZ/eSK0vAgld5WUAFwjuZMDRkJpq/AHPenHF
sZSszgooWzf83kCvoLDYYTUprCc712iQifDZB2sfbXrvcJwrb4w=
=hoYw
-----END PGP SIGNATURE-----


P
P
Paul Garlick wrote on 22 Oct 2018 10:51
(name . Eric Bavier)(address . ericbavier@centurylink.net)(address . 33059@debbugs.gnu.org)
1540198312.4645.12.camel@tourbillion-technology.com
Hi Eric,

Toggle quote (4 lines)
> Would this package be better
> put in (gnu packages mpi).  Same with the petsc4py and slepc4py, in
> (gnu packages maths).

Yes, good idea.  These three dependencies are 'external', in the sense
that their development is independent of the FEniCS project.  They
could be used as dependencies of future packages that may not go in
(gnu packages simulation).

Also, the versions of petsc4py and slepc4py keep track of petsc and
slepc.  So version 3.9.1 of petsc4py, for example, depends on version
3.9 of petsc.  Keeping the package definitions near to each other in
the same module will be a useful 'aide memoire'.

I shall wait a little longer for any more comments, then move these
three definitions in the way you suggest and re-submit as 'v2'.
patches.

Best regards,

Paul.
L
L
Ludovic Courtès wrote on 24 Oct 2018 23:44
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
8736svyq8q.fsf@gnu.org
Hi Paul,

Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-mpi4py): New variable.

I agree with Eric’s suggestion but otherwise LGTM.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 24 Oct 2018 23:45
Re: [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87y3anxblm.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-petsc4py): New variable.

Should it be in maths.scm? Your call! :-)

Apart from that it LGTM.

Ludo’.
L
L
Ludovic Courtès wrote on 24 Oct 2018 23:46
Re: [bug#33059] [PATCH 03/10] gnu: Add python-slepc4py.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87tvlbxbkg.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-slepc4py): New variable.

LGTM.
L
L
Ludovic Courtès wrote on 24 Oct 2018 23:48
Re: [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87pnvzxbhk.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-fenics-dijitso): New varaible.

I agree with Efraim’s suggestion to use ‘with-directory-excursion’.

Nitpick:

Toggle quote (3 lines)
> + (home-page
> + "https://bitbucket.org/fenics-project/dijitso/")

Indentation is off.

Toggle quote (3 lines)
> + (synopsis
> + "Distributed just-in-time building of shared libraries")

Please keep ‘home-page’ and ‘synopsis’ on a single line each.

Otherwise LGTM, thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 24 Oct 2018 23:52
Re: [bug#33059] [PATCH 05/10] gnu: Add python-fenics-ufl.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87lg6nxba7.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-fenics-ufl): New variable.

[...]

Toggle quote (4 lines)
> + (chdir "test")
> + (invoke "py.test")
> + (chdir "..")

Also ‘with-directory-excursion’ here.

Toggle quote (3 lines)
> + (home-page
> + "https://bitbucket.org/fenics-project/ufl/")

Single line please. :-)

Otherwise LGTM!

Ludo’.
L
L
Ludovic Courtès wrote on 24 Oct 2018 23:53
Re: [bug#33059] [PATCH 06/10] gnu: Add python-fenics-fiat.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87h8hbxb8x.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-fenics-fiat): New variable.

[...]

Toggle quote (7 lines)
> + (chdir "test")
> + (invoke "py.test" "unit/")
> + (chdir "..")
> + #t)))))
> + (home-page
> + "https://bitbucket.org/fenics-project/fiat/")

Same here, but otherwise LGTM.
L
L
Ludovic Courtès wrote on 24 Oct 2018 23:55
Re: [bug#33059] [PATCH 07/10] gnu: Add python-fenics-ffc.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87d0rzxb57.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-fenics-ffc): New variable.

[...]

Toggle quote (14 lines)
> + (chdir "test")
> + ;; FIXME: the tests in subdirectory
> + ;; 'unit/ufc/finite_element' require the ffc_factory
> + ;; extension module. This module, located in the 'libs'
> + ;; subdirectory, needs to be built and made accessible
> + ;; prior to running the tests.
> + (invoke "py.test" "unit/" "--ignore=unit/ufc/")
> + (chdir "uflacs")
> + (invoke "py.test" "unit/")
> + (chdir "../..")
> + #t)))))
> + (home-page
> + "https://bitbucket.org/fenics-project/ffc/")

Same! :-)
L
L
Ludovic Courtès wrote on 25 Oct 2018 00:12
Re: [bug#33059] [PATCH 08/10] gnu: Add fenics-dolfin.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87va5rvvss.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (fenics-dolfin): New variable.

[...]

Toggle quote (7 lines)
> + (add-before 'configure 'pre-configure
> + (lambda _
> + (use-modules (ice-9 regex)
> + (ice-9 rdelim)
> + (guix build utils)
> + (rnrs io ports))

Please use #:modules instead of an inner ‘use-modules’ form (which may
or may not work in future Guile versions.)

Toggle quote (20 lines)
> + ;; Add extra include directories required by the unit tests.
> + (with-atomic-file-replacement "test/unit/cpp/CMakeLists.txt"
> + (let ((rx (make-regexp "target_link_libraries")))
> + (lambda (in out)
> + (let loop ()
> + (let ((line (read-line in 'concat)))
> + (if (eof-object? line)
> + #t
> + (begin
> + (display line out)
> + (when (regexp-exec rx line)
> + (display
> + (string-append
> + "target_include_directories("
> + "unittests PRIVATE "
> + "${DOLFIN_SOURCE_DIR} "
> + "${DOLFIN_SOURCE_DIR}/dolfin "
> + "${DOLFIN_BINARY_DIR})\n") out))
> + (loop))))))))

Could this be achieved with a single ‘substitute*’? It looks like that
would be more compact.

Also, perhaps this should be done in a ‘snippet’?

Toggle quote (19 lines)
> + ;; Add extra include directories required by the demo tests.
> + (with-atomic-file-replacement "demo/CMakeLists.txt"
> + (let ((rx (make-regexp "find_package")))
> + (lambda (in out)
> + (let loop ()
> + (let ((line (read-line in 'concat)))
> + (if (eof-object? line)
> + #t
> + (begin
> + (display line out)
> + (when (regexp-exec rx line)
> + (display
> + (string-append
> + "include_directories("
> + "${DOLFIN_SOURCE_DIR} "
> + "${DOLFIN_SOURCE_DIR}/dolfin "
> + "${DOLFIN_BINARY_DIR})\n") out))
> + (loop))))))))))

Same question here.

Toggle quote (11 lines)
> + (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 "

Could we avoid listing all the files here? I’m thinking about something
like ‘scandir’ + ‘delete’.

Toggle quote (36 lines)
> + ;; The source code files for the DOLFIN C++ library are licensed under the
> + ;; GNU Lesser General Public License, version 3 or later, with the
> + ;; following exceptions:
> + ;;
> + ;; bsd-2: cmake/modules/FindAMD.cmake
> + ;; cmake/modules/FindBLASHeader.cmake
> + ;; cmake/modules/FindCHOLMOD.cmake
> + ;; cmake/modules/FindEigen3.cmake
> + ;; cmake/modules/FindMPFR.cmake
> + ;; cmake/modules/FindNumPy.cmake
> + ;; cmake/modules/FindPETSc.cmake
> + ;; cmake/modules/FindPETSc4py.cmake
> + ;; cmake/modules/FindParMETIS.cmake
> + ;; cmake/modules/FindSCOTCH.cmake
> + ;; cmake/modules/FindSLEPc.cmake
> + ;; cmake/modules/FindSLEPc4py.cmake
> + ;; cmake/modules/FindSphinx.cmake
> + ;; cmake/modules/FindSUNDIALS.cmake
> + ;; cmake/modules/FindUFC.cmake
> + ;;
> + ;; bsd-3: cmake/modules/FindBLAS.cmake
> + ;; cmake/modules/FindLAPACK.cmake
> + ;; cmake/modules/FindMPI.cmake
> + ;;
> + ;; public-domain: dolfin/geometry/predicates.cpp
> + ;; dolfin/geometry/predicates.h
> + ;;
> + ;; zlib: dolfin/io/base64.cpp
> + ;; dolfin/io/base64.h
> + ;;
> + ;; expat: dolfin/io/pugiconfig.hpp
> + ;; dolfin/io/pugixml.cpp
> + ;; dolfin/io/pugixml.hpp
> + ;;
> + ;; boost1.0: test/unit/cpp/catch/catch.hpp

Thanks for the detailed licensing review!

IMO we don’t need to list the license of the .cmake files, which are
just build files (likewise, we usually ignore M4 files and shell scripts
found in Autotools-based projects.)

I wonder if we could use our ‘catch’ package and remove ‘catch.hpp’.

That’s it!
L
L
Ludovic Courtès wrote on 25 Oct 2018 00:15
Re: [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87pnvzvvo7.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-fenics-dolfin): New variable.

[...]

Toggle quote (6 lines)
> + (lambda _
> + (use-modules (ice-9 regex)
> + (ice-9 rdelim)
> + (guix build utils)
> + (rnrs io ports))

Rather #:modules.

Toggle quote (6 lines)
> + ;; Exclude tests that require meshes supplied by git-lfs.
> + (with-atomic-file-replacement "demo/test.py"
> + (let ((rx (make-regexp "stem !")))
> + (lambda (in out)
> + (let loop ()

Same question as before about using ‘substitute*’.

Toggle quote (8 lines)
> + (chdir "../demo")
> + ;; Check demos.
> + (invoke "python" "generate-demo-files.py")
> + (and (invoke "python" "-m" "pytest" "-v" "test.py")
> + (invoke "python" "-m" "pytest" "-v" "test.py"
> + "--mpiexec=mpiexec" "--num-proc=3"))
> + (chdir "..")

Rather ‘with-directory-excursion’.

Toggle quote (5 lines)
> + (home-page
> + "https://bitbucket.org/fenics-project/dolfin/")
> + (synopsis
> + "High-level problem solving environment for differential equations")

Single line. :-)
L
L
Ludovic Courtès wrote on 25 Oct 2018 00:17
Re: [bug#33059] [PATCH 10/10] gnu: Add fenics.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)(address . 33059@debbugs.gnu.org)
87k1m7vvjp.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (fenics): New variable.

[...]

Toggle quote (6 lines)
> +;; The FEniCS Project.
> +(define-public fenics
> + (package
> + (inherit python-fenics-dolfin)
> + (name "fenics")))

Would it make sense to simply rename “python-fenics-dolfin” to “fenics”?

I don’t know about Eric but for myself I don’t have anything to add.

Perhaps you can prepare a v2?

Thank you for the big patch series!

Ludo’.
L
L
Ludovic Courtès wrote on 8 Nov 2018 10:23
control message for bug #33059
(address . control@debbugs.gnu.org)
87efbv6hy4.fsf@gnu.org
tags 33059 moreinfo
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 0/9] Add the FEniCS Project, v2 patches
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-1-git-send-email-pgarlick@tourbillion-technology.com
Hi Efraim, Hi Eric, Hi Ludo,

Thank you for your comments on the patch series for the FEniCS Project
packages. I have been able to make changes to address all of the
suggestions with one exception, noted below.

The main differences between the original and v2 patches are:

i) python-mpi4py is now part of (gnu packages mpi)
ii) python-petsc4py is now part of (gnu packages maths)
iii) python-slepc4py is now part of (gnu packages maths)
iv) temporary directory changes use 'with-directory-excursion'
v) 'substitute*' is used in preference to 'with-atomic-file-replacement'
vi) the Guix 'catch' package is used in preference to the bundled version
vii) the 'python-fenics-dolfin' package has been renamed 'fenics'
viii) the 'fenics' package has an updated home-page and synopsis

The remaining suggestion was in the 'fenics-dolfin' package:

Toggle quote (10 lines)
> + (string-append
> + "set(CTEST_CUSTOM_TESTS_IGNORE "
> + "demo_bcs_serial "
> + "demo_bcs_mpi "
> + "demo_eigenvalue_serial "
> + "demo_eigenvalue_mpi "
> + "demo_navier-stokes_serial "

> Could we avoid listing all the files here?

I tried a few ideas to avoid listing the demos to ignore. These are the ones
with the 'git-lfs' links. However, this proved to be awkward.

The source code lists the demos that cmake expects to be present. So, one
may either make a list of demos to ignore (as in the original patch) or delete
the same members from a list to include (plus delete the subdirectories
themselves). Simply deleting the subdirectories from the build directory does
not work. Since they exist as Makefile targets they are re-created by the
'make demos' step.

I think the original method is preferable. An advantage is that users may
readily access the demos if they are using Guix on a host system that has
a git-lfs package available.

Best regards,

Paul.


Paul Garlick (9):
gnu: Add python-mpi4py.
gnu: Add python-petsc4py.
gnu: Add python-slepc4py.
gnu: Add python-fenics-dijitso.
gnu: Add python-fenics-ufl.
gnu: Add python-fenics-fiat.
gnu: Add python-fenics-ffc.
gnu: Add fenics-dolfin.
gnu: Add fenics.

gnu/packages/maths.scm | 72 +++++++
gnu/packages/mpi.scm | 42 ++++
gnu/packages/simulation.scm | 490 +++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 603 insertions(+), 1 deletion(-)

--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 1/9] gnu: Add python-mpi4py.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-2-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/mpi.scm (python-mpi4py): New variable.
---
gnu/packages/mpi.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Toggle diff (66 lines)
diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index fc8aade..f08a7f5 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2017 Dave Love <fx@gnu.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,6 +30,7 @@
#:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system python)
#:use-module (gnu packages)
#:use-module (gnu packages gcc)
#:use-module (gnu packages linux)
@@ -263,3 +265,43 @@ only provides @code{MPI_THREAD_FUNNELED}.")))
;; in the build environment than the package wants while testing.
(setenv "OMPI_MCA_rmaps_base_oversubscribe" "yes")
#t))
+
+(define-public python-mpi4py
+ (package
+ (name "python-mpi4py")
+ (version "3.0.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "mpi4py" version))
+ (sha256
+ (base32
+ "1mzgd26dfv4vwbci8gq77ss9f0x26i9aqzq9b9vs9ndxhlnv0mxl"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'mpi-setup
+ ,%openmpi-setup)
+ (add-before 'check 'pre-check
+ (lambda _
+ ;; Skip BaseTestSpawn class (causes error 'ompi_dpm_dyn_init()
+ ;; failed --> Returned "Unreachable"' in chroot environment).
+ (substitute* "test/test_spawn.py"
+ (("unittest.skipMPI\\('openmpi\\(<3.0.0\\)'\\)")
+ "unittest.skipMPI('openmpi')"))
+ #t)))))
+ (inputs
+ `(("openmpi" ,openmpi)))
+ (home-page "https://bitbucket.org/mpi4py/mpi4py/")
+ (synopsis "Python bindings for the Message Passing Interface standard")
+ (description "MPI for Python (mpi4py) provides bindings of the Message
+Passing Interface (MPI) standard for the Python programming language, allowing
+any Python program to exploit multiple processors.
+
+mpi4py is constructed on top of the MPI-1/MPI-2 specification and provides an
+object oriented interface which closely follows MPI-2 C++ bindings. It
+supports point-to-point and collective communications of any picklable Python
+object as well as optimized communications of Python objects (such as NumPy
+arrays) that expose a buffer interface.")
+ (license bsd-3)))
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 2/9] gnu: Add python-petsc4py.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-3-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/maths.scm (python-petsc4py): New variable.
---
gnu/packages/maths.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0d040bf..e36a574 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1808,6 +1808,41 @@ scientific applications modeled by partial differential equations.")
,@(delete "--with-mpi=0" ,cf)))))
(synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
+(define-public python-petsc4py
+ (package
+ (name "python-petsc4py")
+ (version "3.9.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "petsc4py" version))
+ (sha256
+ (base32
+ "1f8zd1ac9irsgkyqmzq30d9kl10fy1nh6zk312dhs43g449fkkhc"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'pre-build
+ (lambda _
+ ;; Define path to PETSc installation.
+ (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
+ #t))
+ (add-before 'check 'mpi-setup
+ ,%openmpi-setup))))
+ (inputs
+ `(("petsc" ,petsc-openmpi)
+ ("python-numpy" ,python-numpy)))
+ (home-page "https://bitbucket.org/petsc/petsc4py/")
+ (synopsis "Python bindings for PETSc")
+ (description "PETSc, the Portable, Extensible Toolkit for
+Scientific Computation, is a suite of data structures and routines for
+the scalable (parallel) solution of scientific applications modeled by
+partial differential equations. It employs the MPI standard for all
+message-passing communication. @code{petsc4py} provides Python
+bindings to almost all functions of PETSc.")
+ (license license:bsd-3)))
+
(define-public python-kiwisolver
(package
(name "python-kiwisolver")
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 3/9] gnu: Add python-slepc4py.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-4-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/maths.scm (python-slepc4py): New variable.
---
gnu/packages/maths.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index e36a574..b1cddfd 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1974,6 +1974,43 @@ arising after the discretization of partial differential equations.")
,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
(synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
+(define-public python-slepc4py
+ (package
+ (name "python-slepc4py")
+ (version "3.9.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "slepc4py" version))
+ (sha256
+ (base32
+ "02xr0vndgibgkz3rgprqk05n3mk5mpgqw550sr4681vcsgz4zvb7"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'pre-build
+ (lambda _
+ ;; Define path to PETSc installation.
+ (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
+ ;; Define path to SLEPc installation.
+ (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
+ #t))
+ (add-before 'check 'mpi-setup
+ ,%openmpi-setup))))
+ (inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-petsc4py" ,python-petsc4py)
+ ("slepc" ,slepc-openmpi)))
+ (home-page "https://bitbucket.org/slepc/slepc4py/")
+ (synopsis "Python bindings for SLEPc")
+ (description "SLEPc, the Scalable Library for Eigenvalue Problem
+Computations, is based on PETSc, the Portable, Extensible Toolkit for
+Scientific Computation. It employs the MPI standard for all
+message-passing communication. @code{slepc4py} provides Python
+bindings to almost all functions of SLEPc.")
+ (license license:bsd-3)))
+
(define-public mumps
(package
(name "mumps")
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 4/9] gnu: Add python-fenics-dijitso.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-5-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-dijitso): New varaible.
---
gnu/packages/simulation.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)

Toggle diff (87 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index a5b661e..86b1aba 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
+;;; Copyright © 2017, 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -22,6 +22,7 @@
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
+ #:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages flex)
#:use-module (gnu packages gettext)
@@ -35,6 +36,7 @@
#:use-module (gnu packages mpi)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
+ #:use-module (gnu packages python)
#:use-module (gnu packages readline)
#:use-module (gnu packages tls)
#:use-module (gnu packages version-control)
@@ -43,6 +45,7 @@
#:use-module (guix download)
#:use-module (guix build utils)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system python)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -221,3 +224,49 @@ with gas/liquid interfaces. Large problems may be split into smaller, connected
problems for efficient solution on parallel systems.")
(license license:gpl3+)
(home-page "https://openfoam.org")))
+
+(define-public python-fenics-dijitso
+ (package
+ (name "python-fenics-dijitso")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-dijitso" version))
+ (sha256
+ (base32
+ "1qax2f52qsjbd1h5lk5i5shp448qlakxabjjybrfc1w823p0yql9"))))
+ (build-system python-build-system)
+ (inputs
+ `(("openmpi" ,openmpi)
+ ("python-numpy" ,python-numpy)))
+ (native-inputs
+ `(("python-pytest-cov" ,python-pytest-cov)))
+ (propagated-inputs
+ `(("python-mpi4py" ,python-mpi4py)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'mpi-setup
+ ,%openmpi-setup)
+ (replace 'check
+ (lambda _
+ (setenv "HOME" "/tmp")
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (with-directory-excursion "test"
+ (invoke "./runtests.sh"))
+ #t)))))
+ (home-page "https://bitbucket.org/fenics-project/dijitso/")
+ (synopsis "Distributed just-in-time building of shared libraries")
+ (description
+ "Dijitso provides a core component of the @code{FEniCS} framework,
+namely the just-in-time compilation of C++ code that is generated from
+Python modules. It is called from within a C++ library, using ctypes
+to import the dynamic shared library directly.
+
+As long as the compiled code can provide a simple factory function to
+a class implementing a predefined C++ interface, there is no limit to
+the complexity of that interface. Parallel support depends on the
+@code{mpi4py} interface.")
+ (license license:lgpl3+)))
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 5/9] gnu: Add python-fenics-ufl.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-6-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-ufl): New variable.
---
gnu/packages/simulation.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 86b1aba..7165fb5 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -270,3 +270,40 @@ a class implementing a predefined C++ interface, there is no limit to
the complexity of that interface. Parallel support depends on the
@code{mpi4py} interface.")
(license license:lgpl3+)))
+
+(define-public python-fenics-ufl
+ (package
+ (name "python-fenics-ufl")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-ufl" version))
+ (sha256
+ (base32
+ "1fq8yc86s1s3c8c0b1rc2vf265q0hrkzg57100fg1nghcz0p4vla"))))
+ (build-system python-build-system)
+ (inputs
+ `(("python-numpy" ,python-numpy)))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (with-directory-excursion "test"
+ (invoke "py.test"))
+ #t)))))
+ (home-page "https://bitbucket.org/fenics-project/ufl/")
+ (synopsis "Unified language for form-compilers")
+ (description "The Unified Form Language (UFL) is a domain specific
+language for declaration of finite element discretizations of
+variational forms. More precisely, it defines a flexible interface
+for choosing finite element spaces and defining expressions for weak
+forms in a notation close to mathematical notation.
+
+UFL is part of the FEniCS Project.")
+ (license license:lgpl3+)))
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 6/9] gnu: Add python-fenics-fiat.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-7-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-fiat): New variable.
---
gnu/packages/simulation.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 7165fb5..ecdb2b2 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -307,3 +307,45 @@ forms in a notation close to mathematical notation.
UFL is part of the FEniCS Project.")
(license license:lgpl3+)))
+
+(define-public python-fenics-fiat
+ (package
+ (name "python-fenics-fiat")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-fiat" version))
+ (sha256
+ (base32
+ "0fmjd93r6bwf6xs8csw86qzphrnr66xwv7f372w59gmq8mg6rljc"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-sympy" ,python-sympy)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (with-directory-excursion "test"
+ (invoke "py.test" "unit/"))
+ #t)))))
+ (home-page "https://bitbucket.org/fenics-project/fiat/")
+ (synopsis "Tabulation of finite element function spaces")
+ (description
+ "The FInite element Automatic Tabulator (FIAT) supports
+generation of arbitrary order instances of the Lagrange elements on
+lines, triangles, and tetrahedra. It is also capable of generating
+arbitrary order instances of Jacobi-type quadrature rules on the same
+element shapes. Further, H(div) and H(curl) conforming finite element
+spaces such as the families of Raviart-Thomas, Brezzi-Douglas-Marini
+and Nedelec are supported on triangles and tetrahedra. Upcoming
+versions will also support Hermite and nonconforming elements.
+
+FIAT is part of the FEniCS Project.")
+ (license license:lgpl3+)))
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 7/9] gnu: Add python-fenics-ffc.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-8-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (python-fenics-ffc): New variable.
---
gnu/packages/simulation.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index ecdb2b2..d1a5e46 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -349,3 +349,55 @@ versions will also support Hermite and nonconforming elements.
FIAT is part of the FEniCS Project.")
(license license:lgpl3+)))
+
+(define-public python-fenics-ffc
+ (package
+ (name "python-fenics-ffc")
+ (version "2018.1.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fenics-ffc" version))
+ (sha256
+ (base32
+ "1b2ia5vlkw298x7rf0k2p3ihlpwkwgc98p3s6sbpds3hqmfrzdz9"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (propagated-inputs
+ `(("python-fenics-dijitso" ,python-fenics-dijitso)
+ ("python-fenics-fiat" ,python-fenics-fiat)
+ ("python-fenics-ufl" ,python-fenics-ufl)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (setenv "HOME" (getcwd))
+ (setenv "PYTHONPATH"
+ (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+ (with-directory-excursion "test"
+ ;; FIXME: the tests in subdirectory
+ ;; 'unit/ufc/finite_element' require the ffc_factory
+ ;; extension module. This module, located in the 'libs'
+ ;; subdirectory, needs to be built and made accessible
+ ;; prior to running the tests.
+ (invoke "py.test" "unit/" "--ignore=unit/ufc/")
+ (with-directory-excursion "uflacs"
+ (invoke "py.test" "unit/")))
+ #t)))))
+ (home-page "https://bitbucket.org/fenics-project/ffc/")
+ (synopsis "Compiler for finite element variational forms")
+ (description "The FEniCS Form Compiler (FFC) is a compiler for
+finite element variational forms. From a high-level description of
+the form, it generates efficient low-level C++ code that can be used
+to assemble the corresponding discrete operator (tensor). In
+particular, a bilinear form may be assembled into a matrix and a
+linear form may be assembled into a vector. FFC may be used either
+from the command line (by invoking the @code{ffc} command) or as a
+Python module (@code{import ffc}).
+
+FFC is part of the FEniCS Project.")
+ ;; There are two files released with a public domain licence;
+ ;; ufc.h and ufc_geometry.h, in subdirectory 'ffc/backends/ufc'.
+ (license (list license:public-domain license:lgpl3+))))
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 8/9] gnu: Add fenics-dolfin.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-9-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (fenics-dolfin): New variable.
---
gnu/packages/simulation.scm | 191 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 191 insertions(+)

Toggle diff (227 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index d1a5e46..bd139d3 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -18,11 +18,13 @@
(define-module (gnu packages simulation)
#:use-module (gnu packages)
+ #:use-module (gnu packages algebra)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
+ #:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages flex)
#:use-module (gnu packages gettext)
@@ -36,6 +38,7 @@
#:use-module (gnu packages mpi)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages readline)
#:use-module (gnu packages tls)
@@ -44,6 +47,7 @@
#:use-module (gnu packages xorg)
#:use-module (guix download)
#:use-module (guix build utils)
+ #:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module ((guix licenses) #:prefix license:)
@@ -401,3 +405,190 @@ FFC is part of the FEniCS Project.")
;; There are two files released with a public domain licence;
;; ufc.h and ufc_geometry.h, in subdirectory 'ffc/backends/ufc'.
(license (list license:public-domain license:lgpl3+))))
+
+(define-public fenics-dolfin
+ (package
+ (name "fenics-dolfin")
+ (version "2018.1.0.post1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://bitbucket.org/fenics-project/dolfin/get/"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "12zkk8j3xsg6l8p0ggwsl03084vlcivw4h99b7z9kndg7k89b3ya"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Make sure we don't use the bundled test framework.
+ (delete-file-recursively "test/unit/cpp/catch")
+ (substitute* "test/unit/cpp/main.cpp"
+ ;; Use standard search paths for 'catch' header file.
+ (("#include.*")
+ "#include <catch.hpp>\n"))
+ (substitute* "test/unit/cpp/CMakeLists.txt"
+ ;; Add extra include directories required by the unit tests.
+ (("(^target_link_libraries.*)" line)
+ (string-append line "\n"
+ "target_include_directories("
+ "unittests PRIVATE "
+ "${DOLFIN_SOURCE_DIR} "
+ "${DOLFIN_SOURCE_DIR}/dolfin "
+ "${DOLFIN_BINARY_DIR})\n"))
+ (("(^set\\(CATCH_INCLUDE_DIR ).*(/catch\\))" _ front back)
+ (string-append front
+ "$ENV{CATCH_DIR}"
+ "/include" back "\n")))
+ (substitute* "demo/CMakeLists.txt"
+ ;; Add extra include directories required by the demo tests.
+ (("(^#find_package.*)" line)
+ (string-append line "\n"
+ "include_directories("
+ "${DOLFIN_SOURCE_DIR} "
+ "${DOLFIN_SOURCE_DIR}/dolfin "
+ "${DOLFIN_BINARY_DIR})\n")))
+ #t))))
+ (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)))
+ (native-inputs
+ `(("catch" ,catch-framework2)
+ ("pkg-config" ,pkg-config)))
+ (propagated-inputs
+ `(("ffc" ,python-fenics-ffc)
+ ("petsc" ,petsc-openmpi)
+ ("slepc" ,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"))
+ #t))
+ (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.
+ ;;
+ ;; Two other serial tests fail and are skipped.
+ ;; i) demo_stokes-iterative_serial,
+ ;; The MPI_Comm_rank() function was called before MPI_INIT was
+ ;; invoked
+ ;; ii) 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 "
+ "demo_stokes-iterative_serial "
+ "demo_stokes-iterative_mpi "
+ ")\n") port)))
+ #t))
+ (replace 'check
+ (lambda _
+ (and (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
+ "DOLFIN is a computational framework for finding numerical
+solutions to problems described by differential equations. Numerical
+models in DOLFIN are constructed using general families of finite
+elements. Data structures are provided for discretizing the governing
+system on a computational mesh. A compact syntax, similar to
+mathematical notation, is made available for defining function spaces
+and expressing variational forms. Interfaces to specialized matrix
+solvers are provided for solving the resultant linear systems.
+
+@code{fenics-dolfin} is part of the FEniCS project. It is the C++
+user interface to the FEniCS core components and external libraries.")
+ ;; The source code for the DOLFIN C++ library is licensed under the
+ ;; GNU Lesser General Public License, version 3 or later, with the
+ ;; following exceptions:
+ ;;
+ ;; public-domain: dolfin/geometry/predicates.cpp
+ ;; dolfin/geometry/predicates.h
+ ;;
+ ;; zlib: dolfin/io/base64.cpp
+ ;; dolfin/io/base64.h
+ ;;
+ ;; expat: dolfin/io/pugiconfig.hpp
+ ;; dolfin/io/pugixml.cpp
+ ;; dolfin/io/pugixml.hpp
+ (license (list license:public-domain
+ license:zlib
+ license:expat
+ license:lgpl3+))))
--
1.8.3.1
P
P
Paul Garlick wrote on 12 Nov 2018 17:00
[PATCH v2 9/9] gnu: Add fenics.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
1542038441-5738-10-git-send-email-pgarlick@tourbillion-technology.com
* gnu/packages/simulation.scm (fenics): New variable.
---
gnu/packages/simulation.scm | 117 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 117 insertions(+)

Toggle diff (127 lines)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index bd139d3..6144e23 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -592,3 +592,120 @@ user interface to the FEniCS core components and external libraries.")
license:zlib
license:expat
license:lgpl3+))))
+
+(define-public fenics
+ (package (inherit fenics-dolfin)
+ (name "fenics")
+ (build-system python-build-system)
+ (inputs
+ `(("pybind11" ,pybind11)
+ ("python-matplotlib" ,python-matplotlib)
+ ,@(alist-delete "python" (package-inputs fenics-dolfin))))
+ (native-inputs
+ `(("cmake" ,cmake)
+ ("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)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (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")
+ #t))
+ (add-after 'build 'mpi-setup
+ ,%openmpi-setup)
+ (add-before 'check 'pre-check
+ (lambda _
+ ;; Exclude tests that require meshes supplied by git-lfs.
+ (substitute* "demo/test.py"
+ (("(.*stem !.*)" line)
+ (string-append
+ line "\n"
+ "excludeList = [\n"
+ "'multimesh-quadrature', \n"
+ "'multimesh-marking', \n"
+ "'mixed-poisson-sphere', \n"
+ "'mesh-quality', \n"
+ "'lift-drag', \n"
+ "'elastodynamics', \n"
+ "'dg-advection-diffusion', \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))
+ (setenv "PYTHONPATH"
+ (string-append
+ (getcwd) "/build/lib.linux-x86_64-"
+ ,(version-major+minor (package-version python)) ":"
+ (getenv "PYTHONPATH")))
+ ;; Restrict OpenBLAS to MPI-only in preference to MPI+OpenMP.
+ (setenv "OPENBLAS_NUM_THREADS" "1")
+ #t))
+ (replace 'check
+ (lambda _
+ (with-directory-excursion "test"
+ ;; Note: The test test_snes_set_from_options() in the file
+ ;; unit/nls/test_PETScSNES_solver.py fails and is ignored.
+ (and (invoke "py.test" "unit" "--ignore"
+ "unit/nls/test_PETScSNES_solver.py")
+ (invoke "mpirun" "-np" "3" "python" "-B" "-m"
+ "pytest" "unit" "--ignore"
+ "unit/nls/test_PETScSNES_solver.py")))
+ (with-directory-excursion "demo"
+ ;; Check demos.
+ (invoke "python" "generate-demo-files.py")
+ (and (invoke "python" "-m" "pytest" "-v" "test.py")
+ (invoke "python" "-m" "pytest" "-v" "test.py"
+ "--mpiexec=mpiexec" "--num-proc=3")))
+ #t))
+ (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)$"))))
+ #t)))))
+ (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
+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
+equations such as these are commonly encountered in areas of engineering,
+mathematics and the physical sciences. It is particularly well-suited to
+problems that can be solved using the Finite Element Method (FEM).
+
+@code{fenics} is the top level of the set of packages that are developed
+within the FEniCS project. It provides the python user interface to the
+FEniCS core components and external libraries.")
+ (license license:lgpl3+)))
--
1.8.3.1
L
L
Ludovic Courtès wrote on 14 Nov 2018 21:38
Re: [PATCH v2 0/9] Add the FEniCS Project, v2 patches
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
87zhubcs2v.fsf@gnu.org
Hello Paul and all,

Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (43 lines)
> Hi Efraim, Hi Eric, Hi Ludo,
>
> Thank you for your comments on the patch series for the FEniCS Project
> packages. I have been able to make changes to address all of the
> suggestions with one exception, noted below.
>
> The main differences between the original and v2 patches are:
>
> i) python-mpi4py is now part of (gnu packages mpi)
> ii) python-petsc4py is now part of (gnu packages maths)
> iii) python-slepc4py is now part of (gnu packages maths)
> iv) temporary directory changes use 'with-directory-excursion'
> v) 'substitute*' is used in preference to 'with-atomic-file-replacement'
> vi) the Guix 'catch' package is used in preference to the bundled version
> vii) the 'python-fenics-dolfin' package has been renamed 'fenics'
> viii) the 'fenics' package has an updated home-page and synopsis
>
> The remaining suggestion was in the 'fenics-dolfin' package:
>
>> + (string-append
>> + "set(CTEST_CUSTOM_TESTS_IGNORE "
>> + "demo_bcs_serial "
>> + "demo_bcs_mpi "
>> + "demo_eigenvalue_serial "
>> + "demo_eigenvalue_mpi "
>> + "demo_navier-stokes_serial "
>
>> Could we avoid listing all the files here?
>
> I tried a few ideas to avoid listing the demos to ignore. These are the ones
> with the 'git-lfs' links. However, this proved to be awkward.
>
> The source code lists the demos that cmake expects to be present. So, one
> may either make a list of demos to ignore (as in the original patch) or delete
> the same members from a list to include (plus delete the subdirectories
> themselves). Simply deleting the subdirectories from the build directory does
> not work. Since they exist as Makefile targets they are re-created by the
> 'make demos' step.
>
> I think the original method is preferable. An advantage is that users may
> readily access the demos if they are using Guix on a host system that has
> a git-lfs package available.

Thanks a lot for taking the time to address the comments we made on this
patch series. I’ve applied the whole series on ‘master’; everything
lints and builds for me on x86_64-linux (there are new versions of the
PETSc and SLEPSc bindings available, BTW.)

Thank you!

Ludo’.
Closed
L
L
Ludovic Courtès wrote on 14 Nov 2018 22:11
Re: [PATCH v2 6/9] gnu: Add python-fenics-fiat.
(name . Paul Garlick)(address . pgarlick@tourbillion-technology.com)
87r2fnbc07.fsf@gnu.org
Paul Garlick <pgarlick@tourbillion-technology.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/simulation.scm (python-fenics-fiat): New variable.

Apparently this one has a test failure on i686-linux:


It’s not uncommon for numerical software tests to break on 32-bit
platforms. Perhaps you could ask upstream what they think about it?

Thanks,
Ludo’.
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 33059
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