Skip to content

Commit a441245

Browse files
authored
fix openbench compilation issues (#302)
bench: 1217611
1 parent c2c6bf9 commit a441245

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Igel Linux Build PGO
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
workflow_dispatch: # Allow manual triggering of the workflow
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
matrix:
18+
os: [ ubuntu-latest ]
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Install GCC versions
25+
run: |
26+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
27+
sudo apt-get update
28+
sudo apt-get install -y gcc-12 g++-12 gcc-13 g++-13
29+
30+
- name: Set GCC version
31+
run: |
32+
# Set GCC 14 as the default version
33+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 60
34+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 60
35+
36+
- name: Run make pgo
37+
run: cd src&&make pgo
38+
39+
- name: Run the bench
40+
run: cd src&&./igel bench

src/makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This makefile is used to compile Igel for OpenBench and TCEC
33
#
44

5-
CC = clang
5+
CC = g++
66
EXE = igel
77
SRC = *.cpp fathom/tbprobe.cpp
88

@@ -11,7 +11,7 @@ GCCDEFINES = $(shell echo | $(CC) -m64 -march=native -E -dM -)
1111
EVALFILE = weights/c049c117
1212
NNFLAGS = -DEVALFILE=\"$(EVALFILE)\"
1313

14-
LIBS = -std=c++20 -mpopcnt -pthread -lstdc++ -lm
14+
LIBS = -std=c++17 -mpopcnt -pthread -lstdc++ -lm
1515
WARN = -Wall
1616
OPTIM = -O3 -march=native -flto=auto
1717
DEFS = -DNDEBUG -D_BTYPE=0 -DSYZYGY_SUPPORT=TRUE
@@ -30,23 +30,23 @@ endif
3030

3131
CFLAGS = $(WARN) $(LIBS) $(OPTIM) $(NNFLAGS)
3232

33+
basic:
34+
$(CC) $(CFLAGS) $(SRC) $(DEFS) -o $(EXE)
35+
3336
pgo: download-network
3437
ifeq ($(findstring g++, $(CC)), g++)
3538
$(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-generate=pgo -o $(EXE)
36-
./$(EXE) bench 14 > pgo.out 2>&1
39+
./$(EXE) bench 15 > pgo.out 2>&1
3740
$(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-use=pgo -o $(EXE)
3841
@rm -rf pgo pgo.out
3942
else ifeq ($(findstring clang, $(CC)), clang)
4043
$(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-instr-generate -o $(EXE)
41-
./$(EXE) bench 14 > pgo.out 2>&1
44+
./$(EXE) bench 15 > pgo.out 2>&1
4245
llvm-profdata merge -output=igel.profdata *.profraw
4346
$(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-instr-use=igel.profdata -o $(EXE)
4447
@rm -rf pgo pgo.out igel.profdata *.profraw
4548
endif
4649

47-
basic:
48-
$(CC) $(CFLAGS) $(SRC) $(DEFS) -o $(EXE)
49-
5050
download-network:
5151
mkdir weights; \
5252
echo "Downloading latest Igel network with wget"; wget -P weights https://github.com/vshcherbyna/igel/releases/download/3.5.0/c049c117;

0 commit comments

Comments
 (0)