forked from technicolor-research/pq-fast-scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (66 loc) · 2.32 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
74
75
76
77
78
79
80
81
82
83
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../build-pq-fast-scan")
cmake_minimum_required(VERSION 2.8)
project(pq-fast-scan)
include(FeatureSummary)
message("PQ Fast Scan can only be built on hosts "
"supporting SSE2, SSE3, SSSE3 and POPCNT")
option(AVX "Compile scan functions requiring AVX intrinsics" ON)
option(AVX2 "Compile scan functions requiring AVX2 intrinsics" OFF)
# Options
add_feature_info(AVX AVX
"Compile scan functions requiring AVX intrinsics")
add_feature_info(AVX2 AVX2
"Compile scan functions requiring AVX2 intrinsics (automatically enables AVX)")
if(AVX2)
set(AVX ON)
endif()
feature_summary(WHAT ALL)
# Set GCC Flags
set(GCC_FLAGS
"-g -ggdb -O3 -m64 -march=native -ffast-math -Wall -Werror -L/home/rw545/lib/perfmon2-libpfm4/lib")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
set(GCC_FLAGS "-fdiagnostics-color=auto ${GCC_FLAGS}")
endif()
message("GCC Flags: ${GCC_FLAGS}")
# C++ Flags
set(CMAKE_CXX_FLAGS "-std=c++11 ${GCC_FLAGS}")
# Configure options
configure_file("${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h")
include_directories("${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}" "/home/rw545/lib/perfmon2-libpfm4/include")
# Libraries
set(LINK_LIBS pfm)
# Object files
add_library(common OBJECT common.cpp)
add_library(binheap OBJECT binheap.cpp)
add_library(benchmark OBJECT benchmark.cpp perfevents.cpp)
add_library(scan_naive OBJECT pqscan/scan_naive.cpp)
# Target: pqscan - PQ Scan implementations - Synthetic data
set(PQSCAN_SRCS pqscan/scan_sse.cpp)
if(AVX)
list(APPEND PQSCAN_SRCS pqscan/scan_avx.cpp)
endif()
if(AVX2)
list(APPEND PQSCAN_SRCS pqscan/scan_gather.cpp)
endif()
add_executable(pqscan
pqscan/pqscan.cpp
pqscan/populate.cpp
${PQSCAN_SRCS}
$<TARGET_OBJECTS:scan_naive>
$<TARGET_OBJECTS:common>
$<TARGET_OBJECTS:binheap>
$<TARGET_OBJECTS:benchmark>)
target_link_libraries(pqscan ${LINK_LIBS})
# Target: pqfastcan - PQ Fast Scan - Real data
add_executable(pqfastscan
pqfastscan/pqfastscan.cpp
pqfastscan/fastscan.cpp
pqfastscan/layout.cpp
$<TARGET_OBJECTS:scan_naive>
$<TARGET_OBJECTS:common>
$<TARGET_OBJECTS:binheap>
$<TARGET_OBJECTS:benchmark>)
target_link_libraries(pqfastscan ${LINK_LIBS})