- A chess engine for UCI.
- MIT License software.
- Written in C++11 and only use the standard libraries.
- Easy to build with CMake.
- Equipped Lisp interpreter that is named Sayulisp.
- Sayulisp can generate and operate Chess Engine.
- Sayulisp can customize algorithm of Search Function.
- Sayulisp can customize values of Evaluation Function.
- src : Source files.
- SayuriCompiled : Binary files.
- Linux : Binary files for Linux.
- For64Bit : For 64 bit machines.
- Windows : Binary files for Windows. (Created by Linux's MinGW.)
- For64Bit : For 64 bit machines.
- Android : Binary file for Android.
- Linux : Binary files for Linux.
- SayuriLogo : Logo image files.
- SampleGames : Sample game files of Sayuri vs other chess engines.
- DocumentsHTML : Documents.
- Tools : Convenient tools.
- README.md : README file.
- CMakeLists.txt : A configuration file for CMake.
- LICENSE : The software license.
Using CMake, you can build Sayuri easily.
- CMake options.
-DCMAKE_C_COMPILER=<cc>
: Indicates C compiler.- Default is "
clang
".
- Default is "
-DCMAKE_CXX_COMPILER=<cc>
: Indicates C++ compiler.- Default is "
clang++
".
- Default is "
-DARCH_OPTION=<option>
: Indicates C++ compiler.- Default is "
-march=native
". - If
<option>
is "-m64
", it builts for 64bit machine.
- Default is "
-DCMAKE_INSTALL_PREFIX=<prefix>
: Indicates prefix of install path.- Default is "
/usr/local
".
- Default is "
-DBIN_DIR=<dir>
: Indicates place where binary file puts on.- Not includes prefix.
- Default is "
bin
". (If prefix is "/usr/local
", the install directory is "/usr/local/bin
")
- Change directory to where "CMakeLists.txt" is placed in.
- Run the following commands.
$ mkdir build
$ cd build
$ cmake ..
- If you want to change a compiler into
<cc>
, you should call...
$ cmake -DCMAKE_CXX_COMPILER=<cc> ..
- If you want to change a compiler into
$ make
- "sayuri" is built.
- If you want to install Sayuri, you can use "
make install
" command.
"for Debug" means "No Optimize" and "Embedded Debug Information".
- Change directory to where "CMakeLists.txt" is placed in.
- Run the following commands.
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
- If you want to change a compiler into
<cc>
, you should call...
$ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=<cc> ..
- If you want to change a compiler into
$ make
- "sayuri" is built.
If you don't have CMake, you can build "sayuri" by the following commands in "src" directory.
If you have "clang" :
clang++ -std=c++11 -fno-rtti -Ofast -march=native -pthread -o sayuri *.cpp
If you have "gcc" :
g++ -std=c++11 -fno-rtti -Ofast -march=native -pthread -o sayuri *.cpp
After building Sayuri with CMake, run "$ make dist
" command.
The following packages will be created.
- sayuri-xxxx.xx.xx.tar.Z
- sayuri-xxxx.xx.xx.tar.bz2
- sayuri-xxxx.xx.xx.tar.gz
(Note: "xxxx.xx.xx" is the version number.)
Sayuri's source code can be used as library.
The Library has only one function.
extern "C"
const char* ExecuteSayulisp(const char* code)
-
Delete
main.cpp
, because it hasmain()
function. -
Include
sayuri.h
with#include "sayuri.h"
. -
Call
const char* ExecuteSayulisp(const char* code)
.code
is Sayulisp.- Returns S-Expression.
If you want to call Sayuri from Python on Linux, then...
(Step 1) Delete main.cpp
, because it has main()
function.
(Step 2) Build libsayuri.so
by...
$ <g++ | clang++> -std=c++11 -Ofast -pthread -march=native -fno-rtti \
-shared -fPIC -o libsayuri.so *.cpp
(Step 3) Use from Python.
from ctypes import*
# Load.
lib = cdll.LoadLibrary("/path/to/libsayuri.so")
# Get ready.
sayulisp = lib.ExecuteSayulisp
sayulisp.restype = c_char_p
sayulisp.argtype = (c_cahr_p)
# Go.
print(sayulisp(b"(+ 1 2 3)"))
-
To change size of the hash table. (Default: 1 MB, Max: 8192 MB, Min: 1 MB)
setoption name Hash value <Size(MB)>
(Note!!)<Size(MB)>
must be 2^n. (e.g. 128, 256, 512, 1024,...)
-
To initialize the hash table.
setoption name Clear Hash
-
To enable Ponder. (Default: true)
setoption name Ponder value <true or false>
-
To change the number of threads. (Default: 1, Max: 64, Min: 1)
setoption name Threads value <Number of threads>
-
To enable analyse mode. (Default: false)
setoption name UCI_AnalyseMode value <true or false>