diff mbox series

[bug#51087] gnu: Add simdjson.

Message ID CA+3U0Z=t5OEC4ORGxhbwYei86Z3XeA4ngQr=yBT=mWwEMOpv-g@mail.gmail.com
State Accepted
Headers show
Series [bug#51087] gnu: Add simdjson. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Greg Hogan Oct. 7, 2021, 6:12 p.m. UTC
From a260708c520c744e492671914af02c5129ae9b4d Mon Sep 17 00:00:00 2001
From: Greg Hogan <code@greghogan.com>
Date: Mon, 27 Sep 2021 14:20:03 +0000
Subject: [PATCH] gnu: Add simdjson.

* gnu/packages/cpp.scm (simdjson): New variable.
---
 gnu/packages/cpp.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

+    (license license:asl2.0)))
--
2.33.0

Comments

Ludovic Courtès Oct. 14, 2021, 12:58 p.m. UTC | #1
Hi Greg,

Greg Hogan <code@greghogan.com> skribis:

> From a260708c520c744e492671914af02c5129ae9b4d Mon Sep 17 00:00:00 2001
> From: Greg Hogan <code@greghogan.com>
> Date: Mon, 27 Sep 2021 14:20:03 +0000
> Subject: [PATCH] gnu: Add simdjson.
>
> * gnu/packages/cpp.scm (simdjson): New variable.

Applied, thanks!

I was afraid of seeing ‘-mavx512’ or ‘-mtune=native’ flags, but
apparently there’s nothing like that, so I suppose it just builds for
the common ISA SIMD denominator?

> +    (arguments
> +     '(#:tests? #f                      ; tests require downloading dependencies

IWBN to see if we can get them to run, using packaged dependencies.

Ludo’.
Greg Hogan Nov. 3, 2021, 2:49 p.m. UTC | #2
Hi Ludo',

On Thu, Oct 14, 2021 at 8:58 AM Ludovic Courtès <ludo@gnu.org> wrote:

> Hi Greg,
>
> Greg Hogan <code@greghogan.com> skribis:
>
> > From a260708c520c744e492671914af02c5129ae9b4d Mon Sep 17 00:00:00 2001
> > From: Greg Hogan <code@greghogan.com>
> > Date: Mon, 27 Sep 2021 14:20:03 +0000
> > Subject: [PATCH] gnu: Add simdjson.
> >
> > * gnu/packages/cpp.scm (simdjson): New variable.
>
> Applied, thanks!
>
> I was afraid of seeing ‘-mavx512’ or ‘-mtune=native’ flags, but
> apparently there’s nothing like that, so I suppose it just builds for
> the common ISA SIMD denominator?
>

AVX2 and additional implementations are provided.
https://github.com/simdjson/simdjson/blob/master/doc/implementation-selection.md#overview


> > +    (arguments
> > +     '(#:tests? #f                      ; tests require downloading
> dependencies
>
> IWBN to see if we can get them to run, using packaged dependencies.
>
> Ludo’.
>

Greg
diff mbox series

Patch

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 1fb4aa481f..ccdcb3f835 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1347,3 +1347,29 @@  of reading and writing XML.")
     (description "Jsonnet is a templating language extending JSON
 syntax with variables, conditions, functions and more.")
     (license license:asl2.0)))
+
+(define-public simdjson
+  (package
+    (name "simdjson")
+    (version "1.0.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/simdjson/simdjson")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "08qpsw0i8481xlyyghzyszb1vh4c8i7krzzghvr9m4yg394vf6zn"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:tests? #f                      ; tests require downloading
dependencies
+       #:configure-flags
+       '("-DBUILD_SHARED_LIBS=ON")))
+    (synopsis "JSON parser for C++ using SIMD instructions")
+    (description
+     "The simdjson library uses commonly available SIMD instructions and
+microparallel algorithms to implement a strict JSON parser with UTF-8
+validation.")
+    (home-page "https://github.com/simdjson/simdjson")