forked from stone8oy/deepRL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·64 lines (51 loc) · 1.68 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
cmake_minimum_required (VERSION 2.6)
project(deepRL)
option(CPU_ONLY "Use CPU only for Caffe" ON)
option(USE_CUDNN "Use cuDNN for Caffe" OFF)
option(USE_SDL "Use SDL for ALE" ON)
#SET to your path
SET(CAFFE_DIR ~/Desktop/ml/dl/caffe)
SET(ALE_DIR ~/Desktop/deeprlcn/ALE)
include_directories(${CAFFE_DIR}/include)
include_directories(${ALE_DIR}/src)
link_directories(${CAFFE_DIR}/build/lib)
link_directories(${ALE_DIR})
if(USE_CUDNN)
link_directories(~/cudnn-6.5-linux-R1)
endif()
add_executable(deepRL ./src/aleRun.cpp ./src/agent.cpp ./src/memoryreplay.cpp ./src/tools.cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall -g -march=native")
target_link_libraries(deepRL caffe)
target_link_libraries(deepRL glog)
target_link_libraries(deepRL gflags)
target_link_libraries(deepRL ale)
target_link_libraries(deepRL boost_system)
target_link_libraries(deepRL boost_program_options)
if(APPLE)
include_directories(/System/Library/Frameworks/vecLib.framework/Versions/Current/Headers)
endif()
if(USE_SDL)
add_definitions(-D_USE_SDL)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework Cocoa")
target_link_libraries(deepRL sdl)
target_link_libraries(deepRL sdl_gfx)
target_link_libraries(deepRL sdl_image)
target_link_libraries(deepRL sdlmain)
else()
target_link_libraries(deepRL SDL)
target_link_libraries(deepRL SDL_gfx)
target_link_libraries(deepRL SDL_image)
target_link_libraries(deepRL SDLmain)
endif()
endif()
# CHANGE to your path
if(NOT CPU_ONLY)
include_directories(/usr/local/cuda-6.5/targets/x86_64-linux/include)
endif()
if(CPU_ONLY)
add_definitions(-DCPU_ONLY)
endif()
if(USE_CUDNN)
target_link_libraries(deepRL cudnn)
endif()