unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: add sparta-dsmc
@ 2016-04-04 20:55 Lukas Gradl
  2016-04-05  8:26 ` Leo Famulari
  0 siblings, 1 reply; 8+ messages in thread
From: Lukas Gradl @ 2016-04-04 20:55 UTC (permalink / raw)
  To: guix-devel

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

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!

[-- Attachment #2: 0001-gnu-Add-sparta-dsmc.patch --]
[-- Type: text/plain, Size: 3613 bytes --]

From bb34f87da7df626170a51aab77dd150336112401 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
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 © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
+;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;;
 ;;; 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)))
-- 
2.6.3


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

* Re: [PATCH] gnu: add sparta-dsmc
  2016-04-04 20:55 [PATCH] gnu: add sparta-dsmc Lukas Gradl
@ 2016-04-05  8:26 ` Leo Famulari
  2016-04-05 17:04   ` Lukas Gradl
  0 siblings, 1 reply; 8+ messages in thread
From: Leo Famulari @ 2016-04-05  8:26 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

On Mon, Apr 04, 2016 at 03:55:51PM -0500, Lukas Gradl wrote:
> 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?

I assume you've looked for a more stable URL. Are there other distros
that have solved this problem? Can you contact the SPARTA developers and
ask if there is a solution?

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

* Re: [PATCH] gnu: add sparta-dsmc
  2016-04-05  8:26 ` Leo Famulari
@ 2016-04-05 17:04   ` Lukas Gradl
  2016-04-05 17:21     ` Efraim Flashner
  0 siblings, 1 reply; 8+ messages in thread
From: Lukas Gradl @ 2016-04-05 17:04 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

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

On Tue, Apr 05, 2016 at 04:26:59AM -0400, Leo Famulari wrote:
> On Mon, Apr 04, 2016 at 03:55:51PM -0500, Lukas Gradl wrote:
> > 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?
> 
> I assume you've looked for a more stable URL. Are there other distros
> that have solved this problem? Can you contact the SPARTA developers and
> ask if there is a solution?

AFAIK this software is not packaged in any other distro.  I am already
in contact with the author of SPARTA, he provided the URL that I used in
the patch.  I explained the problem to him and I am waiting for his
response.

Thank you!

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

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

* Re: [PATCH] gnu: add sparta-dsmc
  2016-04-05 17:04   ` Lukas Gradl
@ 2016-04-05 17:21     ` Efraim Flashner
  2016-04-05 18:37       ` Leo Famulari
  2016-04-23  6:47       ` Lukas Gradl
  0 siblings, 2 replies; 8+ messages in thread
From: Efraim Flashner @ 2016-04-05 17:21 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

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

On Tue, Apr 05, 2016 at 12:04:56PM -0500, Lukas Gradl wrote:
> On Tue, Apr 05, 2016 at 04:26:59AM -0400, Leo Famulari wrote:
> > On Mon, Apr 04, 2016 at 03:55:51PM -0500, Lukas Gradl wrote:
> > > 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?
> > 
> > I assume you've looked for a more stable URL. Are there other distros
> > that have solved this problem? Can you contact the SPARTA developers and
> > ask if there is a solution?
> 
> AFAIK this software is not packaged in any other distro.  I am already
> in contact with the author of SPARTA, he provided the URL that I used in
> the patch.  I explained the problem to him and I am waiting for his
> response.
> 
> Thank you!

Not just for this package but potentially for others, could we stick a
copy on archive.org with a date-stamp or something?

-- 
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: 819 bytes --]

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

