Skip to content

Commit

Permalink
Merge pull request #24 from ByteHamster-etc/ci
Browse files Browse the repository at this point in the history
Fix build and add CI checks
  • Loading branch information
vigna authored Oct 1, 2024
2 parents d66ba07 + cf77f20 commit 84aca4e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 25 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on:
push:
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --assume-yes --no-install-recommends ca-certificates build-essential git googletest libgtest-dev
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
make recsplit ranksel fenwick dynranksel
50 changes: 25 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CXXFLAGS = -g -std=c++17 -Wall -Wextra -O0 -march=native -l gtest -I./ -fsanitize=address -fsanitize=undefined
CXXFLAGS = -g -std=c++20 -Wall -Wextra -O0 -march=native -l gtest -I./ -fsanitize=address -fsanitize=undefined

bin/bits: test/bits/* sux/bits/* sux/util/Vector.hpp sux/support/*
@mkdir -p bin
Expand All @@ -22,39 +22,39 @@ ALLOC_TYPE?=MALLOC

recsplit: benchmark/function/recsplit_*
@mkdir -p bin
$(CXX) -std=c++17 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_dump.cpp -o bin/recsplit_dump_$(LEAF)
$(CXX) -std=c++17 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_dump128.cpp -o bin/recsplit_dump128_$(LEAF)
$(CXX) -std=c++17 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_load.cpp -o bin/recsplit_load_$(LEAF)
$(CXX) -std=c++17 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_load128.cpp -o bin/recsplit_load128_$(LEAF)
$(CXX) -std=c++20 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_dump.cpp -o bin/recsplit_dump_$(LEAF)
$(CXX) -std=c++20 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_dump128.cpp -o bin/recsplit_dump128_$(LEAF)
$(CXX) -std=c++20 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_load.cpp -o bin/recsplit_load_$(LEAF)
$(CXX) -std=c++20 -I./ -O3 -DSTATS -march=native -DLEAF=$(LEAF) -DALLOC_TYPE=$(ALLOC_TYPE) benchmark/function/recsplit_load128.cpp -o bin/recsplit_load128_$(LEAF)

ranksel: benchmark/bits/ranksel.cpp
@mkdir -p bin
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=0 benchmark/bits/ranksel.cpp -o bin/testsimplesel0
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=1 benchmark/bits/ranksel.cpp -o bin/testsimplesel1
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=2 benchmark/bits/ranksel.cpp -o bin/testsimplesel2
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=3 benchmark/bits/ranksel.cpp -o bin/testsimplesel3
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=SimpleSelectHalf -DNORANKTEST benchmark/bits/ranksel.cpp -o bin/testsimplehalf
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=EliasFano benchmark/bits/ranksel.cpp -o bin/testeliasfano
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=Rank9Sel -DNORANKTEST benchmark/bits/ranksel.cpp -o bin/testrank9sel
$(CXX) -std=c++17 -I./ -O3 -march=native -DCLASS=Rank9 -DNOSELECTTEST benchmark/bits/ranksel.cpp -o bin/testrank9
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=0 benchmark/bits/ranksel.cpp -o bin/testsimplesel0
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=1 benchmark/bits/ranksel.cpp -o bin/testsimplesel1
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=2 benchmark/bits/ranksel.cpp -o bin/testsimplesel2
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=SimpleSelect -DNORANKTEST -DMAX_LOG2_LONGWORDS_PER_SUBINVENTORY=3 benchmark/bits/ranksel.cpp -o bin/testsimplesel3
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=SimpleSelectHalf -DNORANKTEST benchmark/bits/ranksel.cpp -o bin/testsimplehalf
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=EliasFano benchmark/bits/ranksel.cpp -o bin/testeliasfano
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=Rank9Sel -DNORANKTEST benchmark/bits/ranksel.cpp -o bin/testrank9sel
$(CXX) -std=c++20 -I./ -O3 -march=native -DCLASS=Rank9 -DNOSELECTTEST benchmark/bits/ranksel.cpp -o bin/testrank9

fenwick: benchmark/util/fenwick.cpp
@mkdir -p bin/fenwick
$(CXX) -std=c++17 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=MALLOC benchmark/util/fenwick.cpp -o bin/fenwick/malloc_64
$(CXX) -std=c++17 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=SMALLPAGE benchmark/util/fenwick.cpp -o bin/fenwick/smallpage_64
$(CXX) -std=c++17 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=TRANSHUGEPAGE benchmark/util/fenwick.cpp -o bin/fenwick/transhugepage_64
$(CXX) -std=c++17 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=FORCEHUGEPAGE benchmark/util/fenwick.cpp -o bin/fenwick/forcehugepage_64
$(CXX) -std=c++20 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=MALLOC benchmark/util/fenwick.cpp -o bin/fenwick/malloc_64
$(CXX) -std=c++20 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=SMALLPAGE benchmark/util/fenwick.cpp -o bin/fenwick/smallpage_64
$(CXX) -std=c++20 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=TRANSHUGEPAGE benchmark/util/fenwick.cpp -o bin/fenwick/transhugepage_64
$(CXX) -std=c++20 -I./ -O3 -march=native -DSET_BOUND=64 -DSET_ALLOC=FORCEHUGEPAGE benchmark/util/fenwick.cpp -o bin/fenwick/forcehugepage_64

dynranksel: benchmark/bits/dynranksel.cpp
@mkdir -p bin/dynranksel
g++ -std=c++17 -I./ -O3 -march=native -DSET_ALLOC=MALLOC benchmark/bits/dynranksel.cpp -o bin/dynranksel/malloc_1
g++ -std=c++17 -I./ -O3 -march=native -DSET_ALLOC=SMALLPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/smallpage_1
g++ -std=c++17 -I./ -O3 -march=native -DSET_ALLOC=TRANSHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/transhugepage_1
g++ -std=c++17 -I./ -O3 -march=native -DSET_ALLOC=FORCEHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/forcehugepage_1
g++ -std=c++17 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=MALLOC benchmark/bits/dynranksel.cpp -o bin/dynranksel/malloc_16
g++ -std=c++17 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=SMALLPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/smallpage_16
g++ -std=c++17 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=TRANSHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/transhugepage_16
g++ -std=c++17 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=FORCEHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/forcehugepage_16
g++ -std=c++20 -I./ -O3 -march=native -DSET_ALLOC=MALLOC benchmark/bits/dynranksel.cpp -o bin/dynranksel/malloc_1
g++ -std=c++20 -I./ -O3 -march=native -DSET_ALLOC=SMALLPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/smallpage_1
g++ -std=c++20 -I./ -O3 -march=native -DSET_ALLOC=TRANSHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/transhugepage_1
g++ -std=c++20 -I./ -O3 -march=native -DSET_ALLOC=FORCEHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/forcehugepage_1
g++ -std=c++20 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=MALLOC benchmark/bits/dynranksel.cpp -o bin/dynranksel/malloc_16
g++ -std=c++20 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=SMALLPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/smallpage_16
g++ -std=c++20 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=TRANSHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/transhugepage_16
g++ -std=c++20 -I./ -O3 -march=native -DSET_STRIDE=16 -DSET_ALLOC=FORCEHUGEPAGE benchmark/bits/dynranksel.cpp -o bin/dynranksel/forcehugepage_16

.PHONY: clean

Expand Down
1 change: 1 addition & 0 deletions sux/function/RecSplit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <fstream>
#include <string>
#include <vector>
#include <span>

namespace sux::function {

Expand Down

0 comments on commit 84aca4e

Please sign in to comment.