remove unnecessary makefile commands and fix blas on mac

This commit is contained in:
kennyfrc
2020-12-12 23:39:42 +08:00
committed by nodchip
parent 9c65e868f9
commit f4b4430380
2 changed files with 7 additions and 30 deletions
+2 -2
View File
@@ -44,12 +44,12 @@ brew install openblas
2. Go to src then build using the makefile 2. Go to src then build using the makefile
``` ```
cd src cd src
make learn ARCH=x86-64 COMP=gcc make build ARCH=x86-64 COMP=gcc blas=yes
``` ```
or or
``` ```
cd src cd src
make profile-learn ARCH=x86-64 COMP=gcc make profile-build ARCH=x86-64 COMP=gcc blas=yes
``` ```
## Training Guide ## Training Guide
+5 -28
View File
@@ -403,8 +403,8 @@ ifeq ($(COMP),clang)
endif endif
ifeq ($(KERNEL),Darwin) ifeq ($(KERNEL),Darwin)
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.14 CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.15
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.14 LDFLAGS += -arch $(arch) -mmacosx-version-min=10.15
XCRUN = xcrun XCRUN = xcrun
endif endif
@@ -477,6 +477,9 @@ ifeq ($(blas), yes)
ifeq ($(KERNEL),Linux) ifeq ($(KERNEL),Linux)
LDFLAGS += LDFLAGS +=
else ifeq ($(KERNEL), Darwin)
CXXFLAGS += -I/usr/local/opt/openblas/include
LDFLAGS += -L/usr/local/opt/openblas/lib -lcblas
else else
CXXFLAGS += -I/mingw64/include/OpenBLAS CXXFLAGS += -I/mingw64/include/OpenBLAS
@@ -920,32 +923,6 @@ icc-profile-use:
EXTRACXXFLAGS='-prof_use -prof_dir ./profdir' \ EXTRACXXFLAGS='-prof_use -prof_dir ./profdir' \
all all
learn: config-sanity
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
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/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)
@echo ""
@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/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
rm generated_kifu.bin
.depend: .depend:
-@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ -@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@