From patchwork Mon Nov 12 16:00:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Garlick X-Patchwork-Id: 186 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 73C63167F7; Mon, 12 Nov 2018 16:04:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 158BA167F5 for ; Mon, 12 Nov 2018 16:04:32 +0000 (GMT) Received: from localhost ([::1]:49368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMEhT-0004S6-ET for patchwork@mira.cbaines.net; Mon, 12 Nov 2018 11:04:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMEhE-0004LC-IH for guix-patches@gnu.org; Mon, 12 Nov 2018 11:04:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMEh8-0004lM-Tl for guix-patches@gnu.org; Mon, 12 Nov 2018 11:04:15 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMEh4-0004hd-7s for guix-patches@gnu.org; Mon, 12 Nov 2018 11:04:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gMEh4-00010E-1Q for guix-patches@gnu.org; Mon, 12 Nov 2018 11:04:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33059] [PATCH v2 9/9] gnu: Add fenics. Resent-From: Paul Garlick Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Nov 2018 16:04:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 33059@debbugs.gnu.org, Efraim Flashner , Eric Bavier , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 33059-submit@debbugs.gnu.org id=B33059.15420386383783 (code B ref 33059); Mon, 12 Nov 2018 16:04:05 +0000 Received: (at 33059) by debbugs.gnu.org; 12 Nov 2018 16:03:58 +0000 Received: from localhost ([127.0.0.1]:48259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMEgv-0000yx-J8 for submit@debbugs.gnu.org; Mon, 12 Nov 2018 11:03:57 -0500 Received: from smtp.hosts.co.uk ([85.233.160.19]:63214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMEgu-0000yX-Ef for 33059@debbugs.gnu.org; Mon, 12 Nov 2018 11:03:56 -0500 Received: from [79.123.23.187] (helo=parkin.tourbillion-technology.com.com) by smtp.hosts.co.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim) (envelope-from ) id 1gMEgo-000500-7G; Mon, 12 Nov 2018 16:03:50 +0000 From: Paul Garlick Date: Mon, 12 Nov 2018 16:00:41 +0000 Message-Id: <1542038441-5738-10-git-send-email-pgarlick@tourbillion-technology.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1542038441-5738-1-git-send-email-pgarlick@tourbillion-technology.com> References: <87k1m7vvjp.fsf@gnu.org> <1542038441-5738-1-git-send-email-pgarlick@tourbillion-technology.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Garlick Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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+)))