[PATCH] gnu: Add unsio.

  • Done
  • quality assurance status badge
Details
3 participants
  • Andreas Enge
  • Sharlatan Hellseher
  • Iliya Tikhonenko
Owner
unassigned
Submitted by
Sharlatan Hellseher
Severity
normal

Debbugs page

Sharlatan Hellseher wrote 2 years ago
(address . guix-patches@gnu.org)
521af611d0794672c19a4899e42eb5e448ab1c1f.1688681498.git.sharlatanus@gmail.com
* gnu/packages/astronomy.scm (unsio): New variable.

Co-Authored-By: Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
---
gnu/packages/astronomy.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (64 lines)
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 3a1b584808..15590cb84b 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2021, 2022 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2023 Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -74,6 +75,7 @@ (define-module (gnu packages astronomy)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
#:use-module (gnu packages readline)
+ #:use-module (gnu packages sqlite)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages textutils)
#:use-module (gnu packages time)
@@ -3767,3 +3769,39 @@ (define-public python-wiimatch
for optimal @code{matching} of weighted N-dimensional image intensity data
using (multivariate) polynomials.")
(license license:bsd-3)))
+
+(define-public unsio
+ ;; There is no versioned tag, use the latest commit.
+ (let ((commit "25e52468298e1194c9726ef5dba9d5fbb46870f5")
+ (revision "0"))
+ (package
+ (name "unsio")
+ (version (git-version "1.3.3" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.lam.fr/infrastructure/unsio")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "110i2p5608zhh5w3pf3b5r2651hykw2ayspgq6vpqsffhya1p170"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ;No tests
+ #:build-type "Release"
+ #:configure-flags #~(list "-DCMAKE_CXX_STANDARD=14")))
+ (inputs (list gfortran hdf5 perl sqlite zlib))
+ (home-page "https://projets.lam.fr/projects/unsio/wiki")
+ (synopsis "Universal Nbody snapshot I/O")
+ (description
+ "@acronym{UNSIO, Universal Nbody Snapshot Input Output} is an API which
+perform input/output operations in a generic way, and on different kind of nbody
+files format (nemo, Gadget binaries 1 and 2, Gadget hdf5, Ramses). By using this
+API, a user could write only one analysis program which will work on all known
+files format supported by UNSIO. It's not necessary anymore to know how is
+implemented a file format, UNSIO will do transparently and automatically all the
+hard work for you! With UNSIO, you will spend less time to develop your
+analysis program. UNSIO comes with an integrated sqlite3 database which can be
+used to retrieve automatically all your data among terabytes of hard disks.")
+ (license license:cecill))))

base-commit: de3b8684e9a8e90e243cc2061100b06576c04077
--
2.40.1
Andreas Enge wrote 2 years ago
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
ZNIK_kKc2ud4iJpQ@jurong
Hello,

thanks for the patch! I tried to remove the marketing speech out of the
description. For the #:build-type, the default value (release with debug
information) also works and results in a package of the same size. Is there
a reason to change it? Modified patch attached.

I can also compile the package without the configure flags, are they
useful?

In the end dynamic and static libraries end up in a directory lib64/.
Should this not be lib/?

And there are lots of warnings about 34 bit shifts in a 32 bit type.
But I suppose you tested that the library works.

Andreas
From f5401b0abbe58aa473738dc58d541e2bece9db65 Mon Sep 17 00:00:00 2001
Message-ID: <f5401b0abbe58aa473738dc58d541e2bece9db65.1691486728.git.andreas@enge.fr>
From: Sharlatan Hellseher <sharlatanus@gmail.com>
Date: Thu, 6 Jul 2023 23:13:05 +0100
Subject: [PATCH] gnu: Add unsio.

* gnu/packages/astronomy.scm (unsio): New variable.

Co-Authored-By: Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
Signed-off-by: Andreas Enge <andreas@enge.fr>
---
gnu/packages/astronomy.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (57 lines)
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index e5c318c8bf..7e047d4ad7 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -9,6 +9,7 @@
;;; Copyright ᅵ 2021, 2022 Vinicius Monego <monego@posteo.net>
;;; Copyright ᅵ 2021 Greg Hogan <code@greghogan.com>
;;; Copyright ᅵ 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright ᅵ 2023 Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -75,6 +76,7 @@ (define-module (gnu packages astronomy)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
#:use-module (gnu packages readline)
+ #:use-module (gnu packages sqlite)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages textutils)
#:use-module (gnu packages time)
@@ -3951,3 +3953,32 @@ (define-public python-wiimatch
for optimal @code{matching} of weighted N-dimensional image intensity data
using (multivariate) polynomials.")
(license license:bsd-3)))
+
+(define-public unsio
+ ;; There is no versioned tag, use the latest commit.
+ (let ((commit "25e52468298e1194c9726ef5dba9d5fbb46870f5")
+ (revision "0"))
+ (package
+ (name "unsio")
+ (version (git-version "1.3.3" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.lam.fr/infrastructure/unsio")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "110i2p5608zhh5w3pf3b5r2651hykw2ayspgq6vpqsffhya1p170"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ;No tests
+ #:configure-flags #~(list "-DCMAKE_CXX_STANDARD=14")))
+ (inputs (list gfortran hdf5 perl sqlite zlib))
+ (home-page "https://projets.lam.fr/projects/unsio/wiki")
+ (synopsis "Input and output routines for n-body file formats")
+ (description
+ "@acronym{UNSIO, Universal Nbody Snapshot Input Output} provides
+an API for performing input and output operations on different kinds of
+n-body file formats (nemo, Gadget binaries 1 and 2, Gadget hdf5, Ramses).")
+ (license license:cecill))))

base-commit: f19736e62f9ab5fba0ac5fe184a221c2a5d374c6
--
2.41.0
Iliya Tikhonenko wrote 2 years ago
(name . Andreas Enge)(address . andreas@enge.fr)
138b0fbd-ca5b-17ac-9c18-4d657737d4c0@mpe.mpg.de
Hello!

I am the author of the initial version of this patch (kudos to Sharlatan
for cleaning it up and bringing to guix proper!)

On 8/8/23 11:29, Andreas Enge wrote:
Toggle quote (1 lines)
> For the #:build-type, the default value (release with debug information) also works and results in a package of the same size. Is there a reason to change it? Modified patch attached.
The debug build type is unnecessary verbose (see src/uns.cc line 71-73
for an example) to the point that it impacts performance sometimes,
which is important considering the usecase of the library.

Toggle quote (1 lines)
> I can also compile the package without the configure flags, are they useful?
Checked again, I still cannot compile it without -DCMAKE_CXX_STANDARD=14


Toggle quote (2 lines)
> And there are lots of warnings about 34 bit shifts in a 32 bit type.
> But I suppose you tested that the library works.
I have not noticed any issues using it during the past two years, but
this cannot be considered a proper test because I am actually using a
small subset of the library. Perhaps, this warning should be reported
upstream, thanks!


All the best,
Iliya
Andreas Enge wrote 2 years ago
(name . Iliya Tikhonenko)(address . tikhonenko@mpe.mpg.de)
ZNJkHrqckbCOdt7J@jurong
Am Tue, Aug 08, 2023 at 01:37:14PM +0200 schrieb Iliya Tikhonenko:
Toggle quote (6 lines)
> On 8/8/23 11:29, Andreas Enge wrote:
> > For the #:build-type, the default value (release with debug information) also works and results in a package of the same size. Is there a reason to change it? Modified patch attached.
> The debug build type is unnecessary verbose (see src/uns.cc line 71-73 for
> an example) to the point that it impacts performance sometimes, which is
> important considering the usecase of the library.

Okay, I have reinstated your line and added a comment.
Toggle quote (3 lines)
> > I can also compile the package without the configure flags, are they useful?
> Checked again, I still cannot compile it without -DCMAKE_CXX_STANDARD=14

I can... Patch attached.

Toggle quote (7 lines)
> > And there are lots of warnings about 34 bit shifts in a 32 bit type.
> > But I suppose you tested that the library works.
> I have not noticed any issues using it during the past two years, but this
> cannot be considered a proper test because I am actually using a small
> subset of the library. Perhaps, this warning should be reported upstream,
> thanks!

/tmp/guix-build-unsio-1.3.3-0.25e5246.drv-0/source/src/snapshotinterface.cc:125:45: warning: result of ‘(-2147483648 << 2)’ requires 34 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
125 | req_bits = (unsigned int) (( 1 << 31 )<<2)-1;
| ~~~~~~~~~~~~^~~~

Here is the offending line. This is indeed a bit surprising, as "int"
usually has 32 bits. The 1 to be shifted is a signed int; 1*2^31 is not
representable in the type, so if I understand the C standard correctly,
the result is undefined. Then I have seen a Stackoverflow comment that
it is okay in C++20. And indeed:
#:configure-flags #~(list "-DCMAKE_CXX_STANDARD=20")
passes without these warnings. Should we add this?
Although such constructs look a bit brittle to me, and it is not
suggested by the author.

There is still the question about the lib64/ installation directory,
I think this should be changed.

Andreas
From ebfdbb4941d1151d15ecc0efb5aacdd3532b30cb Mon Sep 17 00:00:00 2001
Message-ID: <ebfdbb4941d1151d15ecc0efb5aacdd3532b30cb.1691508861.git.andreas@enge.fr>
From: Sharlatan Hellseher <sharlatanus@gmail.com>
Date: Thu, 6 Jul 2023 23:13:05 +0100
Subject: [PATCH] gnu: Add unsio.

* gnu/packages/astronomy.scm (unsio): New variable.

Co-Authored-By: Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
Signed-off-by: Andreas Enge <andreas@enge.fr>
---
gnu/packages/astronomy.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (57 lines)
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index e5c318c8bf..e18e8bb21e 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -9,6 +9,7 @@
;;; Copyright ᅵ 2021, 2022 Vinicius Monego <monego@posteo.net>
;;; Copyright ᅵ 2021 Greg Hogan <code@greghogan.com>
;;; Copyright ᅵ 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright ᅵ 2023 Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -75,6 +76,7 @@ (define-module (gnu packages astronomy)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
#:use-module (gnu packages readline)
+ #:use-module (gnu packages sqlite)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages textutils)
#:use-module (gnu packages time)
@@ -3951,3 +3953,32 @@ (define-public python-wiimatch
for optimal @code{matching} of weighted N-dimensional image intensity data
using (multivariate) polynomials.")
(license license:bsd-3)))
+
+(define-public unsio
+ ;; There is no versioned tag, use the latest commit.
+ (let ((commit "25e52468298e1194c9726ef5dba9d5fbb46870f5")
+ (revision "0"))
+ (package
+ (name "unsio")
+ (version (git-version "1.3.3" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.lam.fr/infrastructure/unsio")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "110i2p5608zhh5w3pf3b5r2651hykw2ayspgq6vpqsffhya1p170"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ;No tests
+ #:build-type "Release")) ; to improve performace
+ (inputs (list gfortran hdf5 perl sqlite zlib))
+ (home-page "https://projets.lam.fr/projects/unsio/wiki")
+ (synopsis "Input and output routines for n-body file formats")
+ (description
+ "@acronym{UNSIO, Universal Nbody Snapshot Input Output} provides
+an API for performing input and output operations on different kinds of
+n-body file formats (nemo, Gadget binaries 1 and 2, Gadget hdf5, Ramses).")
+ (license license:cecill))))

base-commit: 782ef67a59f4b564f16101cf23c30a3777b3f734
--
2.41.0
Iliya Tikhonenko wrote 2 years ago
(name . Andreas Enge)(address . andreas@enge.fr)
07cba047-bd5a-f7fe-2bdf-a0b8c9781456@mpe.mpg.de
On 8/8/23 17:49, Andreas Enge wrote:
Toggle quote (6 lines)
> Am Tue, Aug 08, 2023 at 01:37:14PM +0200 schrieb Iliya Tikhonenko:
>> On 8/8/23 11:29, Andreas Enge wrote:
>> The debug build type is unnecessary verbose (see src/uns.cc line 71-73 for
>> an example) to the point that it impacts performance sometimes, which is
>> important considering the usecase of the library.
> Okay, I have reinstated your line and added a comment.Fine, maybe "to disable debug printing" would sound slightly more clear,
but I am not sure.

Toggle quote (2 lines)
>> Checked again, I still cannot compile it without -DCMAKE_CXX_STANDARD=14
> I can... Patch attached.
Yeah, it builds now.
Toggle quote (7 lines)
> #:configure-flags #~(list "-DCMAKE_CXX_STANDARD=20")
> passes without these warnings. Should we add this?
> Although such constructs look a bit brittle to me, and it is not suggested by the author.
>
> There is still the question about the lib64/ installation directory,
> I think this should be changed.

I think I am fine with both changes. I did a few quick tests and have
not noticed any issues.


All the best,
Iliya
Andreas Enge wrote 2 years ago
(name . Iliya Tikhonenko)(address . tikhonenko@mpe.mpg.de)
ZN5iexLuqnsAHEvR@jurong
Hello,

On 8/8/23 17:49, Andreas Enge wrote:
Toggle quote (3 lines)
> There is still the question about the lib64/ installation directory,
> I think this should be changed.

I just did with a little snippet; this has been programmed manually by the
author, so could not be changed using cmake variables.

Pushed, thanks for the new package!

Andreas
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 64504@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 64504
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help