all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#33059] [PATCH 00/10] Add the FEniCS Project
@ 2018-10-16  9:17 Paul Garlick
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
  0 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:17 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

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

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py.
  2018-10-16  9:17 [bug#33059] [PATCH 00/10] Add the FEniCS Project Paul Garlick
@ 2018-10-16  9:31 ` Paul Garlick
  2018-10-16  9:31   ` [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py Paul Garlick
                     ` (10 more replies)
  0 siblings, 11 replies; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

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

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 21:45     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 03/10] gnu: Add python-slepc4py Paul Garlick
                     ` (9 subsequent siblings)
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-petsc4py): New variable.
---
 gnu/packages/simulation.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 03/10] gnu: Add python-slepc4py.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
  2018-10-16  9:31   ` [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 21:46     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso Paul Garlick
                     ` (8 subsequent siblings)
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-slepc4py): New variable.
---
 gnu/packages/simulation.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
  2018-10-16  9:31   ` [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py Paul Garlick
  2018-10-16  9:31   ` [bug#33059] [PATCH 03/10] gnu: Add python-slepc4py Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-16 18:30     ` Efraim Flashner
  2018-10-24 21:48     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 05/10] gnu: Add python-fenics-ufl Paul Garlick
                     ` (7 subsequent siblings)
  10 siblings, 2 replies; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-dijitso): New varaible.
---
 gnu/packages/simulation.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 05/10] gnu: Add python-fenics-ufl.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (2 preceding siblings ...)
  2018-10-16  9:31   ` [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 21:52     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 06/10] gnu: Add python-fenics-fiat Paul Garlick
                     ` (6 subsequent siblings)
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-ufl): New variable.
---
 gnu/packages/simulation.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 06/10] gnu: Add python-fenics-fiat.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (3 preceding siblings ...)
  2018-10-16  9:31   ` [bug#33059] [PATCH 05/10] gnu: Add python-fenics-ufl Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 21:53     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 07/10] gnu: Add python-fenics-ffc Paul Garlick
                     ` (5 subsequent siblings)
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-fiat): New variable.
---
 gnu/packages/simulation.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 07/10] gnu: Add python-fenics-ffc.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (4 preceding siblings ...)
  2018-10-16  9:31   ` [bug#33059] [PATCH 06/10] gnu: Add python-fenics-fiat Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 21:55     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 08/10] gnu: Add fenics-dolfin Paul Garlick
                     ` (4 subsequent siblings)
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-ffc): New variable.
---
 gnu/packages/simulation.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 08/10] gnu: Add fenics-dolfin.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (5 preceding siblings ...)
  2018-10-16  9:31   ` [bug#33059] [PATCH 07/10] gnu: Add python-fenics-ffc Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 22:12     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin Paul Garlick
                     ` (3 subsequent siblings)
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (fenics-dolfin): New variable.
---
 gnu/packages/simulation.scm | 228 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 228 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (6 preceding siblings ...)
  2018-10-16  9:31   ` [bug#33059] [PATCH 08/10] gnu: Add fenics-dolfin Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 22:15     ` Ludovic Courtès
  2018-10-16  9:31   ` [bug#33059] [PATCH 10/10] gnu: Add fenics Paul Garlick
                     ` (2 subsequent siblings)
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-dolfin): New variable.
---
 gnu/packages/simulation.scm | 147 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 10/10] gnu: Add fenics.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (7 preceding siblings ...)
  2018-10-16  9:31   ` [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin Paul Garlick
@ 2018-10-16  9:31   ` Paul Garlick
  2018-10-24 22:17     ` Ludovic Courtès
  2018-10-19 16:03   ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Eric Bavier
  2018-10-24 21:44   ` Ludovic Courtès
  10 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-10-16  9:31 UTC (permalink / raw)
  To: 33059; +Cc: Paul Garlick

* gnu/packages/simulation.scm (fenics): New variable.
---
 gnu/packages/simulation.scm | 6 ++++++
 1 file changed, 6 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso.
  2018-10-16  9:31   ` [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso Paul Garlick
@ 2018-10-16 18:30     ` Efraim Flashner
  2018-10-17  9:09       ` Paul Garlick
  2018-10-24 21:48     ` Ludovic Courtès
  1 sibling, 1 reply; 37+ messages in thread
From: Efraim Flashner @ 2018-10-16 18:30 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

On Tue, Oct 16, 2018 at 10:31:18AM +0100, Paul Garlick wrote:

> +             (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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso.
  2018-10-16 18:30     ` Efraim Flashner
@ 2018-10-17  9:09       ` Paul Garlick
  0 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-10-17  9:09 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 33059

Hi Efraim,

> > +             (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.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (8 preceding siblings ...)
  2018-10-16  9:31   ` [bug#33059] [PATCH 10/10] gnu: Add fenics Paul Garlick
@ 2018-10-19 16:03   ` Eric Bavier
  2018-10-22  8:51     ` Paul Garlick
  2018-10-24 21:44   ` Ludovic Courtès
  10 siblings, 1 reply; 37+ messages in thread
From: Eric Bavier @ 2018-10-19 16:03 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

On Tue, 16 Oct 2018 10:31:15 +0100
Paul Garlick <pgarlick@tourbillion-technology.com> wrote:

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py.
  2018-10-19 16:03   ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Eric Bavier
@ 2018-10-22  8:51     ` Paul Garlick
  0 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-10-22  8:51 UTC (permalink / raw)
  To: Eric Bavier; +Cc: 33059

Hi Eric,

> 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.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py.
  2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
                     ` (9 preceding siblings ...)
  2018-10-19 16:03   ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Eric Bavier
@ 2018-10-24 21:44   ` Ludovic Courtès
  10 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 21:44 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

Hi Paul,

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

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

I agree with Eric’s suggestion but otherwise LGTM.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py.
  2018-10-16  9:31   ` [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py Paul Garlick
@ 2018-10-24 21:45     ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 21:45 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

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

Apart from that it LGTM.

Ludo’.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 03/10] gnu: Add python-slepc4py.
  2018-10-16  9:31   ` [bug#33059] [PATCH 03/10] gnu: Add python-slepc4py Paul Garlick
@ 2018-10-24 21:46     ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 21:46 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

LGTM.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso.
  2018-10-16  9:31   ` [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso Paul Garlick
  2018-10-16 18:30     ` Efraim Flashner
@ 2018-10-24 21:48     ` Ludovic Courtès
  1 sibling, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 21:48 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

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

Nitpick:

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

Indentation is off.

> +    (synopsis
> +      "Distributed just-in-time building of shared libraries")

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

Otherwise LGTM, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 05/10] gnu: Add python-fenics-ufl.
  2018-10-16  9:31   ` [bug#33059] [PATCH 05/10] gnu: Add python-fenics-ufl Paul Garlick
@ 2018-10-24 21:52     ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 21:52 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

[...]

> +             (chdir "test")
> +             (invoke "py.test")
> +             (chdir "..")

Also ‘with-directory-excursion’ here.

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

Single line please.  :-)

Otherwise LGTM!

Ludo’.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 06/10] gnu: Add python-fenics-fiat.
  2018-10-16  9:31   ` [bug#33059] [PATCH 06/10] gnu: Add python-fenics-fiat Paul Garlick
@ 2018-10-24 21:53     ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 21:53 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

[...]

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

Same here, but otherwise LGTM.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 07/10] gnu: Add python-fenics-ffc.
  2018-10-16  9:31   ` [bug#33059] [PATCH 07/10] gnu: Add python-fenics-ffc Paul Garlick
@ 2018-10-24 21:55     ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 21:55 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

[...]

> +             (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!  :-)

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 08/10] gnu: Add fenics-dolfin.
  2018-10-16  9:31   ` [bug#33059] [PATCH 08/10] gnu: Add fenics-dolfin Paul Garlick
@ 2018-10-24 22:12     ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 22:12 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

[...]

> +         (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.)

> +             ;; 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’?

> +             ;; 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.

> +             (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’.

> +    ;; 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!

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin.
  2018-10-16  9:31   ` [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin Paul Garlick
@ 2018-10-24 22:15     ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 22:15 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

[...]

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

Rather #:modules.

> +             ;; 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*’.

> +             (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’.

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

Single line.  :-)

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH 10/10] gnu: Add fenics.
  2018-10-16  9:31   ` [bug#33059] [PATCH 10/10] gnu: Add fenics Paul Garlick
@ 2018-10-24 22:17     ` Ludovic Courtès
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
  0 siblings, 1 reply; 37+ messages in thread
From: Ludovic Courtès @ 2018-10-24 22:17 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

> * gnu/packages/simulation.scm (fenics): New variable.

[...]

> +;; 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’.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches
  2018-10-24 22:17     ` Ludovic Courtès
@ 2018-11-12 16:00       ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 1/9] gnu: Add python-mpi4py Paul Garlick
                           ` (9 more replies)
  0 siblings, 10 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

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.

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

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 1/9] gnu: Add python-mpi4py.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 2/9] gnu: Add python-petsc4py Paul Garlick
                           ` (8 subsequent siblings)
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/mpi.scm (python-mpi4py): New variable.
---
 gnu/packages/mpi.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 2/9] gnu: Add python-petsc4py.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 1/9] gnu: Add python-mpi4py Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 3/9] gnu: Add python-slepc4py Paul Garlick
                           ` (7 subsequent siblings)
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/maths.scm (python-petsc4py): New variable.
---
 gnu/packages/maths.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 3/9] gnu: Add python-slepc4py.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 1/9] gnu: Add python-mpi4py Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 2/9] gnu: Add python-petsc4py Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 4/9] gnu: Add python-fenics-dijitso Paul Garlick
                           ` (6 subsequent siblings)
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/maths.scm (python-slepc4py): New variable.
---
 gnu/packages/maths.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 4/9] gnu: Add python-fenics-dijitso.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
                           ` (2 preceding siblings ...)
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 3/9] gnu: Add python-slepc4py Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 5/9] gnu: Add python-fenics-ufl Paul Garlick
                           ` (5 subsequent siblings)
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-dijitso): New varaible.
---
 gnu/packages/simulation.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 5/9] gnu: Add python-fenics-ufl.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
                           ` (3 preceding siblings ...)
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 4/9] gnu: Add python-fenics-dijitso Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 6/9] gnu: Add python-fenics-fiat Paul Garlick
                           ` (4 subsequent siblings)
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-ufl): New variable.
---
 gnu/packages/simulation.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 6/9] gnu: Add python-fenics-fiat.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
                           ` (4 preceding siblings ...)
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 5/9] gnu: Add python-fenics-ufl Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-14 21:11           ` Ludovic Courtès
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 7/9] gnu: Add python-fenics-ffc Paul Garlick
                           ` (3 subsequent siblings)
  9 siblings, 1 reply; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-fiat): New variable.
---
 gnu/packages/simulation.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 7/9] gnu: Add python-fenics-ffc.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
                           ` (5 preceding siblings ...)
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 6/9] gnu: Add python-fenics-fiat Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 8/9] gnu: Add fenics-dolfin Paul Garlick
                           ` (2 subsequent siblings)
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/simulation.scm (python-fenics-ffc): New variable.
---
 gnu/packages/simulation.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 8/9] gnu: Add fenics-dolfin.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
                           ` (6 preceding siblings ...)
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 7/9] gnu: Add python-fenics-ffc Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 9/9] gnu: Add fenics Paul Garlick
  2018-11-14 20:38         ` bug#33059: [PATCH v2 0/9] Add the FEniCS Project, v2 patches Ludovic Courtès
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/simulation.scm (fenics-dolfin): New variable.
---
 gnu/packages/simulation.scm | 191 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 191 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 9/9] gnu: Add fenics.
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
                           ` (7 preceding siblings ...)
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 8/9] gnu: Add fenics-dolfin Paul Garlick
@ 2018-11-12 16:00         ` Paul Garlick
  2018-11-14 20:38         ` bug#33059: [PATCH v2 0/9] Add the FEniCS Project, v2 patches Ludovic Courtès
  9 siblings, 0 replies; 37+ messages in thread
