1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 09:13:08 +00:00

A new make target to download the default net

```
make net
```

will download the default net as specified in ucioption.cpp file.

This target assumes that `curl` or `wget` is available (in addition to grep and sed).

Needs some testing on different systems (windows, mac, etc.) to see if the implementation is portable enough.

Note that this is not part executed as part of a `make build` to make sure that a build doesn't need a network connection.
This commit is contained in:
Joost VandeVondele 2020-08-03 14:07:53 +02:00
parent dbbb3fa477
commit 2c51afdb14

View file

@ -544,6 +544,7 @@ help:
@echo "strip > Strip executable"
@echo "install > Install executable"
@echo "clean > Clean up"
@echo "net > Download the default nnue net"
@echo ""
@echo "Supported archs:"
@echo ""
@ -586,7 +587,7 @@ help:
@echo ""
.PHONY: help build profile-build strip install clean objclean profileclean \
.PHONY: help build profile-build strip install clean net objclean profileclean \
config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
clang-profile-use clang-profile-make
@ -620,6 +621,13 @@ install:
clean: objclean profileclean
@rm -f .depend *~ core
net:
$(eval nnuenet := $(shell grep EvalFile ucioption.cpp | grep Option | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/'))
@echo "Default net: $(nnuenet)"
$(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet))
$(eval curl_or_wget := $(shell if hash curl 2>/dev/null; then echo "curl -sL"; elif hash wget 2>/dev/null; then echo "wget -qO-"; fi))
@if test -f "$(nnuenet)"; then echo "Already available."; else echo "Downloading $(nnuedownloadurl)"; $(curl_or_wget) $(nnuedownloadurl) > $(nnuenet); fi
# clean binaries and objects
objclean:
@rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o