Github messages for voidlinux
 help / color / mirror / Atom feed
From: jason1987d <jason1987d@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP] New package: KataGo-1.11.0
Date: Sat, 30 Jul 2022 20:19:40 +0200	[thread overview]
Message-ID: <20220730181940.xXBG9RtWAeQVvQAneqj1lunK9gxZl8j81SrthBYqrAE@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-38190@inbox.vuxu.org>

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

There is an updated pull request by jason1987d against master on the void-packages repository

https://github.com/jason1987d/void-packages KataGo
https://github.com/void-linux/void-packages/pull/38190

[WIP] New package: KataGo-1.11.0
#### Testing the changes
- I tested the changes in this PR: NO
This is a work in progress.

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): YES

<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Main question so far, CMakeLists.txt is found in ${wrksrc}/cpp, what configure_flag or other variable do I set to make it work and find that? I've set cmake_builddir to that which didn't work.

I discussed briefly with @Chocimier about this package when I submitted the new package q5go https://github.com/void-linux/void-packages/pull/35831 and will have other architecture questions.

This package has multiple backends: OpenCL, Eigen, TensorRT. I use an AMD Ryzen system and notice I already have mesa-opencl installed, I see there is another opencl implementation for Nvidia cards, and I suppose others (i.e. Intel) could even be ported to void. Eigen is available in the repos. Would this be multiple templates i.e. KataGo-OpenCL KataGo-Eigen etc or would I need to set up KataGo as some sort of metapackage?

A patch file from https://github.com/void-linux/void-packages/pull/38190.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-KataGo-38190.patch --]
[-- Type: text/x-diff, Size: 9784 bytes --]

From da7e6459de101feef7c6ce6e5dfb8be3b6ea1db9 Mon Sep 17 00:00:00 2001
From: Jason Manley <jason@jasondavid.tv>
Date: Thu, 21 Jul 2022 23:01:22 -0500
Subject: [PATCH] New package: KataGo-1.11.0

---
 srcpkgs/KataGo-OpenCL/patches/rand.cpp.patch  | 11 +++++++
 srcpkgs/KataGo-OpenCL/patches/rand.h.patch    | 11 +++++++
 .../KataGo-OpenCL/patches/runtests.cpp.patch  | 10 +++++++
 .../KataGo-OpenCL/patches/search.cpp.patch    | 11 +++++++
 srcpkgs/KataGo-OpenCL/template                | 30 +++++++++++++++++++
 srcpkgs/KataGo-eigen/patches/rand.cpp.patch   | 11 +++++++
 srcpkgs/KataGo-eigen/patches/rand.h.patch     | 11 +++++++
 .../KataGo-eigen/patches/runtests.cpp.patch   | 10 +++++++
 srcpkgs/KataGo-eigen/patches/search.cpp.patch | 11 +++++++
 srcpkgs/KataGo-eigen/template                 | 30 +++++++++++++++++++
 srcpkgs/eigen/template                        |  6 ++--
 11 files changed, 149 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/KataGo-OpenCL/patches/rand.cpp.patch
 create mode 100644 srcpkgs/KataGo-OpenCL/patches/rand.h.patch
 create mode 100644 srcpkgs/KataGo-OpenCL/patches/runtests.cpp.patch
 create mode 100644 srcpkgs/KataGo-OpenCL/patches/search.cpp.patch
 create mode 100644 srcpkgs/KataGo-OpenCL/template
 create mode 100644 srcpkgs/KataGo-eigen/patches/rand.cpp.patch
 create mode 100644 srcpkgs/KataGo-eigen/patches/rand.h.patch
 create mode 100644 srcpkgs/KataGo-eigen/patches/runtests.cpp.patch
 create mode 100644 srcpkgs/KataGo-eigen/patches/search.cpp.patch
 create mode 100644 srcpkgs/KataGo-eigen/template

diff --git a/srcpkgs/KataGo-OpenCL/patches/rand.cpp.patch b/srcpkgs/KataGo-OpenCL/patches/rand.cpp.patch
new file mode 100644
index 000000000000..3c15d2f13955
--- /dev/null
+++ b/srcpkgs/KataGo-OpenCL/patches/rand.cpp.patch
@@ -0,0 +1,11 @@
+--- a/cpp/core/rand.cpp	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/core/rand.cpp	2022-07-23 09:15:36.383995796 -0500
+@@ -322,7 +322,7 @@
+ {
+   assert(n > 0);
+   assert(n < 0xFFFFFFFF);
+-  double_t sum = cumRelProbs[n-1];
++  double sum = cumRelProbs[n-1];
+   double d = nextDouble(sum);
+   size_t r = BSearch::findFirstGt(cumRelProbs,d,0,n);
+   if(r == n)
diff --git a/srcpkgs/KataGo-OpenCL/patches/rand.h.patch b/srcpkgs/KataGo-OpenCL/patches/rand.h.patch
new file mode 100644
index 000000000000..ebed7ab7a96a
--- /dev/null
+++ b/srcpkgs/KataGo-OpenCL/patches/rand.h.patch
@@ -0,0 +1,11 @@
+--- a/cpp/core/rand.h	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/core/rand.h	2022-07-23 09:15:25.583181534 -0500
+@@ -209,7 +209,7 @@
+ {
+   assert(n > 0);
+   assert(n < 0xFFFFFFFF);
+-  double_t sum = 0;
++  double sum = 0;
+   for(uint32_t i = 0; i<n; i++)
+   {
+     assert(relProbs[i] >= 0);
diff --git a/srcpkgs/KataGo-OpenCL/patches/runtests.cpp.patch b/srcpkgs/KataGo-OpenCL/patches/runtests.cpp.patch
new file mode 100644
index 000000000000..e0b5d79efc50
--- /dev/null
+++ b/srcpkgs/KataGo-OpenCL/patches/runtests.cpp.patch
@@ -0,0 +1,10 @@
+--- a/cpp/command/runtests.cpp	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/command/runtests.cpp	2022-07-29 16:04:10.666595008 -0500
+@@ -24,7 +24,6 @@
+ 
+ int MainCmds::runtests(const vector<string>& args) {
+   (void)args;
+-  testAssert(sizeof(size_t) == 8);
+   Board::initHash();
+   ScoreValue::initTables();
+ 
diff --git a/srcpkgs/KataGo-OpenCL/patches/search.cpp.patch b/srcpkgs/KataGo-OpenCL/patches/search.cpp.patch
new file mode 100644
index 000000000000..864219e11441
--- /dev/null
+++ b/srcpkgs/KataGo-OpenCL/patches/search.cpp.patch
@@ -0,0 +1,11 @@
+--- a/cpp/search/search.cpp	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/search/search.cpp	2022-07-23 09:11:16.099471820 -0500
+@@ -458,7 +458,7 @@
+   //Compute caps on search
+   int64_t maxVisits = pondering ? searchParams.maxVisitsPondering : searchParams.maxVisits;
+   int64_t maxPlayouts = pondering ? searchParams.maxPlayoutsPondering : searchParams.maxPlayouts;
+-  double_t maxTime = pondering ? searchParams.maxTimePondering : searchParams.maxTime;
++  double maxTime = pondering ? searchParams.maxTimePondering : searchParams.maxTime;
+ 
+   {
+     //Possibly reduce computation time, for human friendliness
diff --git a/srcpkgs/KataGo-OpenCL/template b/srcpkgs/KataGo-OpenCL/template
new file mode 100644
index 000000000000..faf2e73bb7d2
--- /dev/null
+++ b/srcpkgs/KataGo-OpenCL/template
@@ -0,0 +1,30 @@
+# Template file for 'KataGo-OpenCL'
+pkgname=KataGo-OpenCL
+version=1.11.0
+revision=1
+wrksrc="KataGo-${version}"
+build_wrksrc=cpp
+build_style=cmake
+configure_args="-DUSE_BACKEND=OPENCL -DNO_GIT_REVISION=1"
+makedepends="ocl-icd-devel zlib-devel libzip-devel"
+depends="mesa-opencl"
+short_desc="KataGo Go/Weiqi/Baduk analysis engine (OpenCL backend)"
+maintainer="Jason Manley <jason@jasondavid.tv>"
+license="MIT"
+homepage="https://github.com/lightvector/KataGo/"
+distfiles="https://github.com/lightvector/KataGo/archive/refs/tags/v${version}.tar.gz"
+checksum=3f63aa5dfaab861360fd6f9548aa7f552b007cac7e90c99089d3bb4bb4b9d451
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-latomic"
+	makedepends+=" libatomic-devel"
+fi
+
+do_check() {
+	build/katago runtests
+}
+
+do_install() {
+	vbin build/katago
+	vlicense "${wrksrc}"/LICENSE
+}
diff --git a/srcpkgs/KataGo-eigen/patches/rand.cpp.patch b/srcpkgs/KataGo-eigen/patches/rand.cpp.patch
new file mode 100644
index 000000000000..3c15d2f13955
--- /dev/null
+++ b/srcpkgs/KataGo-eigen/patches/rand.cpp.patch
@@ -0,0 +1,11 @@
+--- a/cpp/core/rand.cpp	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/core/rand.cpp	2022-07-23 09:15:36.383995796 -0500
+@@ -322,7 +322,7 @@
+ {
+   assert(n > 0);
+   assert(n < 0xFFFFFFFF);
+-  double_t sum = cumRelProbs[n-1];
++  double sum = cumRelProbs[n-1];
+   double d = nextDouble(sum);
+   size_t r = BSearch::findFirstGt(cumRelProbs,d,0,n);
+   if(r == n)
diff --git a/srcpkgs/KataGo-eigen/patches/rand.h.patch b/srcpkgs/KataGo-eigen/patches/rand.h.patch
new file mode 100644
index 000000000000..ebed7ab7a96a
--- /dev/null
+++ b/srcpkgs/KataGo-eigen/patches/rand.h.patch
@@ -0,0 +1,11 @@
+--- a/cpp/core/rand.h	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/core/rand.h	2022-07-23 09:15:25.583181534 -0500
+@@ -209,7 +209,7 @@
+ {
+   assert(n > 0);
+   assert(n < 0xFFFFFFFF);
+-  double_t sum = 0;
++  double sum = 0;
+   for(uint32_t i = 0; i<n; i++)
+   {
+     assert(relProbs[i] >= 0);
diff --git a/srcpkgs/KataGo-eigen/patches/runtests.cpp.patch b/srcpkgs/KataGo-eigen/patches/runtests.cpp.patch
new file mode 100644
index 000000000000..e0b5d79efc50
--- /dev/null
+++ b/srcpkgs/KataGo-eigen/patches/runtests.cpp.patch
@@ -0,0 +1,10 @@
+--- a/cpp/command/runtests.cpp	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/command/runtests.cpp	2022-07-29 16:04:10.666595008 -0500
+@@ -24,7 +24,6 @@
+ 
+ int MainCmds::runtests(const vector<string>& args) {
+   (void)args;
+-  testAssert(sizeof(size_t) == 8);
+   Board::initHash();
+   ScoreValue::initTables();
+ 
diff --git a/srcpkgs/KataGo-eigen/patches/search.cpp.patch b/srcpkgs/KataGo-eigen/patches/search.cpp.patch
new file mode 100644
index 000000000000..864219e11441
--- /dev/null
+++ b/srcpkgs/KataGo-eigen/patches/search.cpp.patch
@@ -0,0 +1,11 @@
+--- a/cpp/search/search.cpp	2022-03-20 15:12:06.000000000 -0500
++++ b/cpp/search/search.cpp	2022-07-23 09:11:16.099471820 -0500
+@@ -458,7 +458,7 @@
+   //Compute caps on search
+   int64_t maxVisits = pondering ? searchParams.maxVisitsPondering : searchParams.maxVisits;
+   int64_t maxPlayouts = pondering ? searchParams.maxPlayoutsPondering : searchParams.maxPlayouts;
+-  double_t maxTime = pondering ? searchParams.maxTimePondering : searchParams.maxTime;
++  double maxTime = pondering ? searchParams.maxTimePondering : searchParams.maxTime;
+ 
+   {
+     //Possibly reduce computation time, for human friendliness
diff --git a/srcpkgs/KataGo-eigen/template b/srcpkgs/KataGo-eigen/template
new file mode 100644
index 000000000000..830a8b987afd
--- /dev/null
+++ b/srcpkgs/KataGo-eigen/template
@@ -0,0 +1,30 @@
+# Template file for 'KataGo-eigen'
+pkgname=KataGo-eigen
+version=1.11.0
+revision=1
+wrksrc="KataGo-${version}"
+build_wrksrc=cpp
+build_style=cmake
+configure_args="-DUSE_BACKEND=EIGEN -DNO_GIT_REVISION=1"
+makedepends="zlib-devel libzip-devel eigen"
+depends="eigen"
+short_desc="KataGo Go/Weiqi/Baduk analysis engine (OpenCL backend)"
+maintainer="Jason Manley <jason@jasondavid.tv>"
+license="MIT"
+homepage="https://github.com/lightvector/KataGo/"
+distfiles="https://github.com/lightvector/KataGo/archive/refs/tags/v${version}.tar.gz"
+checksum=3f63aa5dfaab861360fd6f9548aa7f552b007cac7e90c99089d3bb4bb4b9d451
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-latomic"
+	makedepends+=" libatomic-devel"
+fi
+
+do_check() {
+	build/katago runtests
+}
+
+do_install() {
+	vbin build/katago
+	vlicense "${wrksrc}"/LICENSE
+}
diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index 072228c16915..ba6347bc94e5 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -1,15 +1,15 @@
 # Template file for 'eigen'
 pkgname=eigen
-version=3.3.9
+version=3.4.0
 revision=1
 build_style=cmake
 configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Jason Manley <jason@jasondavid.tv>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="https://eigen.tuxfamily.org/"
 distfiles="https://gitlab.com/libeigen/eigen/-/archive/${version}/eigen-${version}.tar.bz2"
-checksum=0fa5cafe78f66d2b501b43016858070d52ba47bd9b1016b0165a7b8e04675677
+checksum=b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626
 
 post_install() {
 	vlicense COPYING.BSD

  parent reply	other threads:[~2022-07-30 18:19 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 13:40 [PR PATCH] " jason1987d
2022-07-22 15:47 ` [PR REVIEW] " Chocimier
2022-07-22 15:47 ` Chocimier
2022-07-22 15:47 ` Chocimier
2022-07-22 15:47 ` Chocimier
2022-07-22 17:26 ` [PR PATCH] [Updated] " jason1987d
2022-07-22 17:26 ` jason1987d
2022-07-22 18:19 ` jason1987d
2022-07-22 20:19 ` Chocimier
2022-07-22 21:24 ` jason1987d
2022-07-22 21:24 ` jason1987d
2022-07-22 21:52 ` jason1987d
2022-07-22 22:04 ` jason1987d
2022-07-22 22:09 ` [PR PATCH] [Updated] " jason1987d
2022-07-23 13:47 ` jason1987d
2022-07-23 13:48 ` jason1987d
2022-07-23 16:43 ` jason1987d
2022-07-23 16:49 ` jason1987d
2022-07-24  1:47 ` jason1987d
2022-07-25 16:34 ` [PR REVIEW] " Chocimier
2022-07-25 16:34 ` Chocimier
2022-07-26 13:33 ` [PR PATCH] [Updated] " jason1987d
2022-07-26 13:36 ` jason1987d
2022-07-26 15:19 ` [PR PATCH] [Updated] " jason1987d
2022-07-27 18:56 ` Chocimier
2022-07-29 21:16 ` [PR PATCH] [Updated] " jason1987d
2022-07-29 21:17 ` jason1987d
2022-07-29 21:18 ` jason1987d
2022-07-29 21:30 ` jason1987d
2022-07-30  1:29 ` jason1987d
2022-07-30  1:40 ` jason1987d
2022-07-30  1:40 ` jason1987d
2022-07-30  1:40 ` jason1987d
2022-07-30  1:41 ` jason1987d
2022-07-30  1:41 ` jason1987d
2022-07-30  1:45 ` jason1987d
2022-07-30  1:48 ` jason1987d
2022-07-30 13:46 ` Chocimier
2022-07-30 18:08 ` jason1987d
2022-07-30 18:19 ` jason1987d [this message]
2022-07-31 21:14 ` jason1987d
2022-08-02 17:57 ` [PR REVIEW] " Chocimier
2022-08-02 17:57 ` Chocimier
2022-08-02 21:15 ` jason1987d
2022-08-02 21:45 ` Chocimier
2022-08-03  4:32 ` [PR PATCH] [Updated] " jason1987d
2022-08-12 14:38 ` jason1987d
2022-09-11  5:22 ` jason1987d
2022-09-11  5:24 ` [PR PATCH] [Closed]: " jason1987d
2022-09-11  5:24 ` [PR PATCH] [Updated] " jason1987d
2022-09-11 13:53 ` jason1987d

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=20220730181940.xXBG9RtWAeQVvQAneqj1lunK9gxZl8j81SrthBYqrAE@z \
    --to=jason1987d@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /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.
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 NNTP newsgroup(s).