Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/benchmark.yml

This file was deleted.

30 changes: 23 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,40 @@ on:
pull_request:
branches:
- main

workflow_dispatch:

jobs:
build_and_test:
runs-on:
group: k23a
runs-on: self-hosted

env:
CCACHE_DIR: ${{ github.workspace }}/.ccache

steps:
- name: Checkout repository code
uses: actions/checkout@v4

- name: Setup cache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-

- name: Configure initial build with CMake
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -Wno-dev
nix develop -c \
cmake -S . -B build -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: Build all targets
run: cmake --build build -- -j $(nproc) unit_tests
run: |
nix develop -c \
cmake --build build -- -j $(nproc) unit_tests

- name: Run unit tests
run: ./build/unit_tests

- name: Cache stats
run: nix develop -c ccache -s
48 changes: 0 additions & 48 deletions .github/workflows/notifier.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
/docs/html
/docs/xml
.clangd
.cache
.ccache
compile_commands.json
/env/
script.py
*.md
/build_deferred
/build_debug
/build_eager
40 changes: 2 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,11 @@ FetchContent_Declare(

FetchContent_MakeAvailable(fmtlib)

set(ENABLE_SANITIZER OFF)
set(ENABLE_UBSAN OFF)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc|powerpc|ppc64|ppc64le")
message("Disabling jemalloc extension of DuckDB on Power.")
set(SKIP_EXTENSIONS jemalloc)
endif()

# Detect Xeon E5-2680 v3 CPU for benchmark VM hardware configuration
# Requires both: correct CPU AND at least 32GB RAM (benchmark VM has 64GB, CI has 4GB)
set(IS_BENCHMARK_VM_HARDWARE OFF)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND EXISTS "/proc/cpuinfo")
file(READ "/proc/cpuinfo" CPUINFO_CONTENT)
if(CPUINFO_CONTENT MATCHES "E5-2680 v3")
# Check available memory to distinguish benchmark VM from CI VM
if(EXISTS "/proc/meminfo")
file(READ "/proc/meminfo" MEMINFO_CONTENT)
string(REGEX MATCH "MemTotal:[ \t]+([0-9]+)" MEM_MATCH "${MEMINFO_CONTENT}")
if(MEM_MATCH)
set(MEM_TOTAL_KB "${CMAKE_MATCH_1}")
math(EXPR MEM_TOTAL_GB "${MEM_TOTAL_KB} / 1024 / 1024")
if(MEM_TOTAL_GB GREATER_EQUAL 32)
message(STATUS "Detected Intel Xeon E5-2680 v3 CPU with ${MEM_TOTAL_GB}GB RAM - using benchmark VM hardware configuration")
add_compile_definitions(SPC__USE_BENCHMARKVM_HARDWARE)
set(IS_BENCHMARK_VM_HARDWARE ON)
else()
message(STATUS "Detected Intel Xeon E5-2680 v3 CPU but only ${MEM_TOTAL_GB}GB RAM (need >=32GB) - using generic hardware configuration")
endif()
endif()
endif()
endif()
endif()

# Include all sources from /src directory. CONFIGURE_DEPENDS can be unreliable.
# Try re-running cmake in case changes are not recognized.
file(GLOB ALL_SRC
CONFIGURE_DEPENDS
"src/*.cpp"
Expand All @@ -100,7 +71,7 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch64")
add_compile_options(-O3 -mcpu=apple-m1 -flto)
else()
add_compile_options(-O3 -march=native -m64 -mcrc32 -fpermissive -flto)
add_compile_options(-O0 -march=skylake -m64 -mcrc32 -fpermissive)
endif()

add_link_options(-flto)
Expand All @@ -112,19 +83,12 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(faster PRIVATE)
target_link_libraries(faster PRIVATE re2 fmt range-v3 nlohmann_json::nlohmann_json sqlparser)
target_include_directories(faster PRIVATE include)

if(IS_BENCHMARK_VM_HARDWARE)
add_executable(leaderboard ${MANOLATES_SRC} tests/read_sql.cpp)
target_compile_definitions(leaderboard PRIVATE)
target_link_libraries(leaderboard PRIVATE re2 fmt range-v3 nlohmann_json::nlohmann_json sqlparser)
target_include_directories(leaderboard PRIVATE include)
endif()
endif()

if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch64")
target_compile_options(unit_tests PRIVATE -O3 -mcpu=apple-m1 -flto)
else()
target_compile_options(unit_tests PRIVATE -O3 -march=native -m64 -fpermissive -flto)
target_compile_options(unit_tests PRIVATE -O0 -march=skylake -m64 -fpermissive)
endif()

target_compile_definitions(unit_tests PRIVATE)
Expand Down
11 changes: 6 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
buildInputs = with pkgs; [
llvmPackages.libcxxClang
llvmPackages.libllvm
ccache
doxygen
curl
git
cmake
typst
] ++ lib.optionals (system == "x86_64-linux") [
linuxPackages.perf
perf
gef
];
shellHook = ''
CLANGD_FILE=".clangd"
CPP_STANDARD="c++20"

echo "Generating $CLANGD_FILE from \$ clang++ -v output..."

INCLUDE_PATHS=$(
Expand All @@ -57,9 +57,10 @@
echo " - -I$CLEAN_PATH" >> $CLANGD_FILE
done <<< "$INCLUDE_PATHS"

echo " - -O2" >> $CLANGD_FILE

echo "Generation of $CLANGD_FILE complete."
echo "exporting ccache paths..."
export CCACHE_DIR="$PWD/.ccache"
export PATH="${pkgs.ccache}/bin:$PATH"
echo "done."

if command -v fish &> /dev/null; then
exec fish
Expand Down
Loading