Created
February 11, 2019 05:26
-
-
Save numberoverzero/1200cdfc457b04a0f607bccdd16018b8 to your computer and use it in GitHub Desktop.
compile stockfish from github on RHEL into /opt/stockfish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# assumes bmi2 arch: "x86 64-bit with pext support" | |
# compiled binary ends in /opt/stockfish/$MAJOR_VERSION/bin/stockfish | |
set -e | |
set -x | |
sudo yum update -y | |
sudo yum install -y git gcc gcc-c++ | |
SF_GH="https://github.com/official-stockfish/Stockfish.git" | |
SF_DIR="/opt/stockfish" | |
TMP=$(mktemp -d) | |
pushd "$TMP" | |
git clone "$SF_GH" . | |
pushd src | |
make clean | |
make build ARCH=x86-64-bmi2 COMP=gcc | |
chmod +x stockfish | |
STOCKFISH_MV=$(echo "uci" | ./stockfish | head -n 1 | cut -d' ' -f2 | cut -c1-2) | |
STOCKFISH_BIN="$SF_DIR/$STOCKFISH_MV/bin" | |
sudo mkdir -p "$STOCKFISH_BIN" | |
sudo chown -R $USER:$USER "$STOCKFISH_BIN" | |
cp stockfish "$STOCKFISH_BIN" | |
popd | |
rm -rf "$TMP" | |
set +x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment