-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILDING.txt
81 lines (58 loc) · 2.66 KB
/
BUILDING.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Sturddle Engine Components
==========================
1) Python extension module written in C++,
2) sturddle.py script
3) UCI extension module (uci.pyx)
4) worker.py script for running a background thread when thinking on the opponents' time (Ponder).
5) nnue binary file (provided)
GUI Integration
===============
XBoard, Cutechess and Arena 3.5.1 (probably others, untested) have settings where
the command line for an engine can be specified (check the respective docs);
the command for running Sturddle is:
python3 <directory-where-built>/sturddle.py
On Linux the python3 part can be omitted if the script is made executable:
chmod +x sturddle.py
Some GUIs such as Shredder expect the command to be an EXE file, and do not
accept scripts and command line arguments. For a workardound see the optional last step
below for building a one-file executable.
Prerequisite Steps
==================
A working C++ compiler.
On Linux and Mac clang-15 is recommended for best performance (GCC may work, not tested).
Visual Studio is a good choice for Windows: https://visualstudio.microsoft.com/vs/community/
Clone the git repository. Building from ZIP source archives from releases DOES NOT WORK.
This is because github does not recursively include submodules in release ZIPs.
git clone --recursive https://github.com/cristivlas/sturddle-chess-engine.git
The following sections assume your Python interpreter executable is called python3,
but on some systems (Windows?) it could be simply called python.
Dependencies
============
python chess, psutil, Cython (Cython is needed for building only, not at runtime)
Install with:
python3 -m pip install chess
python3 -m pip install psutil
python3 -m pip install Cython
Other requirements
==================
Python development libraries.
On Linux (Ubuntu, Mint) install with:
apt-get install python-dev
Under Windows, follow the instructions for developers at:
https://docs.python.org/3/using/windows.html
Build
=====
cd sturddle-sturddle-engine
CFLAGS=-march=native python3 setup.py build_ext --inplace
Native UCI
==========
The UCI protocol is implemented in Cython.
To experiment with a native C++ implementation, set NATIVE_UCI in the environment.
This will cause the uci_native.cpp code to be used insead of uci.pyx
uci_native.cpp requires a C++20 standard compiler.
Optional: One File Executable
=============================
PyInstaller can be used to bundle all the components into all-in-one, self-extracting executable.
(https://pyinstaller.org/en/stable/)
The (experimental) tools/build.py script generates a self-extracting executable that contains the
AVX512/AVX2/generic modules, the nnue file, the opening book, and all the scripts required to run.