From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Gradl Subject: [PATCH] gnu: add sparta-dsmc Date: Mon, 4 Apr 2016 15:55:51 -0500 Message-ID: <20160404205551.GB16062@serenity.ph.utexas.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anBY7-0001Yl-BQ for guix-devel@gnu.org; Mon, 04 Apr 2016 16:56:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anBY4-0000R6-4a for guix-devel@gnu.org; Mon, 04 Apr 2016 16:56:39 -0400 Received: from smtp12.openmailbox.org ([62.4.1.46]:54908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anBY3-0000MA-Ot for guix-devel@gnu.org; Mon, 04 Apr 2016 16:56:36 -0400 Content-Disposition: inline List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --i9LlY+UWpKt15+FH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Guix! Attached is a patch to add the SPARTA Direct Simulation Monte Carlo Software. There maybe is a problem with the source URL: The URL always points to the latest version of the source tar ball which is constantly updated and immediately released by upstream. This means that the hash of the source tar ball available at this URL changes several times a month. Is this acceptable or does anyone have an idea how this should be handled? Thank you! --i9LlY+UWpKt15+FH Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="0001-gnu-Add-sparta-dsmc.patch" Content-Transfer-Encoding: quoted-printable >From bb34f87da7df626170a51aab77dd150336112401 Mon Sep 17 00:00:00 2001 From: Lukas Gradl Date: Mon, 4 Apr 2016 15:19:35 -0500 Subject: [PATCH] gnu: Add sparta-dsmc. * gnu/packages/maths.scm (sparta-dsmc): New variable. --- gnu/packages/maths.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 file changed, 61 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index d6b371e..1ae938b 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -10,6 +10,7 @@ ;;; Copyright =A9 2015 Mark H Weaver ;;; Copyright =A9 2015, 2016 Efraim Flashner ;;; Copyright =A9 2015 Fabian Harfert +;;; Copyright =A9 2016 Lukas Gradl ;;; ;;; This file is part of GNU Guix. ;;; @@ -2027,3 +2028,63 @@ are built. It can generate many different fractal= types such as the Mandelbrot set.") (home-page "http://www.gnu.org/software/xaos/") (license license:gpl2+))) + +(define-public sparta-dsmc + (package + (name "sparta-dsmc") + (version "20160331") + (source + (origin + (method url-fetch) + (uri "http://www.sandia.gov/~sjplimp/tars/sparta.tar.gz") + (sha256 + (base32 + "0w0sdiharqrw6x4msbq01havky15cq7ylkk2y6v59xyy7vnxpnss")))) + (build-system gnu-build-system) + (inputs `(("openmpi" ,openmpi) + ("libjpeg" ,libjpeg) + ("python" ,python-2))) + (arguments + `(#:tests? #f ; there is no "check" target nor any other tests + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'patch-generated-file-shebangs 'chdir-to-src + (lambda _ + (chdir "src"))) + (add-after 'chdir-to-src + 'patch-makefile-shell + (lambda _ + (substitute* (list "MAKE/Makefile.mpi" + "MAKE/Makefile.serial") + (("/bin/sh") (which "bash"))))) + (replace 'build + (lambda _ + (and + (zero? (system* "make" + (format #f "-j~a" (parallel-job-count)) + "mpi")) + (zero? (system* "make" + (format #f "-j~a" (parallel-job-count)) + "serial"))))) + (replace 'install + (lambda _ + (let* ((out (assoc-ref %outputs "out")) + (bin (string-append out "/bin")) + (doc (string-append out "/share/doc/sparta-dsmc")) + (examples (string-append doc "/examples"))) + (install-file "spa_mpi" bin) + (install-file "spa_serial" bin) + (copy-recursively "../examples" examples) + (copy-recursively "../doc" doc))))))) + (synopsis "Direct Simulation Monte Carlo (DSMC) simulator") + (description "SPARTA is a parallel DSMC code for performing +simulations of low-density gases in 2d or 3d. Particles advect +through a hierarchical Cartesian grid that overlays the simulation +box. The grid is used to group particles by grid cell for purposes of +performing collisions and chemistry. Physical objects with +triangulated surfaces can be embedded in the grid, creating cut and +split grid cells. The grid is also used to efficiently find +particle/surface collisions.") + (home-page "http://sparta.sandia.gov/") + (license license:gpl2))) --=20 2.6.3 --i9LlY+UWpKt15+FH--