Saturday, August 13, 2016

Setting up Crafty chess engine on Linux/Ubuntu

Crafty installation is pretty simple. The command

sudo apt-get install crafty

will install crafty at /usr/games/crafty and the book files at /usr/share/crafty/books.bin.

If the book files are not installed they can be manually installed by

sudo apt-get install crafty-books-medtosmall

Sometimes the book are not automatically installed in the home folder and it will result in the following error when crafty is run from the command line.

Machine is NUMA, 1 nodes (6 cpus/node)

unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].
ERROR, unable to open game history file, exiting

This implies that we need to import the book.bin and books.bin which contain a vast array of opening moves into the local ~/.crafty directory. For that, we need to run the However, it needs to be made executable by the normal user first. As root go to the directory /usr/share/doc/crafty and do the following,

cd /usr/share/doc/crafty 
sudo chmod 777 

Then logout from root, go back to the same directory /usr/share/doc/crafty and run as user:


Don't run the last command as root otherwise the .crafty directory will be created in the /root directory! It will spit out a few lines of info. Copy the lines

export CRAFTY_LOG_PATH=/home/<USERNAME>/.crafty
export CRAFTY_RC_PATH=/home/<USERNAME>/.crafty
export CRAFTY_TB_PATH=/home/<USERNAME>/.crafty
export CRAFTY_BOOK_PATH=/home/<USERNAME>/.crafty

to .bashrc file and then

source .bashrc

After that source

source /home/<USERNAME>/.crafty/env_settings

Run Crafty. It should be able to see the book files now.

No comments:

OK GOOGLE on Samsung Galaxy S7 doesn’t work

To make Ok Google detection work on Galaxy S7 (Galaxy series phones) we need to perform a couple of steps. 1. As long as Samsung S vo...