-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
59 lines (48 loc) · 1.5 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
PROJECT(easydl)
set(CUDA_TOOLKIT_ROOT_DIR "/usr/local/cuda-8.0")
find_package(CUDA REQUIRED)
# include directories
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}
${CUDA_TOOLKIT_ROOT_DIR}/include/
/usr/local/include
/usr/include
/usr/include/python2.7
${PROJECT_SOURCE_DIR}/third_party/googletest/googletest/include
)
# lib directories
LINK_DIRECTORIES(
${PROJECT_BINARY_DIR}/lib
${CUDA_TOOLKIT_ROOT_DIR}/lib64
/usr/local/lib
/usr/lib
/usr/lib64
/usr/lib/python2.7/config-x86_64-linux-gnu
${PROJECT_SOURCE_DIR}/third_party/googletest/build/googlemock/gtest
)
# for link
set(SYSLIB
pthread
glog
gflags
cublas
cudart
curand
gtest
python2.7
boost_python
)
add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11 -Xcompiler -fPIC -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\"")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fopenmp -fPIC")
ADD_SUBDIRECTORY(util)
ADD_SUBDIRECTORY(tensor)
ADD_SUBDIRECTORY(operator)
ADD_SUBDIRECTORY(pywrapper)
ENABLE_TESTING()
#ADD_TEST(test_singleton ${PROJECT_BINARY_DIR}/bin/test_singleton)
#ADD_TEST(test_xlog ${PROJECT_BINARY_DIR}/bin/test_xlog)