mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 14:27:45 +00:00
Add a makefile option to enable use of BLAS. Default to "no"
This commit is contained in:
+21
-12
@@ -111,6 +111,7 @@ else
|
|||||||
SUPPORTED_ARCH=false
|
SUPPORTED_ARCH=false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
blas = no
|
||||||
optimize = yes
|
optimize = yes
|
||||||
debug = no
|
debug = no
|
||||||
sanitize = no
|
sanitize = no
|
||||||
@@ -132,17 +133,25 @@ ARCH = x86-64-modern
|
|||||||
STRIP = strip
|
STRIP = strip
|
||||||
|
|
||||||
### BLAS libraries
|
### BLAS libraries
|
||||||
ifeq ($(KERNEL),Linux)
|
ifeq ($(blas), yes)
|
||||||
BLASCXXFLAGS =
|
ifeq ($(KERNEL),Linux)
|
||||||
BLASLDFLAGS = -lopenblas
|
BLASCXXFLAGS =
|
||||||
else
|
BLASLDFLAGS = -lopenblas
|
||||||
BLASCXXFLAGS = -I/mingw64/include/OpenBLAS
|
|
||||||
|
|
||||||
ifeq ($(debug),yes)
|
|
||||||
BLASLDFLAGS = -lopenblas -Wl,-static
|
|
||||||
else
|
else
|
||||||
BLASLDFLAGS = -lopenblas -Wl,-s -static
|
BLASCXXFLAGS = -I/mingw64/include/OpenBLAS
|
||||||
|
|
||||||
|
ifeq ($(debug),yes)
|
||||||
|
BLASLDFLAGS = -lopenblas -Wl,-static
|
||||||
|
else
|
||||||
|
BLASLDFLAGS = -lopenblas -Wl,-s -static
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
BLASDEFINE = -DUSE_BLAS
|
||||||
|
else
|
||||||
|
BLASCXXFLAGS =
|
||||||
|
BLASLDFLAGS =
|
||||||
|
BLASDEFINE =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### 2.2 Architecture specific
|
### 2.2 Architecture specific
|
||||||
@@ -736,7 +745,7 @@ endif
|
|||||||
|
|
||||||
build: config-sanity
|
build: config-sanity
|
||||||
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
|
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
|
||||||
EXTRACXXFLAGS=' -DUSE_BLAS $(BLASCXXFLAGS) -fopenmp ' \
|
EXTRACXXFLAGS=' $(BLASDEFINE) $(BLASCXXFLAGS) -fopenmp ' \
|
||||||
EXTRALDFLAGS=' $(BLASLDFLAGS) -fopenmp ' \
|
EXTRALDFLAGS=' $(BLASLDFLAGS) -fopenmp ' \
|
||||||
all
|
all
|
||||||
|
|
||||||
@@ -744,7 +753,7 @@ profile-build: net config-sanity objclean profileclean
|
|||||||
@echo ""
|
@echo ""
|
||||||
@echo "Step 1/4. Building instrumented executable ..."
|
@echo "Step 1/4. Building instrumented executable ..."
|
||||||
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make) \
|
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make) \
|
||||||
LEARNCXXFLAGS=' -DUSE_BLAS $(BLASCXXFLAGS) -fopenmp ' \
|
LEARNCXXFLAGS=' $(BLASDEFINE) $(BLASCXXFLAGS) -fopenmp ' \
|
||||||
LEARNLDFLAGS=' $(BLASLDFLAGS) -fopenmp '
|
LEARNLDFLAGS=' $(BLASLDFLAGS) -fopenmp '
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Step 2/4. Running benchmark for pgo-build ..."
|
@echo "Step 2/4. Running benchmark for pgo-build ..."
|
||||||
@@ -754,7 +763,7 @@ profile-build: net config-sanity objclean profileclean
|
|||||||
@echo "Step 3/4. Building optimized executable ..."
|
@echo "Step 3/4. Building optimized executable ..."
|
||||||
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) objclean
|
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) objclean
|
||||||
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use) \
|
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use) \
|
||||||
LEARNCXXFLAGS=' -DUSE_BLAS $(BLASCXXFLAGS) -fopenmp ' \
|
LEARNCXXFLAGS=' $(BLASDEFINE) $(BLASCXXFLAGS) -fopenmp ' \
|
||||||
LEARNLDFLAGS=' $(BLASLDFLAGS) -fopenmp '
|
LEARNLDFLAGS=' $(BLASLDFLAGS) -fopenmp '
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Step 4/4. Deleting profile data ..."
|
@echo "Step 4/4. Deleting profile data ..."
|
||||||
|
|||||||
Reference in New Issue
Block a user