Spaces:
Running on Zero
Running on Zero
File size: 1,907 Bytes
2cf2375 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | # ==============================================================================
# BESTEMSHE HPC ENGINE - AUTO-DETECTING MAKEFILE (HOMEBREW GCC)
# ==============================================================================
# Detect Operating System
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
# --------------------------------------------------------------------------
# macOS with Homebrew GCC (Adjust 'g++-16' if your installed version differs)
# --------------------------------------------------------------------------
CXX = g++-16
CXXFLAGS = -std=c++17 -O3 -flto -Wall -Wextra -DNDEBUG -fopenmp -I/opt/homebrew/include
LDFLAGS = -L/opt/homebrew/lib -lzstd -flto -fopenmp
else
# --------------------------------------------------------------------------
# Linux (Tomorrow School / Alem.ai Cluster Nodes - standard GCC)
# --------------------------------------------------------------------------
CXX = g++
CXXFLAGS = -std=c++17 -O3 -march=native -flto -Wall -Wextra -DNDEBUG -fopenmp
LDFLAGS = -lzstd -flto -fopenmp
endif
# Target Executable
TARGET = bestemshe
# Source Files (Inference.cpp and Splitter.cpp are removed)
SRCS = main.cpp Solver.cpp Compressor.cpp
OBJS = $(SRCS:.cpp=.o)
# Default Rule
all: $(TARGET)
# Tablebase Explorer CLI (mmap single-block reader, no solver deps)
query: query.cpp Oracle.h StateIndex.h BestemsheCore.h
@echo "[BUILDING] query..."
$(CXX) $(CXXFLAGS) query.cpp -o query $(LDFLAGS)
@echo "[SUCCESS] Build complete: ./query"
# Linking
$(TARGET): $(OBJS)
@echo "[LINKING for $(UNAME_S)] $(TARGET)..."
$(CXX) $(OBJS) -o $(TARGET) $(LDFLAGS)
@echo "[SUCCESS] Build complete: ./$(TARGET)"
# Compilation
%.o: %.cpp
@echo "[COMPILING] $<..."
$(CXX) $(CXXFLAGS) -c $< -o $@
# Clean Up
clean:
@echo "[CLEANING] Removing object files and binary..."
rm -f $(OBJS) $(TARGET) query
.PHONY: all clean |