* Re: [PATCH] gnu: add sparta-dsmc
  2016-04-05 17:21     ` Efraim Flashner
@ 2016-04-05 18:37       ` Leo Famulari
  2016-04-23  6:47       ` Lukas Gradl
  1 sibling, 0 replies; 8+ messages in thread
From: Leo Famulari @ 2016-04-05 18:37 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

On Tue, Apr 05, 2016 at 08:21:35PM +0300, Efraim Flashner wrote:
> On Tue, Apr 05, 2016 at 12:04:56PM -0500, Lukas Gradl wrote:
> > On Tue, Apr 05, 2016 at 04:26:59AM -0400, Leo Famulari wrote:
> > > On Mon, Apr 04, 2016 at 03:55:51PM -0500, Lukas Gradl wrote:
> > > > 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?
> > > 
> > > I assume you've looked for a more stable URL. Are there other distros
> > > that have solved this problem? Can you contact the SPARTA developers and
> > > ask if there is a solution?
> > 
> > AFAIK this software is not packaged in any other distro.  I am already
> > in contact with the author of SPARTA, he provided the URL that I used in
> > the patch.  I explained the problem to him and I am waiting for his
> > response.
> > 
> > Thank you!
> 
> Not just for this package but potentially for others, could we stick a
> copy on archive.org with a date-stamp or something?

There have been a few packages with unsuitable source URLs in the past,
but I've never paid much attention to how we resolved the issue. It
would be helpful to have a "go-to" solution for this sort of thing,
although in each case the best solution would be for upstream to
maintain a release archive.

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

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

* Re: [PATCH] gnu: add sparta-dsmc
  2016-04-05 17:21     ` Efraim Flashner
  2016-04-05 18:37       ` Leo Famulari
@ 2016-04-23  6:47       ` Lukas Gradl
  2016-04-25 19:03         ` Leo Famulari
  1 sibling, 1 reply; 8+ messages in thread
From: Lukas Gradl @ 2016-04-23  6:47 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1816 bytes --]

On Tue, Apr 05, 2016 at 08:21:35PM +0300, Efraim Flashner wrote:
> On Tue, Apr 05, 2016 at 12:04:56PM -0500, Lukas Gradl wrote:
> > On Tue, Apr 05, 2016 at 04:26:59AM -0400, Leo Famulari wrote:
> > > On Mon, Apr 04, 2016 at 03:55:51PM -0500, Lukas Gradl wrote:
> > > > 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?
> > > 
> > > I assume you've looked for a more stable URL. Are there other distros
> > > that have solved this problem? Can you contact the SPARTA developers and
> > > ask if there is a solution?
> > 
> > AFAIK this software is not packaged in any other distro.  I am already
> > in contact with the author of SPARTA, he provided the URL that I used in
> > the patch.  I explained the problem to him and I am waiting for his
> > response.
> > 
> > Thank you!
> 
> Not just for this package but potentially for others, could we stick a
> copy on archive.org with a date-stamp or something?


Sorry for the long delay!

My message to upstream is still unanswered, so I went ahead and uploaded
the tar ball to archive.org.  Attached is an updated patch.

Thank you!


> 
> -- 
> 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 #1.2: 0001-gnu-Add-sparta-dsmc.patch --]
[-- Type: text/plain, Size: 3391 bytes --]

From 751771dcb3f64b7ad5383906bbfa6e4b24d2c757 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Sat, 23 Apr 2016 01:40:16 -0500
Subject: [PATCH] gnu: Add sparta-dsmc.

 * gnu/packages/maths.scm (sparta-dsmc): New variable.
---
 gnu/packages/maths.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 7ea4ca3..241a010 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2119,3 +2119,66 @@ 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
+        (string-append "https://archive.org/download/sparta-"
+                       version ".tar/sparta-" version ".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)))
-- 
2.7.4


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

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

* Re: [PATCH] gnu: add sparta-dsmc
  2016-04-23  6:47       ` Lukas Gradl
@ 2016-04-25 19:03         ` Leo Famulari
  2016-04-25 20:11           ` Lukas Gradl
  0 siblings, 1 reply; 8+ messages in thread
From: Leo Famulari @ 2016-04-25 19:03 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

