all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: iyzsong--- via Guix-patches via <guix-patches@gnu.org>
To: 63088@debbugs.gnu.org
Cc: zamfofex <zamfofex@twdb.moe>, 宋文武 <iyzsong@member.fsf.org>,
	"Liliana Marie Prikler" <liliana.prikler@gmail.com>,
	宋文武 <iyzsong@envs.net>
Subject: [bug#63088] [PATCH v2] gnu: Add Lc0.
Date: Thu,  7 Sep 2023 18:23:11 +0800	[thread overview]
Message-ID: <3cc41c81a301fb53c564508d3cbcf92270695d1b.1694082083.git.iyzsong@member.fsf.org> (raw)
In-Reply-To: <cover.1682514072.git.zamfofex@twdb.moe>

From: zamfofex <zamfofex@twdb.moe>

* gnu/packages/games.scm (lc0): New variable.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
---
 gnu/packages/games.scm | 59 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 760234b031..f82f1dcc52 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -118,6 +118,7 @@ (define-module (gnu packages games)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages c)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
@@ -171,6 +172,7 @@ (define-module (gnu packages games)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages machine-learning)
   #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages messaging)
@@ -10409,6 +10411,63 @@ (define-public stockfish
       (home-page "https://stockfishchess.org/")
       (license license:gpl3+))))
 
+(define lc0-neural-network
+  (let ((hash
+         "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34"))
+    (origin
+      (method url-fetch)
+      (uri (string-append "https://storage.lczero.org/files/networks/"
+                          hash))
+      (sha256
+       (base32
+        "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi"))
+      (file-name "lc0-neural-network"))))
+
+(define-public lc0
+  (package
+    (name "lc0")
+    (version "0.30.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/LeelaChessZero/lc0")
+             (commit (string-append "v" version))
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3"))))
+    (build-system meson-build-system)
+    (native-search-paths
+     (list (search-path-specification
+            (variable "XDG_DATA_DIRS")
+            (files '("share")))))
+    (inputs
+     `(("neural-network" ,lc0-neural-network)
+       ("eigen" ,eigen)
+       ("oneapi-dnnl" ,oneapi-dnnl)
+       ("zlib" ,zlib)))
+    (native-inputs
+     (list googletest ispc pkg-config python))
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-after 'install 'copy-net
+                    (lambda* (#:key outputs inputs #:allow-other-keys)
+                      (mkdir-p (string-append (assoc-ref outputs "out")
+                                              "/share/lc0"))
+                      (copy-file (assoc-ref inputs "neural-network")
+                                 (string-append (assoc-ref outputs "out")
+                                                "/share/lc0/neural-network")))))
+       #:configure-flags (list "-Ddnnl=true"
+                               (string-append
+                                "-Ddnnl_dir="
+                                (assoc-ref %build-inputs "oneapi-dnnl")))))
+    (synopsis "Chess engine using neural networks")
+    (description "Lc0 is a UCI-compliant chess engine designed to play chess
+via neural network, specifically those of the LeelaChessZero project.")
+    (home-page "https://lczero.org")
+    (license license:gpl3+)))
+
 (define-public barrage
   (package
     (name "barrage")

base-commit: 5ef28595e9dff8b88ec3fcb4d887fbc380c9a8b8
prerequisite-patch-id: 8cee4be3d25dba0dde5c2d0e317f31741c010f50
-- 
2.41.0





  parent reply	other threads:[~2023-09-07 10:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 13:13 [bug#63088] [PATCH 0/3] Add Lc0 zamfofex
2023-04-26 13:17 ` [bug#63088] [PATCH 1/3] gnu: Add ISPC. * gnu/packages/c.scm (ispc): New variable zamfofex
2023-04-26 13:17 ` [bug#63088] [PATCH 2/3] gnu: Add oneDNN. * gnu/packages/machine-learning.scm (oneapi-dnnl): " zamfofex
2023-04-26 13:17 ` [bug#63088] [PATCH 3/3] gnu: Add Lc0. * gnu/packages/games.scm (lc0): " zamfofex
2023-05-11 14:29   ` [bug#63088] [PATCH 0/3] Add Lc0 宋文武 via Guix-patches via
2023-05-11 21:25     ` zamfofex
2023-05-16 12:16       ` Simon Tournier
2023-07-27 23:34 ` [bug#63088] [PATCH] " zamfofex
2023-07-28  0:24   ` zamfofex
2023-07-28  4:23   ` Liliana Marie Prikler
2023-07-28 18:14     ` zamfofex
2023-09-07 10:23 ` iyzsong--- via Guix-patches via [this message]
2023-09-07 17:03   ` [bug#63088] [PATCH v2] gnu: " Liliana Marie Prikler
2023-09-11 10:22     ` zamfofex
2023-09-11 18:00       ` Liliana Marie Prikler
2023-09-12 11:58 ` [bug#63088] [PATCH 1/3] gnu: Add lc0 zamfofex
2023-09-12 11:58   ` [bug#63088] [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero zamfofex
2023-09-12 17:07     ` Liliana Marie Prikler
2023-09-12 11:58   ` [bug#63088] [PATCH 3/3] gnu: Add neural networks from the Maia Chess project zamfofex
2023-09-13  1:49 ` [bug#63088] [PATCH 1/3] gnu: Add lc0 zamfofex
2023-09-13  1:49   ` [bug#63088] [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero zamfofex
2023-09-13  1:49   ` [bug#63088] [PATCH 3/3] gnu: Add neural networks from the Maia Chess project zamfofex

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=3cc41c81a301fb53c564508d3cbcf92270695d1b.1694082083.git.iyzsong@member.fsf.org \
    --to=guix-patches@gnu.org \
    --cc=63088@debbugs.gnu.org \
    --cc=iyzsong@envs.net \
    --cc=iyzsong@member.fsf.org \
    --cc=liliana.prikler@gmail.com \
    --cc=zamfofex@twdb.moe \
    /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.