-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
74 lines (56 loc) · 2.07 KB
/
CMakeLists.txt
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.14)
include(FetchContent)
project(fptree)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src)
if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++17 -lpmem -lpmemobj -ljemalloc -mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd -mrtm -ltbb -pthread")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -g2 -std=c++17 -lpmem -lpmemobj -mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd -mrtm -ltbb -pthread")
endif()
set(PMEM_BACKEND "PMEM" CACHE STRING "Persistent memory backend type")
if(${PMEM_BACKEND} STREQUAL "PMEM")
add_definitions(-DPMEM)
message(STATUS "Persistence support: PMEM")
elseif(${PMEM_BACKEND} STREQUAL "DRAM")
message(STATUS "Persistence support: off")
else()
message(FATAL_ERROR "Unsupported persistent memory backend: ${PMEM_BACKEND}")
endif()
option(BUILD_INSPECTOR "Build inspector to check correctness of single/multi-thread operation" ON)
option(TEST_MODE "Test mode will test leaf nodes and inner node smaller to help debug" ON)
option(NDEBUG "Disable assert statements" ON)
if(${TEST_MODE})
add_definitions(-DTEST_MODE)
message(STATUS "TEST_MODE: defined")
else()
message(STATUS "TEST_MODE: not defined")
endif()
if(${BUILD_INSPECTOR})
add_definitions(-DBUILD_INSPECTOR)
message(STATUS "BUILD_INSPECTOR: defined")
add_executable(
inspector
fptree.cpp
fptree.h
inspector.cpp
)
else()
message(STATUS "BUILD_INSPECTOR: not defined")
endif()
##################### PiBench #########################
FetchContent_Declare(
pibench
GIT_REPOSITORY https://github.com/sfu-dis/pibench.git
GIT_TAG master
)
if (NOT pibench_POPULATED)
FetchContent_Populate(pibench)
include_directories(${pibench_SOURCE_DIR}/include)
endif ()
add_library(fptree_pibench_wrapper SHARED fptree_wrapper.cpp
fptree.cpp)