On Sat, Apr 23, 2016 at 01:47:18AM -0500, Lukas Gradl wrote:
> On Tue, Apr 05, 2016 at 08:21:35PM +0300, Efraim Flashner wrote:
> > On Tue, Apr 05, 2016 at 12:04:56PM -0500, Lukas Gradl wrote:
> > > On Tue, Apr 05, 2016 at 04:26:59AM -0400, Leo Famulari wrote:
> > > > On Mon, Apr 04, 2016 at 03:55:51PM -0500, Lukas Gradl wrote:
> > > > > 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?
> > > > 
> > > > I assume you've looked for a more stable URL. Are there other distros
> > > > that have solved this problem? Can you contact the SPARTA developers and
> > > > ask if there is a solution?
> > > 
> > > AFAIK this software is not packaged in any other distro.  I am already
> > > in contact with the author of SPARTA, he provided the URL that I used in
> > > the patch.  I explained the problem to him and I am waiting for his
> > > response.
> > > 
> > > Thank you!
> > 
> > Not just for this package but potentially for others, could we stick a
> > copy on archive.org with a date-stamp or something?
> 
> 
> Sorry for the long delay!
> 
> My message to upstream is still unanswered, so I went ahead and uploaded
> the tar ball to archive.org.  Attached is an updated patch.

Do we at least know why the tarball keeps changing? For example, is it a
new release? Have you inspected the differences from one to the next?

If the upstream author could say, "use this tarball with hash xxx[...]",
we could confidently distribute software from the author to our users.

Thanks for you work on this so far!

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

* Re: [PATCH] gnu: add sparta-dsmc
  2016-04-25 19:03         ` Leo Famulari
@ 2016-04-25 20:11           ` Lukas Gradl
  0 siblings, 0 replies; 8+ messages in thread
From: Lukas Gradl @ 2016-04-25 20:11 UTC (permalink / raw)
  To: Leo Famulari

Leo Famulari <leo@famulari.name> writes:

> On Sat, Apr 23, 2016 at 01:47:18AM -0500, Lukas Gradl wrote:
>> On Tue, Apr 05, 2016 at 08:21:35PM +0300, Efraim Flashner wrote:
>> > On Tue, Apr 05, 2016 at 12:04:56PM -0500, Lukas Gradl wrote:
>> > > On Tue, Apr 05, 2016 at 04:26:59AM -0400, Leo Famulari wrote:
>> > > > On Mon, Apr 04, 2016 at 03:55:51PM -0500, Lukas Gradl wrote:
>> > > > > 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?
>> > > > 
>> > > > I assume you've looked for a more stable URL. Are there other distros
>> > > > that have solved this problem? Can you contact the SPARTA developers and
>> > > > ask if there is a solution?
>> > > 
>> > > AFAIK this software is not packaged in any other distro.  I am already
>> > > in contact with the author of SPARTA, he provided the URL that I used in
>> > > the patch.  I explained the problem to him and I am waiting for his
>> > > response.
>> > > 
>> > > Thank you!
>> > 
>> > Not just for this package but potentially for others, could we stick a
>> > copy on archive.org with a date-stamp or something?
>> 
>> 
>> Sorry for the long delay!
>> 
>> My message to upstream is still unanswered, so I went ahead and uploaded
>> the tar ball to archive.org.  Attached is an updated patch.
>
> Do we at least know why the tarball keeps changing? For example, is it a
> new release? Have you inspected the differences from one to the next?

Yes, it is a new release.  When upstream releases a new version, they
publish it at this URL.  The old version that was available at that URL
before is then taken offline and can no longer be downloaded from their
website.

> If the upstream author could say, "use this tarball with hash xxx[...]",
> we could confidently distribute software from the author to our users.
>

At the moment, the tarball with hash XXX at the download URL is silently
replaced by another tarball with hash YYY but identical name
(sparta.tar.gz) whenever they release a new version, which happens up to
several times a month.  I tried to explain to the author that this is
problematic for the authentication of the tarball via SHA sums and for
reproducibility and I suggested to him to append the release date to the
tarball name and keep the old ones available.  Unfortunately I have not
received a reply yet.

> Thanks for you work on this so far!

Thank you for your review!  I am working with this software almost every
day on several computers managed by Guix so I would love to see this go
in. 

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

end of thread, other threads:[~2016-04-25 20:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-04 20:55 [PATCH] gnu: add sparta-dsmc Lukas Gradl
2016-04-05  8:26 ` Leo Famulari
2016-04-05 17:04   ` Lukas Gradl
2016-04-05 17:21     ` Efraim Flashner
2016-04-05 18:37       ` Leo Famulari
2016-04-23  6:47       ` Lukas Gradl
2016-04-25 19:03         ` Leo Famulari
2016-04-25 20:11           ` Lukas Gradl

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).