Skip to content

Commit

Permalink
Further simplify the makefile, add partial clang compilation support (#…
Browse files Browse the repository at this point in the history
…317)

Bench: 6097414
  • Loading branch information
PGG106 authored Jan 19, 2024
1 parent 77c6ca1 commit 777d66c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ EVALFILE = $(NETWORK_NAME)
CXX := g++
TARGET := Alexandria
WARNINGS = -Wall -Wcast-qual -Wextra -Wshadow -Wdouble-promotion -Wformat=2 -Wnull-dereference -Wlogical-op -Wold-style-cast -Wundef -pedantic
CXXFLAGS := -funroll-loops -O3 -flto -fno-exceptions -std=gnu++2a -DNDEBUG $(WARNINGS)
CXXFLAGS := -funroll-loops -O3 -flto -fno-exceptions -std=gnu++2a -DNDEBUG $(WARNINGS)
NATIVE = -march=native


Expand All @@ -15,6 +15,11 @@ NAME := Alexandria

TMPDIR = .tmp

# Detect Clang
ifeq ($(CXX), clang++)
CXXFLAGS = -funroll-loops -O3 -flto -fuse-ld=lld -fno-exceptions -std=gnu++2a -DNDEBUG
endif

# Detect Windows
ifeq ($(OS), Windows_NT)
MKDIR := mkdir
Expand All @@ -31,8 +36,7 @@ endif
ifeq ($(OS), Windows_NT)
uname_S := Windows
SUFFIX := .exe
FLAGS = -lstdc++
CXXFLAGS += -static -static-libgcc -static-libstdc++
CXXFLAGS += -static
else
FLAGS = -pthread
SUFFIX :=
Expand Down
4 changes: 2 additions & 2 deletions src/nnue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#include <cstdio>
#include <cstring>
#include <iostream>
#include "incbin/incbin.h"

// Macro to embed the default efficiently updatable neural network (NNUE) file
// data in the engine binary (using incbin.h, by Dale Weiler).
// This macro invocation will declare the following three variables
// const unsigned char gEVALData[]; // a pointer to the embedded data
// const unsigned char *const gEVALEnd; // a marker to the end
// const unsigned int gEVALSize; // the size of the embedded file
// Note that this does not work in Microsoft Visual Studio.
#define INCBIN_STYLE INCBIN_STYLE_CAMEL
#include "incbin/incbin.h"
#if !defined(_MSC_VER)
INCBIN(EVAL, EVALFILE);
#else
Expand Down

0 comments on commit 777d66c

Please sign in to comment.