compiling stockfish on android phone and Termux

Discussion of chess software programming and technical issues.

Moderator: Ras

dbuske
Posts: 6
Joined: Fri Jun 23, 2017 3:48 pm
Location: west central wisc. USA
Full name: Dan Buske

compiling stockfish on android phone and Termux

Post by dbuske »

How does one compile Stockfish on an android phone with Termux.
How does one then find the created compile for android on the phone and copy to a directory where it can be used in a gui?
Daniel J. Buske
abulmo2
Posts: 489
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: compiling stockfish on android phone and Termux

Post by abulmo2 »

dbuske wrote: Fri Feb 27, 2026 6:29 am How does one compile Stockfish on an android phone with Termux.
The same way you would do it under any Linux.
You may have to install make, a compiler and a few tools:

Code: Select all

pkg install make
pkg install clang
pkg install wget
etc.
then If you have a not too old phone, type

Code: Select all

make -j profile-build ARCH=armv8-dotprod
If you get

Code: Select all

error unsupported argument 'armv7-a' to option '-march=' 
just remove the line 678 of the Makefile that looks like

Code: Select all

CXXFLAGS += -fno-gcse -mthumb -march=armv7-a -mfloat-abi=softfp
and retry.
Note that the first compilation is slow because it needs to download the nnue file.
How does one then find the created compile for android on the phone and copy to a directory where it can be used in a gui?
https://wiki.termux.com/wiki/Sharing_Data
Richard Delorme