forked from 1flei/lccs-lsh
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
66 lines (57 loc) · 2.16 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
# SET(CMAKE_CXX_COMPILER /usr/bin/g++-8)
# SET(CMAKE_CXX_COMPILER clang++)
PROJECT(LCCS_LSH)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
#since the code uses structure binding which is the standard of C++17,
#there is the minimum version requisite for the compiler
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
message(FATAL_ERROR "GCC version must be at least 7.0!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
message(FATAL_ERROR "Clang version must be at least 8!")
endif()
else()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
endif()
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED true)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wno-unused-variable -Wno-int-in-bool-context -Wno-sign-compare")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
# set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -fsanitize=undefined")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
find_package(Boost COMPONENTS program_options REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
FIND_PACKAGE(GSL)
#GSL for lshkit
include_directories(${GSL_INCLUDE_DIR} )
include_directories("lshkit-0.2.1/include")
include_directories("FALCONN/src/include")
include_directories("FALCONN/external/simple-serializer")
include_directories("FALCONN/external/eigen")
AUX_SOURCE_DIRECTORY(. DIR_SRCS)
ADD_EXECUTABLE(lccs ${DIR_SRCS}
"pri_queue.cc"
"util.cpp"
"register.cpp"
"hashAlg/srp.cpp"
"hashAlg/pivots.cpp"
"app/composible_index.cpp"
"app/ground_truth.cc"
"app/mplsh.cpp"
"app/falconn.cpp"
"app/mp_lccs.cpp"
"app/srs.cpp"
"app/qalsh.cpp"
)
TARGET_LINK_LIBRARIES( lccs LINK_PUBLIC ${Boost_LIBRARIES}
${CMAKE_SOURCE_DIR}/lshkit-0.2.1/build/lib/liblshkit.a
${CMAKE_SOURCE_DIR}/SRS/libsrs.a
${CMAKE_SOURCE_DIR}/QALSH_Mem/libqalsh.a
GSL::gsl GSL::gslcblas pthread)