Merge pull request #35 from rektdie/compiler_optimizations
enabled some optimizations | bench 684523 Elo | 197.40 +- 27.61 (95%) SPRT | 8.0+0.08s Threads=1 Hash=8MB LLR | 3.03 (-2.94, 2.94) [0.00, 5.00] Games | N: 428 W: 246 L: 26 D: 156 Penta | [2, 5, 45, 95, 67]
This commit was merged in pull request #35.
This commit is contained in:
1 file changed
+6
-2
@@ -14,11 +14,15 @@ ifeq ($(OS),Windows_NT)
|
||||
MKDIR := mkdir
|
||||
RM := rmdir /s /q
|
||||
DEL := del /q
|
||||
# Use all cores on Windows by getting the number of cores using wmic
|
||||
MAKEFLAGS += -j$(shell wmic cpu get NumberOfLogicalProcessors | findstr /r /v "^$" | tail -n 1)
|
||||
else
|
||||
EXE_EXT :=
|
||||
MKDIR := mkdir -p
|
||||
RM := rm -rf
|
||||
DEL := rm -f
|
||||
# Use all cores on Linux by getting the number of cores using nproc
|
||||
MAKEFLAGS += -j$(shell nproc)
|
||||
endif
|
||||
|
||||
# List of source files
|
||||
@@ -29,11 +33,11 @@ OBJS := $(addprefix $(OBJ_DIR)/, $(notdir $(SRCS:.cpp=.o)))
|
||||
|
||||
# Target executable
|
||||
$(EXE)$(EXE_EXT): $(OBJS)
|
||||
$(CXX) -std=c++23 -o $@ $^ -O3 -lpthread
|
||||
$(CXX) -std=c++23 -o $@ $^ -O3 -lpthread -march=native -flto -ftree-vectorize
|
||||
|
||||
# Rule to compile source files to object files
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(OBJ_DIR)
|
||||
$(CXX) -std=c++23 -c -o $@ $< -O3 -lpthread
|
||||
$(CXX) -std=c++23 -c -o $@ $< -O3 -lpthread -march=native -flto -ftree-vectorize
|
||||
|
||||
# Create the object directory if it doesn't exist
|
||||
$(OBJ_DIR):
|
||||
|
||||
Reference in new issue
Block a user