11#
2- # This makefile is solely designed to compile Igel for OpenBench
3- # Official build method for Igel still requires cmake
2+ # This makefile is used to compile Igel for OpenBench and TCEC
43#
54
6- CC = g++
5+ CC = clang
76EXE = igel
87SRC = *.cpp fathom/tbprobe.cpp
98
@@ -12,7 +11,7 @@ GCCDEFINES = $(shell echo | $(CC) -m64 -march=native -E -dM -)
1211EVALFILE = weights/c049c117
1312NNFLAGS = -DEVALFILE=\"$(EVALFILE ) \"
1413
15- LIBS = -std=c++17 -mpopcnt -pthread
14+ LIBS = -std=c++20 -mpopcnt -pthread -lstdc++ -lm
1615WARN = -Wall
1716OPTIM = -O3 -march=native -flto=auto
1817DEFS = -DNDEBUG -D_BTYPE=0 -DSYZYGY_SUPPORT=TRUE
@@ -32,10 +31,18 @@ endif
3231CFLAGS = $(WARN ) $(LIBS ) $(OPTIM ) $(NNFLAGS )
3332
3433pgo : download-network
34+ ifeq ($(findstring g++, $(CC ) ) , g++)
3535 $(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-generate=pgo -o $(EXE)
36- ./$(EXE ) bench 13 > pgo.out 2>&1
36+ ./$(EXE) bench 14 > pgo.out 2>&1
3737 $(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-use=pgo -o $(EXE)
38- @rm -rf pgo pgo.out weights
38+ @rm -rf pgo pgo.out
39+ else ifeq ($(findstring clang, $(CC)), clang)
40+ $(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-instr-generate -o $(EXE)
41+ ./$(EXE) bench 14 > pgo.out 2>&1
42+ llvm-profdata merge -output=igel.profdata *.profraw
43+ $(CC) $(CFLAGS) $(SRC) $(DEFS) -fprofile-instr-use=igel.profdata -o $(EXE)
44+ @rm -rf pgo pgo.out igel.profdata *.profraw
45+ endif
3946
4047basic :
4148 $(CC ) $(CFLAGS ) $(SRC ) $(DEFS ) -o $(EXE )
0 commit comments