forked from Xtra-Computing/thundersvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·55 lines (42 loc) · 1.43 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
cmake_minimum_required(VERSION 2.8.12)
cmake_policy(SET CMP0048 NEW)
project(thundersvm VERSION 0.1.0 LANGUAGES C CXX)
set(USE_CUDA ON CACHE BOOL "Compile with CUDA")
set(USE_EIGEN OFF CACHE BOOL "Compile with Eigen")
find_package(Threads REQUIRED)
#find_package(MKL REQUIRED)
#include_directories(${MKL_INCLUDE_DIRS})
#link_directories(${MKL_LIBRARIES})
#target_link_libraries(<module>
#mkl_intel_lp64
#mkl_sequential
#mkl_core
#)
if (USE_CUDA)
message("Compile with CUDA")
find_package(CUDA REQUIRED QUIET)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -std=c++11 -Wno-deprecated-gpu-targets)
set(LINK_LIBRARY ${CUDA_cusparse_LIBRARY})
else ()
message("Compile without CUDA")
find_package(OpenMP REQUIRED)
endif ()
if (USE_EIGEN)
message("using Eigen for acceleration")
include_directories(${PROJECT_SOURCE_DIR}/eigen)
endif ()
if (CMAKE_VERSION VERSION_LESS "3.1")
add_compile_options("-std=c++11")
else ()
set(CMAKE_CXX_STANDARD 11)
endif ()
set(COMMON_INCLUDES ${PROJECT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR})
set(DATASET_DIR ${PROJECT_SOURCE_DIR}/dataset/)
configure_file(include/thundersvm/config.h.in config.h)
set(PROJECT_LIB_NAME ${PROJECT_NAME}-lib)
include_directories(${COMMON_INCLUDES})
add_subdirectory(${PROJECT_SOURCE_DIR}/src/thundersvm)
set(PROJECT_TEST_NAME ${PROJECT_NAME}-test)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/test)
add_custom_target(runtest
COMMAND ${PROJECT_TEST_NAME})