Skip to content

Commit

Permalink
Weiss 1.1 (#329)
Browse files Browse the repository at this point in the history
Update version to 1.1 + cleanup makefile.
  • Loading branch information
TerjeKir authored Sep 2, 2020
1 parent f59c14d commit 5c3bd88
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: test
run: cd src && make bench-pgo
run: cd src && make pgo
- name: release
run: cd src && make release
Empty file removed bin/.gitkeep
Empty file.
54 changes: 20 additions & 34 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
# General
EXE = weiss
SRC = *.c pyrrhic/tbprobe.c noobprobe/noobprobe.c tuner/tuner.c
OUT = ../bin/
COMP = gcc

# Defines
DEV = -DDEV
POPCNT = -msse3 -mpopcnt
PEXT = $(POPCNT) -DUSE_PEXT -mbmi2

Expand All @@ -32,57 +30,45 @@ STD = -std=gnu11
LIBS = -pthread -lm
WARN = -Wall -Wextra -Wshadow

CFLAGS = $(STD) $(WARN) -O3 -flto -march=native
RFLAGS = $(STD) $(WARN) -O3 -flto -static
PFLAGS = $(STD) $(WARN) -O0 -march=native -pg -p
FLAGS = $(STD) $(WARN) -O3 -flto
CFLAGS = $(FLAGS) -march=native
RFLAGS = $(FLAGS) -static

# PGO
PGODIR = "../pgo"
PGOGEN = -fprofile-generate=$(PGODIR)
PGOUSE = -fprofile-use=$(PGODIR)

# Link winsock32 on windows
ifeq ($(OS), Windows_NT)
LIBS += -lwsock32
endif

# Try to detect windows environment by seeing
# whether the shell filters out the "s or not.
ifeq ($(shell echo "check_quotes"), "check_quotes")
# whether the shell filters out " or not.
ifeq ($(shell echo "test"), "test")
RUNBENCH = $(EXE) bench 12 > nul 2>&1
CLEAN = rmdir /s /q $(PGODIR)
else
RUNBENCH = ./$(EXE) bench 12 > /dev/null 2>&1
CLEAN = $(RM) -rf $(PGODIR)
endif

# Compilations
BASE = $(COMP) $(CFLAGS) $(SRC) $(LIBS)
RELEASE = $(COMP) $(RFLAGS) $(SRC) $(LIBS) -o $(OUT)$(EXE)
BENCH = $(BASE) -o $(EXE)
BIN = $(BASE) -o $(OUT)$(EXE)

# For OpenBench
bench-basic:
$(BENCH)
# Link winsock32 on windows for NoobBook
ifeq ($(OS), Windows_NT)
LIBS += -lwsock32
endif

bench-pext:
$(BENCH) $(PEXT)
# Compilations
BASIC = $(COMP) $(CFLAGS) $(SRC) $(LIBS) -o $(EXE)
RELEASE = $(COMP) $(RFLAGS) $(SRC) $(LIBS) -o $(EXE)

bench-pgo:
$(BENCH) $(PEXT) $(PGOGEN)
$(RUNBENCH)
$(BENCH) $(PEXT) $(PGOUSE)
$(CLEAN)
# Targets
basic:
$(BASIC)

# For normal use
pext:
$(BIN)-pext $(PEXT)
$(BASIC) $(PEXT)

pgo:
$(BENCH) $(PEXT) $(PGOGEN)
$(BASIC) $(PEXT) $(PGOGEN)
$(RUNBENCH)
$(BIN)-pext-pgo.exe $(PEXT) $(PGOUSE)
$(BASIC) $(PEXT) $(PGOUSE)
$(CLEAN)

release:
Expand All @@ -91,7 +77,7 @@ release:
$(RELEASE)-pext.exe $(PEXT)

dev:
$(BENCH)-dev $(PEXT) $(DEV)
$(BASIC)-dev $(PEXT) -DDEV

tune:
$(BENCH) $(PEXT) -DTUNE -fopenmp
$(BASIC) $(PEXT) -DTUNE -fopenmp
2 changes: 1 addition & 1 deletion src/uci.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <string.h>


#define NAME "Weiss 1.0"
#define NAME "Weiss 1.1"

#define START_FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
#define INPUT_SIZE 4096
Expand Down

0 comments on commit 5c3bd88

Please sign in to comment.