Skip to content

Commit

Permalink
adapt si cmake.
Browse files Browse the repository at this point in the history
  • Loading branch information
thawk105 committed Aug 3, 2020
1 parent 3b5e293 commit cfa64a7
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 15 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.txt
*.dat
*.eps
*.data
Expand Down
8 changes: 0 additions & 8 deletions common/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@

MOCC_SRCS1+=\
$(REL)result.cc\
$(REL)util.cc\

SI_SRCS1+=\
$(REL)result.cc\
$(REL)util.cc\

SS2PL_SRCS1+=\
$(REL)result.cc\
$(REL)util.cc\
Expand Down
75 changes: 75 additions & 0 deletions si/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
cmake_minimum_required(VERSION 3.10)

project(ccbench_si
VERSION 0.0.1
DESCRIPTION "si of ccbench"
LANGUAGES CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")

option(ENABLE_SANITIZER "enable sanitizer on debug build" ON)
option(ENABLE_UB_SANITIZER "enable undefined behavior sanitizer on debug build" OFF)
option(ENABLE_COVERAGE "enable coverage on debug build" OFF)

find_package(Doxygen)
find_package(Threads REQUIRED)
find_package(gflags REQUIRED)
find_package(glog REQUIRED)
find_package(Boost
COMPONENTS filesystem)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(CompileOptions)

file(GLOB SI_SOURCES
"../common/result.cc"
"../common/util.cc"
"si.cc"
"garbage_collection.cc"
"result.cc"
"transaction.cc"
"util.cc"
)

add_executable(si.exe ${SI_SOURCES})

target_link_libraries(si.exe
Boost::filesystem
gflags::gflags
${PROJECT_SOURCE_DIR}/../third_party/mimalloc/out/release/libmimalloc.a
${PROJECT_SOURCE_DIR}/../third_party/masstree/libkohler_masstree_json.a
Threads::Threads
)

if (DEFINED ADD_ANALYSIS)
add_definitions(-DADD_ANALYSIS=${ADD_ANALYSIS})
else ()
add_definitions(-DADD_ANALYSIS=0)
endif ()

if (DEFINED BACK_OFF)
add_definitions(-DBACK_OFF=${BACK_OFF})
else ()
add_definitions(-DBACK_OFF=0)
endif ()

add_definitions(-DCCTR_ON)

if (DEFINED KEY_SIZE)
add_definitions(-DKEY_SIZE=${KEY_SIZE})
else ()
add_definitions(-DKEY_SIZE=8)
endif ()

if (DEFINED MASSTREE_USE)
add_definitions(-DMASSTREE_USE=${MASSTREE_USE})
else ()
add_definitions(-DMASSTREE_USE=1)
endif ()

if (DEFINED VAL_SIZE)
add_definitions(-DVAL_SIZE=${VAL_SIZE})
else ()
add_definitions(-DVAL_SIZE=4)
endif ()
27 changes: 21 additions & 6 deletions si/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ So some parts is like ERMIA in implementation, configuration, and design to anal
$ cd ../
$ ./bootstrap.sh
```
This makes ../third_party/masstree/libkohler_masstree_json.a used below building.
This makes ../third_party/masstree/libkohler_masstree_json.a used by building cicada.
- Build mimalloc
```
$ cd ../
$ ./bootstrap_mimalloc.sh
```
This makes ../third_party/mimalloc/out/release/libmimalloc.a used by building cicada.
- Build
```
$ make
$ mkdir build
$ cd build
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
$ ninja
```
- Confirm usage
```
Expand All @@ -22,11 +31,17 @@ $ ./si.exe
$ numactl --interleave=all ./si.exe 1000 10 224 100 off 0 off 2100 10 100 0 3
```

## How to select build options in Makefile
- `VAL_SIZE` : Value of key-value size. In other words, payload size.
- `ADD_ANALYSIS` : If this is 1, it is deeper analysis than setting 0.
- `BACK_OFF` : If this is 1, it use Cicada's backoff.
## How to customize options in CMakeLists.txt
- `ADD_ANALYSIS` : If this is 1, it is deeper analysis than setting 0.<br>
default : `0`
- `BACK_OFF` : If this is 1, it use Cicada's backoff.<br>
default : `0`
- `KEY_SORT` : If this is 1, its transaction accesses records in ascending key order.<br>
default : `0`
- `MASSTREE_USE` : If this is 1, it use masstree as data structure. If not, it use simple array αs data structure.
default : `1`
- `VAL_SIZE` : Value of key-value size. In other words, payload size.<br>
default : `4`
- CFLAGS
- Use either `-DCCTR_ON` or `-DCCTR_TW`. These meanings is described below in section **Details of Implementation**.

Expand Down

0 comments on commit cfa64a7

Please sign in to comment.