all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
Cc: 64504@debbugs.gnu.org,
	Sharlatan Hellseher <sharlatanus@gmail.com>,
	Efraim Flashner <efraim@flashner.co.il>,
	Eric Bavier <bavier@posteo.net>
Subject: [bug#64504] [PATCH] gnu: Add unsio.
Date: Tue, 8 Aug 2023 17:49:50 +0200	[thread overview]
Message-ID: <ZNJkHrqckbCOdt7J@jurong> (raw)
In-Reply-To: <138b0fbd-ca5b-17ac-9c18-4d657737d4c0@mpe.mpg.de>

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

Am Tue, Aug 08, 2023 at 01:37:14PM +0200 schrieb Iliya Tikhonenko:
> 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.
 
> > 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.

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


[-- Attachment #2: 0001-gnu-Add-unsio.patch --]
[-- Type: text/plain, Size: 2886 bytes --]

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(+)

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


  reply	other threads:[~2023-08-08 15:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 22:13 [bug#64504] [PATCH] gnu: Add unsio Sharlatan Hellseher
2023-08-08  9:29 ` Andreas Enge
2023-08-08 11:37   ` Iliya Tikhonenko
2023-08-08 15:49     ` Andreas Enge [this message]
2023-08-14 12:41       ` Iliya Tikhonenko
2023-08-17 18:10         ` bug#64504: " Andreas Enge

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=ZNJkHrqckbCOdt7J@jurong \
    --to=andreas@enge.fr \
    --cc=64504@debbugs.gnu.org \
    --cc=bavier@posteo.net \
    --cc=efraim@flashner.co.il \
    --cc=sharlatanus@gmail.com \
    --cc=tikhonenko@mpe.mpg.de \
    /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.