Chess2u
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Chess2uLog in

descriptionChess Engine Compiler Script for Android EmptyChess Engine Compiler Script for Android

more_horiz
Superbatil wrote:

CECSA                                           Chess Engine Compiler Script for Android
Version 2022.02.17

Compile Stockfish for Android? y                With embedded network? y

fatal: destination path 'Stockfish' already exists and is not an empty directory.
                                               Default net: nn-6877cd24400e.nnue
Already available.
                                               Config:
debug: 'no'
sanitize: 'none'
optimize: 'yes'
arch: 'armv8'
bits: '64'
kernel: 'Linux'
os: 'Android'
prefetch: 'yes'
popcnt: 'yes'
pext: 'no'
sse: 'no'
mmx: 'no'
sse2: 'no'
ssse3: 'no'
sse41: 'no'
avx2: 'no'
avxvnni: 'no'
avx512: 'no'
vnni256: 'no'
vnni512: 'no'
neon: 'yes'
arm_version: '8'

Flags:
CXX: clang++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE
LDFLAGS:  -latomic -m64 -static-libstdc++ -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE -fPIE -pie

Testing config sanity. If this fails, try 'make help' ...


Step 1/4. Building instrumented executable ...
make ARCH=armv8 COMP=clang clang-profile-make
make[1]: Entering directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'
make ARCH=armv8 COMP=clang \
EXTRACXXFLAGS='-fprofile-instr-generate ' \
EXTRALDFLAGS=' -fprofile-instr-generate' \
all
make[2]: Entering directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o benchmark.o benchmark.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o bitbase.o bitbase.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o bitboard.o bitboard.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o endgame.o endgame.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o evaluate.o evaluate.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o main.o main.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o material.o material.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o misc.o misc.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o movegen.o movegen.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o movepick.o movepick.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o pawns.o pawns.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o position.o position.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o psqt.o psqt.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o search.o search.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o thread.o thread.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o timeman.o timeman.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o tt.o tt.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o uci.o uci.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o ucioption.o ucioption.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o tune.o tune.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o tbprobe.o syzygy/tbprobe.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o evaluate_nnue.o nnue/evaluate_nnue.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE   -c -o half_ka_v2_hm.o nnue/features/half_ka_v2_hm.cpp
clang++ -o stockfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o tune.o tbprobe.o evaluate_nnue.o half_ka_v2_hm.o -fprofile-instr-generate -latomic -m64 -static-libstdc++ -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -flto -fPIE -fPIE -pie
make[2]: Leaving directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'
make[1]: Leaving directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'

Step 2/4. Running benchmark for pgo-build ...
./stockfish bench 2>&1 | tail -n 4
/data/data/com.termux/files/usr/bin/sh: 1: ./stockfish: Permission denied

Step 3/4. Building optimized executable ...
make ARCH=armv8 COMP=clang objclean
make[1]: Entering directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'
make[1]: Leaving directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'
make ARCH=armv8 COMP=clang clang-profile-use
make[1]: Entering directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'
llvm-profdata merge -output=stockfish.profdata *.profraw
error: *.profraw: No such file or directory
make[1]: *** [Makefile clang-profile-use] Error 1
make[1]: Leaving directory '/storage/emulated/0/Download/cecsa/src/Stockfish/src'
make: *** [Makefile profile-build] Error 2
strip: './stockfish': No such file
mv: cannot stat './stockfish': No such file or directory

sed: preserving permissions for ‘./sedmEwNYj’: Operation not permitted
sed: preserving permissions for ‘./sedhUVsdm’: Operation not permitted
Default net: nn-6877cd24400e.nnue
Already available.
Failed download or nn-6877cd24400e.nnue corrupted, please delete!
make: *** [Makefile net] Error 1

../etc/stockfish/cecsa.sh: line 97: ndk-build: command not found

../etc/stockfish/cecsa.sh: line 117: zip: command not found
mv: cannot stat './archive.zip': No such file or directory

Stockfish for Android copied to /storage/emulated/0/Download/cecsa/.

If you are not on Outskirts (there is already a thread of this topic) we can discuss it here.

CECSA 2022.02.17:
https://app.box.com/s/11ljb29ywal4ohbq3a0pbs452lwbbzgz

You have extracted the archive in your home directory of Termux with the following command?

Code:

tar -xf ./cecsa_2022.02.17.tar.gz

You have a permission problem. The script first delete the directory of Stockfish (src/Stockfish) before starting anything, but this doesn't work for you. Delete the directory (src/Stockfish) by hand before you start the compilation.

Don't know, what version of Termux you have. I'm using the version from F-Droid. May be your version of Termux is using another user name. Look, what is your user name on Termux and take sure you have full write access to the src directory.

descriptionChess Engine Compiler Script for Android EmptyRe: Chess Engine Compiler Script for Android

more_horiz
For those, who are insterested, what the script can do, a short explanation can be found here:

http://talkchess.com/forum3/viewtopic.php?f=2&t=78455

Most useful, when you have installed all supported compilers (gcc, clang and ndk).

Compiling Stockfish for Android is easy now, you only have to enter the following commands, when starting Termux.

Code:

cd cecsa
./start.sh


or

Code:

cd cecsa
./start.sh stockfish 220225

If you want to define your own version number.

descriptionChess Engine Compiler Script for Android EmptyRe: Chess Engine Compiler Script for Android

more_horiz
Archimedes wrote:
For those, who are insterested, what the script can do, a short explanation can be found here:

http://talkchess.com/forum3/viewtopic.php?f=2&t=78455

Most useful, when you have installed all supported compilers (gcc, clang and ndk).

Compiling Stockfish for Android is easy now, you only have to enter the following commands, when starting Termux.

Code:

cd cecsa
./start.sh


or

Code:

cd cecsa
./start.sh stockfish 220225

If you want to define your own version number.


Now it compiles stockfish after changing this line

start.sh

CECSA_HOME=/storage/emulated/0/Download/cecsa/


Application.mk

(Before)
APP_ABI := arm64-v8a
APP_PLATFORM := android-21
APP_STL := c++_static

(After)
APP_ABI := arm64-v8a
APP_PLATFORM := android-23
APP_STL := c++_static

descriptionChess Engine Compiler Script for Android EmptyRe: Chess Engine Compiler Script for Android

more_horiz
You have extracted CECSA to the download directory (outside of Termux). This is not intended and doesn't work. CECSA should be located in the home directory of Termux. Otherwise you will be confronted with permission problems.

descriptionChess Engine Compiler Script for Android EmptyRe: Chess Engine Compiler Script for Android

more_horiz
Archimedes wrote:
You have extracted CECSA to the download directory (outside of Termux). This is not intended and doesn't work. CECSA should be located in the home directory of Termux. Otherwise you will be confronted with permission problems.


I have run Cecsa in my sdcard with this command.....

bash start.sh stockfish

descriptionChess Engine Compiler Script for Android EmptyRe: Chess Engine Compiler Script for Android

more_horiz
Again, CECSA should be installed inside of Termux (home directory). Extracting with tar -xf preserves the necessary folder rights.

descriptionChess Engine Compiler Script for Android EmptyRe: Chess Engine Compiler Script for Android

more_horiz
Archimedes wrote:
Again, CECSA should be installed inside of Termux (home directory). Extracting with tar -xf preserves the necessary folder rights.


Thanks for the advice.

descriptionChess Engine Compiler Script for Android EmptyRe: Chess Engine Compiler Script for Android

more_horiz
Permissions in this forum:
You cannot reply to topics in this forum