From 68c2325f959670762f7ed89b3be1ca7c1d68d82b Mon Sep 17 00:00:00 2001 From: shtayerc Date: Mon, 11 May 2020 22:34:15 +0200 Subject: [PATCH 1/2] New package: lc0-openblas-0.25.1 --- .../lc0-openblas/patches/eigen_nowrap.patch | 24 ++++++++++++ srcpkgs/lc0-openblas/template | 38 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 srcpkgs/lc0-openblas/patches/eigen_nowrap.patch create mode 100644 srcpkgs/lc0-openblas/template diff --git a/srcpkgs/lc0-openblas/patches/eigen_nowrap.patch b/srcpkgs/lc0-openblas/patches/eigen_nowrap.patch new file mode 100644 index 00000000000..af8ff7abb65 --- /dev/null +++ b/srcpkgs/lc0-openblas/patches/eigen_nowrap.patch @@ -0,0 +1,24 @@ +From 0e1158f4bf92e8cfcf20b63a8d61687ca3a79a4c Mon Sep 17 00:00:00 2001 +From: shtayerc +Date: Tue, 28 Apr 2020 19:46:13 +0200 +Subject: [PATCH] Check if eigen is availiable before pulling subproject + +This patch will be removed when +https://github.com/LeelaChessZero/lc0/pull/1248 is merged +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git meson.build b/meson.build +index 65591353a..929a48fa0 100644 +--- meson.build ++++ meson.build +@@ -252,7 +252,7 @@ if get_option('build_backends') + + endif + +- deps += subproject('eigen').get_variable('eigen_dep') ++ deps += dependency('eigen3', fallback: ['eigen', 'eigen_dep']) + + ispc = find_program('ispc', required: false) + ispc_extra_args = [] diff --git a/srcpkgs/lc0-openblas/template b/srcpkgs/lc0-openblas/template new file mode 100644 index 00000000000..4f389a64dbd --- /dev/null +++ b/srcpkgs/lc0-openblas/template @@ -0,0 +1,38 @@ +# Template file for 'lc0-openblas' +pkgname=lc0-openblas +version=0.25.1 +revision=1 +wrksrc="lc0-${version}" +build_style=meson +configure_args="-Dgtest=false --buildtype=release" +meson_builddir="build/release" +_githash=a6539d613cf9076a0423b776dd5d03fc2ec0c3ac +hostmakedepends="tar pkg-config" +makedepends="openblas-devel protobuf-devel zlib-devel eigen" +short_desc="UCI chess engine designed to play via neural network - OpenBLAS backend" +maintainer="shtayerc " +license="GPL-3.0-only" +homepage="http://lczero.org" +distfiles="https://github.com/LeelaChessZero/lc0/archive/v${version}.tar.gz + https://github.com/LeelaChessZero/lczero-common/archive/${_githash}.tar.gz" +checksum="b3ab5b84f86d52981cff4804821178462028940c22963d544a4af8d19e13ad74 + 6d8e4609b5ad735c924cc8c13d7d2728f90e1eee29f43d761f0b5ac4072f976c" + +alternatives="lc0:lc0:/usr/bin/lc0-openblas" + +if [ "$CROSS_BUILD" ]; then + configure_args+=" -Dopenblas_include=${XBPS_CROSS_BASE}/usr/include/openblas/" +fi + +if [ "$XBPS_TARGET_MACHINE" = "armv6l-musl" ]; then + LDFLAGS+=-latomic + makedepends+=" libatomic-devel" +fi + +post_extract() { + cp -a ../lczero-common-${_githash}/proto/ ./libs/lczero-common/ +} + +do_install() { + vbin build/release/lc0 lc0-openblas +} From 6e5e07318e4a4e479639c6092394092bba0f7085 Mon Sep 17 00:00:00 2001 From: shtayerc Date: Mon, 11 May 2020 22:34:36 +0200 Subject: [PATCH 2/2] New package: lc0-opencl-0.25.1 --- srcpkgs/lc0-opencl/patches/eigen_nowrap.patch | 24 +++++++++++++ srcpkgs/lc0-opencl/template | 34 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 srcpkgs/lc0-opencl/patches/eigen_nowrap.patch create mode 100644 srcpkgs/lc0-opencl/template diff --git a/srcpkgs/lc0-opencl/patches/eigen_nowrap.patch b/srcpkgs/lc0-opencl/patches/eigen_nowrap.patch new file mode 100644 index 00000000000..af8ff7abb65 --- /dev/null +++ b/srcpkgs/lc0-opencl/patches/eigen_nowrap.patch @@ -0,0 +1,24 @@ +From 0e1158f4bf92e8cfcf20b63a8d61687ca3a79a4c Mon Sep 17 00:00:00 2001 +From: shtayerc +Date: Tue, 28 Apr 2020 19:46:13 +0200 +Subject: [PATCH] Check if eigen is availiable before pulling subproject + +This patch will be removed when +https://github.com/LeelaChessZero/lc0/pull/1248 is merged +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git meson.build b/meson.build +index 65591353a..929a48fa0 100644 +--- meson.build ++++ meson.build +@@ -252,7 +252,7 @@ if get_option('build_backends') + + endif + +- deps += subproject('eigen').get_variable('eigen_dep') ++ deps += dependency('eigen3', fallback: ['eigen', 'eigen_dep']) + + ispc = find_program('ispc', required: false) + ispc_extra_args = [] diff --git a/srcpkgs/lc0-opencl/template b/srcpkgs/lc0-opencl/template new file mode 100644 index 00000000000..2d3631bbc9e --- /dev/null +++ b/srcpkgs/lc0-opencl/template @@ -0,0 +1,34 @@ +# Template file for 'lc0-opencl' +pkgname=lc0-opencl +version=0.25.1 +revision=1 +wrksrc="lc0-${version}" +build_style=meson +configure_args="-Dgtest=false --buildtype=release" +meson_builddir="build/release" +_githash=a6539d613cf9076a0423b776dd5d03fc2ec0c3ac +hostmakedepends="tar pkg-config" +makedepends="ocl-icd-devel protobuf-devel zlib-devel eigen" +short_desc="UCI chess engine designed to play via neural network - OpenCL backend" +maintainer="shtayerc " +license="GPL-3.0-only" +homepage="http://lczero.org" +distfiles="https://github.com/LeelaChessZero/lc0/archive/v${version}.tar.gz + https://github.com/LeelaChessZero/lczero-common/archive/${_githash}.tar.gz" +checksum="b3ab5b84f86d52981cff4804821178462028940c22963d544a4af8d19e13ad74 + 6d8e4609b5ad735c924cc8c13d7d2728f90e1eee29f43d761f0b5ac4072f976c" + +alternatives="lc0:lc0:/usr/bin/lc0-opencl" + +if [ "$XBPS_TARGET_MACHINE" = "armv6l-musl" ]; then + LDFLAGS+=-latomic + makedepends+=" libatomic-devel" +fi + +post_extract() { + cp -a ../lczero-common-${_githash}/proto/ ./libs/lczero-common/ +} + +do_install() { + vbin build/release/lc0 lc0-opencl +}