-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
49 lines (41 loc) · 1.34 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
cmake_minimum_required(VERSION 3.12)
project(KV-Evaluator VERSION 1.0 LANGUAGES CXX)
# specify c/c++ standard
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif(NOT CMAKE_CXX_STANDARD)
list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/lib/libmkl")
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
set(LIB_DIR "${PROJECT_SOURCE_DIR}/lib")
# Configuration for ALEX
if (MSVC)
set(CMAKE_CXX_FLAGS "/O2 /arch:AVX2 /W1 /EHsc")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "-O3 -xHost -ggdb3 -pthread")
else ()
set(CMAKE_CXX_FLAGS "-O3 -march=native -ggdb3 -pthread")
endif ()
include_directories(
${SRC_DIR}
${LIB_DIR}
)
add_executable(format "${SRC_DIR}/util/format_data.cc")
add_executable(gen "${SRC_DIR}/util/data_generator.cc")
add_executable(nf_convert "${SRC_DIR}/util/nf_data_converter.cc")
add_executable(benchmark "${SRC_DIR}/benchmark.cc")
find_package(MKL)
if (MKL_FOUND)
include_directories(${MKL_INCLUDE_DIR})
target_link_libraries(benchmark ${MKL_LIBRARIES})
else ()
message(WARNING "MKL libs not found")
endif ()
find_package(OpenMP REQUIRED)
if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else ()
message(WARNING "OpenMP libs not found")
endif ()