all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Garlick <pgarlick@tourbillion-technology.com>
To: 33059@debbugs.gnu.org
Cc: Paul Garlick <pgarlick@tourbillion-technology.com>
Subject: [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin.
Date: Tue, 16 Oct 2018 10:31:23 +0100	[thread overview]
Message-ID: <1539682284-6446-9-git-send-email-pgarlick@tourbillion-technology.com> (raw)
In-Reply-To: <1539682284-6446-1-git-send-email-pgarlick@tourbillion-technology.com>

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

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

  parent reply	other threads:[~2018-10-16  9:34 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Paul Garlick [this message]
2018-10-24 22:15     ` [bug#33059] [PATCH 09/10] gnu: Add python-fenics-dolfin 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1539682284-6446-9-git-send-email-pgarlick@tourbillion-technology.com \
    --to=pgarlick@tourbillion-technology.com \
    --cc=33059@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.