To compile stockfish, type:
make target ARCH=arch [COMP=compiler] [COMPCXX=cxx]
Supported targets:
help > Display architecture details
build > Standard build
net > Download the default nnue net
profile-build > Faster build (with profile-guided optimization)
strip > Strip executable
install > Install executable
clean > Clean up
Supported archs:
x86-64-vnni512 > x86 64-bit with vnni support 512bit wide
x86-64-vnni256 > x86 64-bit with vnni support 256bit wide
x86-64-avx512 > x86 64-bit with avx512 support
x86-64-bmi2 > x86 64-bit with bmi2 support
x86-64-avx2 > x86 64-bit with avx2 support
x86-64-sse41-popcnt > x86 64-bit with sse41 and popcnt support
x86-64-modern > common modern CPU, currently x86-64-sse41-popcnt
x86-64-ssse3 > x86 64-bit with ssse3 support
x86-64-sse3-popcnt > x86 64-bit with sse3 and popcnt support
x86-64 > x86 64-bit generic (with sse2 support)
x86-32-sse41-popcnt > x86 32-bit with sse41 and popcnt support
x86-32-sse2 > x86 32-bit with sse2 support
x86-32 > x86 32-bit generic (with mmx and sse support)
ppc-64 > PPC 64-bit
ppc-32 > PPC 32-bit
armv7 > ARMv7 32-bit
armv7-neon > ARMv7 32-bit with popcnt and neon
armv8 > ARMv8 64-bit with popcnt and neon
e2k > Elbrus 2000
apple-silicon > Apple silicon ARM64
general-64 > unspecified 64-bit
general-32 > unspecified 32-bit
Supported compilers:
gcc > Gnu compiler (default)
mingw > Gnu compiler with MinGW under Windows
clang > LLVM Clang compiler
icc > Intel compiler
ndk > Google NDK to cross-compile for Android
Simple examples. If you don't know what to do, you likely want to run:
make -j build ARCH=x86-64 (A portable, slow compile for 64-bit systems)
make -j build ARCH=x86-32 (A portable, slow compile for 32-bit systems)
Advanced examples, for experienced users looking for performance:
make help ARCH=x86-64-bmi2
make -j profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-9.0
make -j build ARCH=x86-64-ssse3 COMP=clang
-------------------------------
Specify a supported architecture with the ARCH option for more details
-------------------------------
Embed and enable NNUE by default:
make build ARCH=x86-64 nnue=yes
-------------------------------
Version for large boards:
make build ARCH=x86-64 COMP=gcc largeboards=yes
Include all variants (adds Game of the Amazons):
make build ARCH=x86-64 largeboards=yes all=yes