The package rpms/stockfish.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/stockfish.git/commit/?id=58af5b65....
Change:
+%ifarch armv7hl
Thanks.
Full change:
============
commit f670b813f54b3df2d9a3fe01156fff4b58190620
Author: Ondrej Mosnacek <omosnace(a)redhat.com>
Date: Tue Nov 9 16:07:19 2021 +0100
Use %{_mandir} instead of %{_datadir}/man
Spotted by Ben Beasley (@music).
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
diff --git a/stockfish.spec b/stockfish.spec
index 724de6e..718ff8b 100644
--- a/stockfish.spec
+++ b/stockfish.spec
@@ -88,8 +88,8 @@ sed -e 's,\(EngineDir = \).*,\1%{_bindir},' \
%install
mkdir -p %{buildroot}%{_bindir}
install -m 755 -p src/%{name} %{buildroot}%{_bindir}
-mkdir -p %{buildroot}%{_datadir}/man/man6
-cp -p %{name}.6 %{buildroot}%{_datadir}/man/man6
+mkdir -p %{buildroot}%{_mandir}/man6
+cp -p %{name}.6 %{buildroot}%{_mandir}/man6
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
cp -p polyglot.ini %{buildroot}%{_sysconfdir}/%{name}
@@ -102,7 +102,7 @@ cp -p polyglot.ini %{buildroot}%{_sysconfdir}/%{name}
%files
%license Copying.txt
%doc AUTHORS %{name}-interface.txt README.md
-%{_datadir}/man/man*/%{name}*
+%{_mandir}/man*/%{name}*
%{_bindir}/%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/polyglot.ini
commit 3b1136535a4cc428241eaed22d98712394a20cd8
Author: Ondrej Mosnacek <omosnace(a)redhat.com>
Date: Tue Nov 9 16:04:13 2021 +0100
Add comment regarding -O3
The discovery and benchmarks are courtesy of Ben Beasly (@music).
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
diff --git a/stockfish.spec b/stockfish.spec
index c3d2639..724de6e 100644
--- a/stockfish.spec
+++ b/stockfish.spec
@@ -74,6 +74,12 @@ sed -e 's,\(EngineDir = \).*,\1%{_bindir},' \
%global sfarch armv7
%endif
+# NOTE: The upstream Makefile adds some flags on top of the Fedora ones.
+# Most of them are harmless/redundant except -O3. However, benchmarks
+# (based on the duration of `stockfish bench` in koji builders) support
+# the use of -O3 here:
+# Architecture | armv7hl | i686 | x86_64 | aarch64 | ppc64le | s390x
+# -O3 speedup | 1%% | 14%% | 13%% | 10%% | 31%% | 1%%
%make_build -C src build ARCH=%sfarch \
EXTRACXXFLAGS="%{build_cxxflags}" \
EXTRALDFLAGS="%{build_ldflags}"
commit c2577cf314ff864d674e985c3ba03b19e290e632
Author: Ondrej Mosnacek <omosnace(a)redhat.com>
Date: Mon Nov 8 21:52:48 2021 +0100
Bump to version 14.1
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
diff --git a/.gitignore b/.gitignore
index d1176a7..d8ab471 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,18 +1,2 @@
-/stockfish-1e6d21d.tar.gz
-/stockfish-cb2111f.tar.gz
-/stockfish-2e86d1febc163e076320a6a21060fc5a1c7c0dff.tar.gz
-/stockfish-interface.txt
-/stockfish.6
-/stockfish-polyglot.ini
-/Stockfish-CMakeLists.txt
-/stockfish-4095ff0ee51bdc76c247bd11d5f3a7008974e2ad.tar.gz
-/stockfish-69a1a808c8ed02332914afbb503f3d96fa8bb093.tar.gz
-/stockfish-55b46ffa909cf3873e4ac7129e324ed3eb1d0124.tar.gz
-/stockfish-76ed0ab5015f41715453a7efcedd57a7a5c962da.tar.gz
-/stockfish-aedebe35cfa38b543041bae97e91e8194738b202.tar.gz
-/stockfish-e1a7d135b2b1c6118ba514fa41c2104245bd1caf.tar.gz
-/stockfish-8-src.zip
-/stockfish-9-src.zip
-/stockfish-10-src.zip
-/stockfish-11-linux.zip
-/sf_12.zip
+/sf_*.zip
+/nn-*.nnue
diff --git a/sources b/sources
index 16566b5..80d177e 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
-SHA512 (sf_12.zip) =
7746b43d979ff935d5e2def24e25af19ed67d1caeadfc684f91aac3cde5f81964dc4b4afeccf7bd8ea1c5fd973b7902b3b2f98d644a3c9e1ab8d5aa7b3051efb
+SHA512 (sf_14.1.zip) =
531a54a7a792a722438aacfdf61d064b107365672852599c1b027bd2c0c3f903e6600c8eedc95c60c734d169562f9977cb7f5dc3ede18d8fc20627c7c23cafba
+SHA512 (nn-13406b1dcbe0.nnue) =
89b1242262d10aba9de168d5fdcaf70b36f9ad84d79eca7245591174c679473d60251b30d8a05100967fd5bf0e8e59632749d6d77f2bbdce0a3f77b8d15dd5cc
diff --git a/stockfish.spec b/stockfish.spec
index 3f49aad..c3d2639 100644
--- a/stockfish.spec
+++ b/stockfish.spec
@@ -1,9 +1,9 @@
%global srcname Stockfish
-%global nnuehash 82215d0fd0df
+%global nnuehash 13406b1dcbe0
Name: stockfish
-Version: 12
-Release: 3%{?dist}
+Version: 14.1
+Release: 1%{?dist}
#Source0: %%{url}/files/%%{name}-%%{version}-linux.zip
Source0:
https://github.com/official-%{name}/%{srcname}/archive/sf_%{version}.zip
Summary: Powerful open source chess engine
@@ -103,6 +103,13 @@ cp -p polyglot.ini %{buildroot}%{_sysconfdir}/%{name}
%changelog
+* Mon Nov 08 2021 Ondrej Mosnacek <omosnace(a)redhat.com> - 14.1-1
+- Adapt spec file for NNUE support
+- Use upstream buildsystem
+- Bump to version 14.1
+- Resolves: rhbz#1875192
+- Resolves: rhbz#1988004
+
* Fri Jul 23 2021 Fedora Release Engineering <releng(a)fedoraproject.org> - 12-3
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
commit 58af5b653cc0b67d403fe5eea03ffc05f6a31428
Author: Ondrej Mosnacek <omosnace(a)redhat.com>
Date: Mon Nov 8 20:43:26 2021 +0100
Use upstream buildsystem
Drop the downstream CMakeLists.txt and just use the upstream Makefile
directly. This needs some careful setting of Make variables, but
otherwise works just fine.
Also simplify the sanity check using the bench command (the default
quick bench is just fine) and fix the README.md file name to get a
successful build.
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
diff --git a/stockfish-CMakeLists.txt b/stockfish-CMakeLists.txt
deleted file mode 100644
index 276cc81..0000000
--- a/stockfish-CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-project (Stockfish)
-
-set(EXE stockfish)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
-
-include_directories(${PROJECT_SOURCE_DIR}/syzygy)
-
-aux_source_directory(. SOURCES)
-
-add_executable(${EXE} ${SOURCES} syzygy/tbprobe.cpp)
-
-target_link_libraries(${EXE} -lpthread)
diff --git a/stockfish.spec b/stockfish.spec
index d87ffed..3f49aad 100644
--- a/stockfish.spec
+++ b/stockfish.spec
@@ -1,9 +1,6 @@
%global srcname Stockfish
%global nnuehash 82215d0fd0df
-%global _vpath_srcdir src
-%undefine __cmake_in_source_build
-
Name: stockfish
Version: 12
Release: 3%{?dist}
@@ -24,12 +21,8 @@ Source11:
https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/%{na
# polyglot support
Source20:
https://raw.githubusercontent.com/mpurland/%{name}/master/polyglot.ini#/%...
-# FIXME cmake,
https://github.com/official-stockfish/Stockfish/issues/272
-Source30: %{name}-CMakeLists.txt
-
-BuildRequires: gcc
BuildRequires: gcc-c++
-BuildRequires: cmake
+BuildRequires: make
#Suggests: polyglot-chess
@@ -60,19 +53,35 @@ sed -e 's,\(EngineDir = \).*,\1%{_bindir},' \
-e 's,\(LogFile = \).*,\1~/,' -e 's,\(LogFile = \).*,\1false,' \
%{SOURCE20} >polyglot.ini
-# use cmake with Fedora compiler flags
-cp -p %{SOURCE30} src/CMakeLists.txt
-rm src/Makefile
-
%build
-%cmake
-%cmake_build
+# default to general-64, which also works for s390x
+%global sfarch general-64
+
+%ifarch x86_64
+%global sfarch x86-64
+%endif
+%ifarch i686
+%global sfarch x86-32
+%endif
+%ifarch ppc64le
+%global sfarch ppc-64
+%endif
+%ifarch aarch64
+%global sfarch armv8
+%endif
+%ifarch armv7hl
+%global sfarch armv7
+%endif
+
+%make_build -C src build ARCH=%sfarch \
+ EXTRACXXFLAGS="%{build_cxxflags}" \
+ EXTRALDFLAGS="%{build_ldflags}"
%install
mkdir -p %{buildroot}%{_bindir}
-install -m 755 -p %{_vpath_builddir}/%{name} %{buildroot}%{_bindir}
+install -m 755 -p src/%{name} %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/man/man6
cp -p %{name}.6 %{buildroot}%{_datadir}/man/man6
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
@@ -80,13 +89,13 @@ cp -p polyglot.ini %{buildroot}%{_sysconfdir}/%{name}
%check
-# taken from official Makefile
-./%{_vpath_builddir}/%{name} bench 16 1 1000 default time
+# run bench as a sanity check
+./src/%{name} bench
%files
%license Copying.txt
-%doc AUTHORS %{name}-interface.txt Readme.md
+%doc AUTHORS %{name}-interface.txt README.md
%{_datadir}/man/man*/%{name}*
%{_bindir}/%{name}
%dir %{_sysconfdir}/%{name}
commit 3dae150b9d4a007322e3e07fede8a84722b820bf
Author: Ondrej Mosnacek <omosnace(a)redhat.com>
Date: Mon Nov 8 19:59:43 2021 +0100
Adapt spec file for NNUE support
SF 12 added position evaluation using NNUE [1], which requires a
pre-trained binary neural network to run. For Stockfish, this file is
provided via the Fishtest website [2] under CC0 license. Each release
references a specific default NNUE file via its hash. During build, the
default NNUE file is embedded into the binary for convenience. The user
can specify an alternate NNUE file on runtime via the UCI interface.
In Fedora we will treat this file as another source and store it in the
lookaside cache. The hash of the file will be hardcoded in the specfile
and needs to be updated along with the source when switching to a new
release.
[1]
https://www.chessprogramming.org/NNUE
[2]
https://tests.stockfishchess.org/nns
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
diff --git a/stockfish.spec b/stockfish.spec
index 8b9a268..d87ffed 100644
--- a/stockfish.spec
+++ b/stockfish.spec
@@ -1,4 +1,5 @@
%global srcname Stockfish
+%global nnuehash 82215d0fd0df
%global _vpath_srcdir src
%undefine __cmake_in_source_build
@@ -9,9 +10,13 @@ Release: 3%{?dist}
#Source0: %%{url}/files/%%{name}-%%{version}-linux.zip
Source0:
https://github.com/official-%{name}/%{srcname}/archive/sf_%{version}.zip
Summary: Powerful open source chess engine
-License: GPLv3+
+# CC0 is for the NNUE network file (see
https://tests.stockfishchess.org/nns)
+License: GPLv3+ and CC0
URL: http://%{name}chess.org
+# the NN file
+Source1:
https://tests.stockfishchess.org/api/nn/nn-%nnuehash.nnue
+
# steal some documentation from ubuntu
Source10:
https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/%{name}/vivid/...
Source11:
https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/%{name}/vivid/...
@@ -37,16 +42,24 @@ information about how to use Stockfish with your GUI.
%prep
+# verify the NNUE net checksum early to catch maintainer error
+test %nnuehash = "$(sha256sum %{SOURCE1} | cut -c1-12)"
+
#%%autosetup -n%%{name}-%%{version}-linux
%autosetup -n%{srcname}-sf_%{version}
+
cp -t. -p %{SOURCE10} %{SOURCE11}
+cp -tsrc -p %{SOURCE1}
+
# W: wrong-file-end-of-line-encoding
sed -i 's,\r$,,' %{name}-interface.txt
+
# polyglot of installed binary and disable log
sed -e 's,\(EngineDir = \).*,\1%{_bindir},' \
-e 's,\(EngineCommand = \).*,\1%{name},' \
-e 's,\(LogFile = \).*,\1~/,' -e 's,\(LogFile = \).*,\1false,' \
%{SOURCE20} >polyglot.ini
+
# use cmake with Fedora compiler flags
cp -p %{SOURCE30} src/CMakeLists.txt
rm src/Makefile