# polychess/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. There's a type of chess software engine known as "UCI". This pack- age (polychess) builds and installs multiple UCI chess engines. It also adds CLI commands that users can use to play against the engines in XBoard. The core of the "polychess" package is a program known as the PolyGlot UCI Adapter. This program sits between conventional Linux chess GUIs (such as EBoard or XBoard) and UCI chess engines (such as Fruit Chess or Toga II). #--------------------------------------------------------------------- 2. More specifically: This package (polychess) installs the PolyGlot UCI Adapter and the following 7 UCI chess engines: * Donna Chess aka donna-chess * Fruit Chess 2.1 aka fruit-chess * Glaurung 1.21 aka glaurung * GNU Chess 6 aka gnuchess6 (running in UCI mode) * Stockfish 17 aka stockfish * Toga II aka toga-chess * Winter Chess aka winter-chess It provides a CLI command for each engine that can be used to play against the engine in XBoard. The CLI command is the same as the name in the 2nd column above: * donna-chess * fruit-chess * glaurung * gnuchess6 * stockfish * toga-chess * winter-chess The wrappers also add single-instance support. #--------------------------------------------------------------------- 3. This package doesn't provide, by itself, direct support for playing against each engine in EBoard. However, this distro patches EBoard to make EBoard support these engines. This package also provides pieces that make it easier to integrate these engines into unpatched copies of EBoard in different distros. To play against Fruit Chess using EBoard in a different distro, go to EBoard's Peer menu and select: Peer -> Play against Engine -> Generic Engine -> Engine Command Set the parameters on that screen as follows: Engine command line = polychess fruit-chess.ini Directory to run from = /foo Replace "/foo" with an absolute path for the directory (in the "poly- chess" package tree) that contains "fruit-chess" and "fruit-chess. ini". On the following tab, turn on Add to Peer/Engine Bookmarks: Peer -> Play against Engine -> Generic Engine -> Side & Time Proceed to play part of a game. If you're running a hard-disk distro (as opposed to a LiveDistro), you should only need to do this once. When you run EBoard in the future, you should find an entry for Fruit Chess on the following screen: Peer -> Engine Bookmarks The entry will probably refer to "polychess" as opposed to Fruit Chess. To avoid confusion, edit the bookmark's properties to correct this. The procedure used for other UCI chess engines in the "polychess" package is similar. Just substitute the appropriate base engine string for "fruit-chess". #--------------------------------------------------------------------- 4. If a chess GUI doesn't support the two parameters listed in the preceding section -- engine command line and directory to run from -- you may be able to use the "polychess" chess engines with it re- gardless. The main requirement is that, if the two parameters aren't supported, a chess GUI needs to accept, instead, a pathname for an XBoard-compat- ible chess engine. Plug the pathname for one of the following mid-level wrappers into the appropriate place and the GUI might work: polychess-donna-chess polychess-fruit-chess polychess-glaurung polychess-gnuchess6 polychess-stockfish polychess-toga-chess polychess-winter-chess #--------------------------------------------------------------------- 5. Filename details: * The PolyGlot UCI Adapter EXE is "polychess" * The Donna Chess engine EXE is "engine-donna-chess" * The Fruit Chess engine EXE is "engine-fruit-chess" * The Glaurung engine EXE is "engine-glaurung" * The GNU Chess 6 engine EXE is "gnuchessu" (see below) * The Stockfish engine EXE is "engine-stockfish" * The Toga Chess engine EXE is "engine-toga-chess" * The Winter Chess engine EXE is "engine-winter-chess" Note 5.1: The GNU Chess 6 engine EXE is built by, and stored in, the "gnuchess" package. The Laclin "polychess" package builds only supple- mental integration files in this one. * The PolyGlot Donna Chess INI file is "donna-chess.ini" * The PolyGlot Fruit Chess INI file is "fruit-chess.ini" * The PolyGlot Glaurung INI file is "glaurung.ini" * The PolyGlot GNU Chess 6 INI file is "gnuchess6.ini" * The PolyGlot Stockfish INI file is "stockfish.ini" * The PolyGlot Toga Chess INI file is "toga-chess.ini" * The PolyGlot Winter Chess INI file is "winter-chess.ini" Note 5.2. For all engines other than GNU Chess 6, Laclin "polychess" enables the use of chess opening books at the adapter level and disa- bles such use at the engine level. The opening book used, in each case, is specified in the associated engine ".ini" file. The opening book data files are stored in the "polychess" "program" directory and have the filename extension ".obk". GNU Chess 6 is configured so as to use its own engine-level opening book, which is stored in the "gnuchess" package and has the filename extension ".bin". Note 5.3. The local version of Glaurung uses two data files. The 1st data file is a ".obk" opening-book file that's used at the PolyGlot level. The 2nd data file is named "kpk.bin". It appears to be an end- game-related file. For more information, see the Glaurung source code. #--------------------------------------------------------------------- 6. Upstream source-code page URLs as of 2021: Donna Chess: TBD Fruit Chess 2.1: Seemed to be orphaned. There were source-code mirrors but there didn't seem to be an official site for the release 2.1 source code. Glaurung 1.21: Seemed to be orphaned. A "Glaurung Chess" website ex- isted, but we weren't able to find the release 1.21 source code there. GNU Chess 6: TBD Stockfish: TBD Toga II 1.31: Seemed to be orphaned. Winter Chess: TBD #--------------------------------------------------------------------- 7. The rest of this "polychess" documentation discusses the individual UCI chess engines provided. #--------------------------------------------------------------------- 8. Fruit Chess: Remarks below are from: "Chess engines for Linux" By M. Shuaib Khan on March 22, 2007 Fruit [Chess], developed by Fabien Letouzey, offers incredible play- ing strength. Fruit 2.2 finished second in the last World Computer Chess Championships in Reykjavik in 2005. Though it hasn't got any outstanding strengths, Fruit hasn't got any weaknesses either. It plays a strong opening game, with excellent tac- tics in the middle game, and a superior endgame. It can figure out weak moves on an opponent's part with great accuracy, and take full advantage of them. It has beaten strong commercial chess engines such as Shredder and Junior. Until version 2.1, Fruit was an open source engine, and the source code for version 2.1 is still available. But with Fruit becoming the strongest engine, the author decided to close the source code to avoid clones which might participate in official tournaments. #--------------------------------------------------------------------- 9. Toga II aka Toga Chess: As of Fall 2007, the release of Fruit Chess provided (2.1) was the last known open-source release. However, there's an alternate chess engine descended from the Fruit Chess 2.1 code that's continued to evolve. The alternate engine is named Toga II and this package builds it. #--------------------------------------------------------------------- 10. Glaurung. We're using Glaurung 1.21 instead of a newer release, 2.2, for two reasons: * Release 2.2 doesn't work correctly * Release 1.21 has a "much more entertaining style of play" Remarks below are from: "A very strong, UCI compatible Chess engine" https://pmbs.links2linux.org/package/show/Extra/glaurung121 This is the previous stable version of glaurung and also a very strong chess engine. Glaurung 1.2.1 is probably slightly weaker than Glaurung 2, but has a much more entertaining style of play. It uses the UCI (universal chess interface) for chess engines as com- munication protocol. This means to play against it, you have to use a UCI capable interface, like knights, or an xboard adapter like poly- glot. #--------------------------------------------------------------------- 11. Stockfish: Stockfish is descended from a fork of Glaurung. #--------------------------------------------------------------------- [buildtimes] 00.01 hours (or 000.43 minutes) - ThinkPad E540 i7 4x2 16GB RAM 00.01 hours (or 000.50 minutes) - HP EliteBook 8560w 32GB RAM 00.01 hours (or 000.70 minutes) - Dell Inspiron 6400 2.0 GHz Intel Duo 7200 2GB RAM 00.03 hours (or 001.92 minutes) - Compaq 1.7 GHz Intel Pentium 4 512MB RAM #--------------------------------------------------------------------- [settings] configure = none defer = glibc64 exepack = yes license = GNU General Public License, version 2 (June 1991) revision = special tmpsize = 1M unpack = none #--------------------------------------------------------------------- [depends] go unrar unzip #--------------------------------------------------------------------- [build] #--------------------------------------------------------------------- # Set some parameters. BINDIR=$PKGDIR_PROD/bin PROGDIR=$PKGDIR_PROD/program SPCDIR=$PKGDIR_SPECIAL ENGSRC=$SPCDIR/engine-src ENGBASES="\ donna-chess fruit-chess glaurung gnuchess6 stockfish toga-chess winter-chess" #--------------------------------------------------------------------- # Create some directories. mkdir -p $BINDIR $PROGDIR #--------------------------------------------------------------------- # Set up a temporary directory. mkdir tmp cd tmp HERE=`pwd` #--------------------------------------------------------------------- # Install some opening books. cd $HERE tar zxf $ENGSRC/donna-books.tgz cp -p donna-books/komodo.bin $PROGDIR/komodo.obk cp -p donna-books/rodent.bin $PROGDIR/rodent.obk rm -fr donna* cp -p $PKGDIR_SPECIAL/perfect-chess-books/perfect2021.bin \ $PROGDIR/perfect2021.obk #--------------------------------------------------------------------- # Build the "donna-chess" engine. BUILD_DONNA=yes if [ "@$BUILD_DONNA" == "@yes" ]; then cd $HERE tar zxf $ENGSRC/donna-chess.tgz cd donna-chess export GOPATH=`pwd` cd src/github.com/michaeldv/donna go mod init # Required as of "go" 1.16 go mod tidy # Ditto make -j4 strip bin/donna cp -p bin/donna $PROGDIR/engine-donna-chess unset GOPATH cd $HERE rm -fr donna* fi #--------------------------------------------------------------------- # Build the "fruit-chess" engine. cd $HERE unzip -a $ENGSRC/fruit_21_linux.zip cd fruit_21_linux/src make strip fruit cp -p fruit $PROGDIR/engine-fruit-chess cd $HERE rm -fr fruit_21_linux #--------------------------------------------------------------------- # Build the "toga-chess" engine. cd $HERE unrar x $ENGSRC/toga131.rar cd [tT]oga*/Distribute*/src make strip fruit cp -p fruit $PROGDIR/engine-toga-chess cd $HERE rm -fr [tT]oga* #--------------------------------------------------------------------- # Build the "glaurung" engine. cd $HERE unrar x $ENGSRC/glaurung121.rar cd glaurung*/src make strip glaurung cp -p glaurung $PROGDIR/engine-glaurung cp -p kpk.bin $PROGDIR/ cd $HERE rm -fr glaurung* #--------------------------------------------------------------------- # Build the "stockfish" engine. cd $HERE unzip -qo $ENGSRC/Stockfish-sf_17.zip cd Stockfish-sf_17/src tar zxvf $ENGSRC/nn-13406b1dcbe0.tgz make -j4 build ARCH=x86-64 strip stockfish cp -p stockfish $PROGDIR/engine-stockfish cd $HERE rm -fr stockfish* Stockfish* #--------------------------------------------------------------------- # Build the "winter-chess" engine. cd $HERE tar zxf $ENGSRC/winter-chess.tgz cd winter-chess sed -e 's/^CC=.*/CC=g++/' -i Makefile make -j 4 strip Winter cp -p Winter $PROGDIR/engine-winter-chess cd $HERE rm -fr winter-chess #--------------------------------------------------------------------- # Build the PolyGlot UCI Adapter. unzip -a $ENGSRC/polyglot_14.zip cd polyglot_14/src make strip polyglot cp -p polyglot $BINDIR/polychess cd $HERE rm -fr polyglot_14 #--------------------------------------------------------------------- # Install "deskwrap-BASENAME" wrappers. pushd $SPCDIR/deskwrap-engine/ for x in `deext *.in` do sed -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \ -e "s|__META_PRODTREE__|$PRODTREE|g" \ -e "s|__META_PROGDIR__|$PROGDIR|g" \ < $x.in \ > $PROGDIR/$x chmod 755 $PROGDIR/$x done popd #--------------------------------------------------------------------- # Install "BASENAME.ini" configuration files. pushd $SPCDIR/engine-ini/ for x in `deext *.in` do sed -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \ -e "s|__META_PRODTREE__|$PRODTREE|g" \ -e "s|__META_PROGDIR__|$PROGDIR|g" \ < $x.in \ > $PROGDIR/$x done popd #--------------------------------------------------------------------- # Install "polychess-BASENAME" wrapper scripts. for base in $ENGBASES do sed -e "s|__META_BASENAME__|$base|g" \ -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \ -e "s|__META_PRODTREE__|$PRODTREE|g" \ -e "s|__META_PROGDIR__|$PROGDIR|g" \ < $PKGDIR_SPECIAL/polychess-engine.in \ > $BINDIR/polychess-$base chmod 755 $BINDIR/polychess-$base done #--------------------------------------------------------------------- # Install "BASENAME" wrapper scripts. for base in $ENGBASES do sed -e "s|__META_BASENAME__|$base|g" \ -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \ -e "s|__META_PRODTREE__|$PRODTREE|g" \ -e "s|__META_PROGDIR__|$PROGDIR|g" \ < $PKGDIR_SPECIAL/wrap-aliases.in \ > $BINDIR/$base chmod 755 $BINDIR/$base done #--------------------------------------------------------------------- # Set directory and file permissions. chmod 777 $PROGDIR chmod a+r $PROGDIR/* #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_tarball = special # See "technotes" in "cfg" file #--------------------------------------------------------------------- [history] 210327 Reworked this package after 14 years 211204 Fixed Donna Chess FTBFS related to "go" 1.16 240909 Updated Stockfish from 14.1 to 17