Skip to content

Commit ed96a1c

Browse files
committed
Merge branch 'HandcraftedEngine' of https://github.com/winapiadmin/cppchess_engine into tuning_exp1
2 parents d0915d3 + 0ee5318 commit ed96a1c

2 files changed

Lines changed: 29 additions & 61 deletions

File tree

‎.github/workflows/openbench.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: OpenBench Worker
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
worker:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout OpenBench client
12+
uses: actions/checkout@v4
13+
with:
14+
repository: andygrant/OpenBench
15+
16+
- name: Install dependencies
17+
run: |
18+
sudo apt update
19+
sudo apt install -y python3 python3-pip make g++
20+
# gh: ignore leak data reason: locally hosted server
21+
- name: Run worker
22+
env:
23+
OPENBENCH_URL: ${{ secrets.OPENBENCH_URL }}
24+
run: |
25+
python Client/Client.py --server ${OPENBENCH_URL} --username=user0 --password=winapiadmin

‎Makefile‎

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,6 @@
1-
# :( openbench and fishtest require make
21
EXE = engine
3-
CXX ?= g++
4-
CXXFLAGS ?= -std=c++17 -Wall -Wextra
5-
OPTFLAGS ?= -O3
6-
ifeq ($(LTO), yes)
7-
OPTFLAGS += -flto
8-
ifeq ($(findstring clang++,$(CXX)),clang++)
9-
LDFLAGS += -fuse-ld=lld
10-
endif
11-
endif
12-
ifeq ($(debug),no)
13-
CXXFLAGS += -DNDEBUG
14-
endif
15-
ARCH ?= native
162

17-
ifeq ($(ARCH), native)
18-
CXXFLAGS += -march=native -mtune=native
19-
endif
20-
ifeq ($(ARCH), avx2)
21-
CXXFLAGS += -march=haswell -mavx2 -mbmi -mbmi2 -msse4.1
22-
endif
23-
ifeq ($(ARCH), bmi2)
24-
CXXFLAGS += -mbmi2
25-
endif
26-
ifeq ($(ARCH), sse41)
27-
CXXFLAGS += -msse4.1
28-
endif
29-
ifeq ($(ARCH), x86-64)
30-
CXXFLAGS += -march=x86-64
31-
endif
32-
deps:
33-
test -d deps/chesslib || git clone https://github.com/winapiadmin/chesslib deps/chesslib
34-
test -d deps/tbprobe || git clone https://github.com/winapiadmin/tb_probing_tool deps/tbprobe
35-
all: deps
36-
@$(MAKE) --no-print-directory $(EXE)
37-
# Tuning is not required on Makefile, use CMake.
38-
SRCS := \
39-
$(filter-out tune_cmd.cpp,$(wildcard *.cpp)) \
40-
$(filter-out %tests.cpp,$(wildcard deps/chesslib/*.cpp)) \
41-
deps/tbprobe/syzygy/tbprobe.cpp
42-
OBJS = $(SRCS:.cpp=.o)
43-
SHA := $(shell git rev-parse --short HEAD 2>/dev/null)
44-
TAG := $(shell git describe --tags --exact-match 2>/dev/null)
45-
ifeq ($(debug),yes)
46-
BUILD_VERSION := debug-$(SHA)
47-
else ifneq ($(TAG),)
48-
BUILD_VERSION := $(TAG)
49-
else
50-
BUILD_VERSION := release-$(SHA)
51-
endif
52-
53-
CXXFLAGS += -DBUILD_VERSION=\"$(BUILD_VERSION)\"
54-
.PHONY: all clean deps
55-
56-
$(EXE): $(OBJS)
57-
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -o $(EXE) $(OBJS)
58-
59-
%.o: %.cpp
60-
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -Ideps/chesslib -Ideps/tbprobe/syzygy -c $< -o $@
61-
62-
clean:
63-
rm -f $(OBJS) $(EXE)
3+
all:
4+
cmake -B build -DCMAKE_BUILD_TYPE=Release
5+
cmake --build build
6+
cp build/engine $(EXE)

0 commit comments

Comments
 (0)