So as a side project I decided to write Cutechess-cli, which uses the same chess library we develop, but is only used for running chess matches from the command line, very much like Xboard. So why would anyone use this tool over Xboard?:
- No GUI means that the host doesn't need an Xserver (Unix). This is a very good thing if you use a cluster of headless PCs for engine testing.
- Lightweight. Uses very little memory and very few cpu cycles.
- Supports both Xboard and UCI
If you run cutechess-cli with the --help parameter you'll get this:
Code: Select all
Usage: cutechess-cli -fcp [eng_options] -scp [eng_options] [options]
Options:
-fcp <options> Apply <options> to the first engine
-scp <options> Apply <options> to the second engine
-both <options> Apply <options> to both engines
-variant <arg> Set chess variant to <arg>. Must be Standard,
Fischerandom, Capablanca, Gothic or Caparandom
-book <file> Use <file> (Polyglot book file) as the opening book
-bookdepth <n> Set the maximum book depth (in plies) to <n>
-event <arg> Set the event name to <arg>
-games <n> Play <n> games
-debug Display all engine input and output
-pgnin <file> Use <file> as the opening book in PGN format
-pgnout <file> Save the games to <file> in PGN format
-repeat Play each opening twice so that both players get
to play it on both sides
-site <arg> Set the site/location to <arg>
Engine options:
name=<arg> Set the name to <arg>
cmd=<arg> Set the command to <arg>
dir=<arg> Set the working directory to <arg>
proto=<arg> Set the chess protocol to <arg>. Must be xboard or uci
tc=<arg> Set the time control to <arg>. The format is
moves/time+increment, where 'moves' is the number of
moves per tc, 'time' is time per tc (either seconds or
minutes:seconds), and 'increment' is time increment
per move in seconds
cpus=<n> Tell the engine to use a maximum of <n> cpus
egbbpath=<dir> Set the path to endgame bitbases to <dir>
egtbpath=<dir> Set the path to endgame tablebases to <dir>
uci/<name> <arg> Set UCI option <name> to value <arg>
cutechess-cli -fcp name=Atak cmd=Atak32.exe dir=C:\chess\atak proto=xboard -scp cmd=glaurung proto=uci cpus=1 -both tc=40/60 -games 2
- Use the "name=Atak" parameter because it's a Xboard protocol 1 engine and doesn't tell its name.
- Use the "dir=C:\chess\atak" parameter because Atak's executable isn't in the PATH environment.
- Glaurung can tell its name and is in the path, so I don't use the name and dir parameters.
- Set Glaurung to use 1 thread
- Set the time control for both players to 40 moves in 60 seconds
- Play 2 games
cutechess-cli -fcp cmd=sloppy proto=xboard tc=40/1:30+1 -fcp cmd=glaurung proto=uci tc=60 uci/Hash=64 -games 10 -debug -book C:\dann_books\book.bin -bookdepth 20 -repeat -pgnout games.pgn
- Set Sloppy's time control to 40 moves in 1 minutes and 30 seconds with a 1 second increment.
- Set Glaurung's time control to 60 seconds for the whole game.
- Set Glaurung's Hash option to 64. You can put any option name after "uci/".
- Play 10 games.
- The -debug option means that all engine input and output is displayed. If you want to log it in a file you can put "> logfile.txt" to the end of the command.
- Use "C:\dann_books\book.bin" as the opening book. It must be in Polyglot format.
- Play a maximum of 20 halfmoves from the book.
- Play each opening (book line) twice, so that both engines get to play it on both sides
- Save the games to "games.pgn"
Those who like to compile stuff can grab the source code here: http://repo.or.cz/w/sloppygui.git
I also have binaries for some platforms:
Mac OSX 10.4 and up (Intel only): http://koti.mbnet.fi/~ilaripih/bin/cute ... li-osx.zip
Use the "cutechess-cli.sh" script, not the binary file directly.
Linux 64-bit: http://koti.mbnet.fi/~ilaripih/bin/cute ... x64.tar.gz
You need libqt4-core installed ("sudo apt-get install libqt4-core" on Ubuntu)
Use the "cutechess-cli.sh" script, not the binary file directly.
Windows 32-bit: http://koti.mbnet.fi/~ilaripih/bin/cute ... -win32.zip
I haven't tested the binaries on machines that don't already have Qt libraries installed, so I hope they work. If not, please let me know.
I don't have a binary for 32-bit Linux yet.
This is work in progress, so there may be bugs. I'd appreciate it if you could report them to me.