From: Paul Garlick @ 2018-11-12 16:00 UTC (permalink / raw)
  To: 33059, Efraim Flashner, Eric Bavier, Ludovic Courtès; +Cc: Paul Garlick

* gnu/packages/simulation.scm (fenics): New variable.
---
 gnu/packages/simulation.scm | 117 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* bug#33059: [PATCH v2 0/9] Add the FEniCS Project, v2 patches
  2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
                           ` (8 preceding siblings ...)
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 9/9] gnu: Add fenics Paul Garlick
@ 2018-11-14 20:38         ` Ludovic Courtès
  9 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-11-14 20:38 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059-done

Hello Paul and all,

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

> 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’.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [bug#33059] [PATCH v2 6/9] gnu: Add python-fenics-fiat.
  2018-11-12 16:00         ` [bug#33059] [PATCH v2 6/9] gnu: Add python-fenics-fiat Paul Garlick
@ 2018-11-14 21:11           ` Ludovic Courtès
  0 siblings, 0 replies; 37+ messages in thread
From: Ludovic Courtès @ 2018-11-14 21:11 UTC (permalink / raw)
  To: Paul Garlick; +Cc: 33059

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

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

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

  https://berlin.guixsd.org/build/623722/log/raw

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’.

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2018-11-14 21:12 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16  9:17 [bug#33059] [PATCH 00/10] Add the FEniCS Project Paul Garlick
2018-10-16  9:31 ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Paul Garlick
2018-10-16  9:31   ` [bug#33059] [PATCH 02/10] gnu: Add python-petsc4py Paul Garlick
2018-10-24 21:45     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 03/10] gnu: Add python-slepc4py Paul Garlick
2018-10-24 21:46     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 04/10] gnu: Add python-fenics-dijitso Paul Garlick
2018-10-16 18:30     ` Efraim Flashner
2018-10-17  9:09       ` Paul Garlick
2018-10-24 21:48     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 05/10] gnu: Add python-fenics-ufl Paul Garlick
2018-10-24 21:52     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 06/10] gnu: Add python-fenics-fiat Paul Garlick
2018-10-24 21:53     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 07/10] gnu: Add python-fenics-ffc Paul Garlick
2018-10-24 21:55     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 08/10] gnu: Add fenics-dolfin Paul Garlick
2018-10-24 22:12     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin Paul Garlick
2018-10-24 22:15     ` Ludovic Courtès
2018-10-16  9:31   ` [bug#33059] [PATCH 10/10] gnu: Add fenics Paul Garlick
2018-10-24 22:17     ` Ludovic Courtès
2018-11-12 16:00       ` [bug#33059] [PATCH v2 0/9] Add the FEniCS Project, v2 patches Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 1/9] gnu: Add python-mpi4py Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 2/9] gnu: Add python-petsc4py Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 3/9] gnu: Add python-slepc4py Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 4/9] gnu: Add python-fenics-dijitso Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 5/9] gnu: Add python-fenics-ufl Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 6/9] gnu: Add python-fenics-fiat Paul Garlick
2018-11-14 21:11           ` Ludovic Courtès
2018-11-12 16:00         ` [bug#33059] [PATCH v2 7/9] gnu: Add python-fenics-ffc Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 8/9] gnu: Add fenics-dolfin Paul Garlick
2018-11-12 16:00         ` [bug#33059] [PATCH v2 9/9] gnu: Add fenics Paul Garlick
2018-11-14 20:38         ` bug#33059: [PATCH v2 0/9] Add the FEniCS Project, v2 patches Ludovic Courtès
2018-10-19 16:03   ` [bug#33059] [PATCH 01/10] gnu: Add python-mpi4py Eric Bavier
2018-10-22  8:51     ` Paul Garlick
2018-10-24 21:44   ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.