If you have already installed a working environment of
gcc on Termux and want to compile Stockfish (and may be other chess engines too) from time to time, then, may be, this script makes your life easier.
Download CECSA (Chess Engine Compiler Script for Android), start Termux and copy the tar archive from the download directory of your smarthphone to the home directory of Termux (change the command line for your needs).
Code: Select all
cp /storage/emulated/0/Download/cecsa_2021.10.18.tar.gz ./
Extract the tar archive.
Now you have a directory cecsa in your home directory. Go to the cecsa directory and start the script.
What does the script do? When you start the script without any parameter, it download the sources from Stockfish (via "git clone"), copy a working makefile (etc/Stockfish/Makefile) to the source directory of Stockfish and start the compiliation process. When finished, the executable will be copied to the CECSA_HOME directory (/storage/emulated/0/Download). The CECSA_HOME directory can be defined as an environment variable at the bottom of the script. With the CECSA_COMPILER environment variable can you define your preferred compiler (clang or gcc).
At the moment, the script supports the following parameters:
Code: Select all
./start.sh
./start.sh all
./start.sh corchess
./start.sh crystal
./start.sh stockfish
As you can see, currently CorChess, Crystal and Stockfish are supported, but can be extended to other chess engines too, for sure. With the parameter "all" all supported chess engines will be compiled (this is mainly for testing purposes). The changed makefiles (necessary for proper compiling) are in the etc directory. Changes to the makefiles were only made, when it was absolute necessary for proper compiling. May be, it is a better idea, to create new makefiles for the CECSA script, may be only for arm64-v8a based CPUs, so people can better see, what optimization settings are used and what can be optimized for better performance.
There is only one downside at the moment. Compilation with gcc seems not to be very stable. Sometimes, during the compilation process, gcc crashes and with it, Termux too. However, the clang compiler works without any issues.
CECSA 2021.10.18:
https://app.box.com/s/uajbge2qhp3zj3oglitnww8of0r8sz5t