-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
65 lines (52 loc) · 2.13 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
cmake_minimum_required(VERSION "3.1.0")
include(cmake/custom_functions.cmake)
project(root)
find_package(Torch REQUIRED)
option(USE_CUDA "Build with CUDA")
include(GNUInstallDirs)
find_library(CATBOOST catboost)
find_path(CATBOOST_INCLUDES_API catboost_api.h contrib/catboost)
include_directories(${CATBOOST_INCLUDES_API})
include_directories(contrib/catboost/)
# WTF this not work...
#IF (WIN32)
## add_library(catboost STATIC IMPORTED)
## set_property(TARGET catboost PROPERTY IMPORTED_LOCATION "libcatboost.lib")
#ELSE()
# IF(APPLE)
# add_library(catboost SHARED IMPORTED)
# set_property(TARGET catboost PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/libcatboost.dylib)
# ELSE()
# add_library(catboost SHARED IMPORTED)
# set_property(TARGET catboost PROPERTY IMPORTED_LOCATION "libcatboost.so")
# ENDIF())
#ENDIF()
include_directories(contrib/json)
add_subdirectory(contrib/googletest)
include_directories(contrib/googletest/include contrib/googletest)
find_library(GTEST gtest NO_DEFAULT_PATH)
message("gtest path: ${GTEST}")
add_subdirectory(contrib/pybind11)
enable_testing()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(USE_CUDA)
enable_language(CUDA)
add_definitions(-DCUDA)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
# SET(CMAKE_CUDA_FLAGS "–cudart static")
set(CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION ON)
include_directories(cub)
set(CUDA_NVCC_FLAGS "--expt-relaxed-constexpr
-gencode arch=compute_30,code=compute_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=compute_50
-gencode arch=compute_52,code=sm_52
-gencode arch=compute_60,code=compute_60
-gencode arch=compute_61,code=compute_61
-gencode arch=compute_61,code=sm_61
-gencode arch=compute_70,code=sm_70
-gencode arch=compute_70,code=compute_70
--ptxas-options=-v")
endif()
add_subdirectory(cpp)