mac specific makefile with compilation instructions

This commit is contained in:
kennyfrc
2020-12-08 22:14:18 +08:00
parent bc90567e09
commit bb26ce5aa1
2 changed files with 24 additions and 6 deletions

View File

@@ -7,6 +7,24 @@
## Overview
Stockfish NNUE is a port of a shogi neural network named NNUE (efficiently updateable neural network backwards) to Stockfish 11. To learn more about the Stockfish chess engine, look [here](stockfish.md) for an overview and [here](https://github.com/official-stockfish/Stockfish) for the official repository.
## Compilation Instructions for Mac
1. Ensure that you have OpenBlas Installed
```
brew install openblas
```
2. Go to src then build using the makefile
```
cd src
make learn ARCH=x86-64 COMP=gcc
```
or
```
cd src
make profile-learn ARCH=x86-64 COMP=gcc
```
## Training Guide
### Generating Training Data
To generate training data from the classic eval, use the gensfen command with the setting "Use NNUE" set to "false". The given example is generation in its simplest form. There are more commands.

View File

@@ -888,16 +888,16 @@ icc-profile-use:
learn: config-sanity
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
EXTRACXXFLAGS=' -DEVAL_LEARN -DEVAL_NNUE -DENABLE_TEST_CMD -DUSE_BLAS -I/mingw64/include/OpenBLAS -fopenmp ' \
EXTRALDFLAGS=' -lopenblas -fopenmp -Wl,-s ' \
EXTRACXXFLAGS=' -DEVAL_LEARN -DEVAL_NNUE -DENABLE_TEST_CMD -DUSE_BLAS -I/usr/local/opt/openblas/include' \
EXTRALDFLAGS=' -L/usr/local/opt/openblas/lib -Wl,-s -lcblas' \
all
profile-learn: config-sanity objclean profileclean
@echo ""
@echo "Step 1/4. Building instrumented executable ..."
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make) \
LEARNCXXFLAGS=' -DEVAL_LEARN -DEVAL_NNUE -DENABLE_TEST_CMD -DUSE_BLAS -I/mingw64/include/OpenBLAS -fopenmp ' \
LEARNLDFLAGS=' -lopenblas -fopenmp -Wl,-s '
LEARNCXXFLAGS=' -DEVAL_LEARN -DEVAL_NNUE -DENABLE_TEST_CMD -DUSE_BLAS -I/usr/local/opt/openblas/include' \
LEARNLDFLAGS=' -L/usr/local/opt/openblas/lib -Wl,-s -lcblas'
@echo ""
@echo "Step 2/4. Running benchmark for pgo-build ..."
$(PGOGENSFEN)
@@ -905,8 +905,8 @@ profile-learn: config-sanity objclean profileclean
@echo "Step 3/4. Building optimized executable ..."
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) objclean
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use) \
LEARNCXXFLAGS=' -DEVAL_LEARN -DEVAL_NNUE -DENABLE_TEST_CMD -DUSE_BLAS -I/mingw64/include/OpenBLAS -fopenmp ' \
LEARNLDFLAGS=' -lopenblas -fopenmp -Wl,-s '
LEARNCXXFLAGS=' -DEVAL_LEARN -DEVAL_NNUE -DENABLE_TEST_CMD -DUSE_BLAS -I/usr/local/opt/openblas/include' \
LEARNLDFLAGS=' -L/usr/local/opt/openblas/lib -Wl,-s -lcblas'
@echo ""
@echo "Step 4/4. Deleting profile data ..."
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) profileclean