blob: 95d13e6d205979f9cebe53c7ddc602ab045b9301 (
plain)
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
|
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project(amunn CXX)
SET(CMAKE_CXX_FLAGS " -std=c++14 -m64 -flto -march=native -fPIC -g -O3 -Ofast -funroll-loops -ffinite-math-only -Wno-unused-result -Wno-deprecated -pthread")
include_directories(${amunmt_SOURCE_DIR})
set(CUDA ON CACHE BOOL "Compile without CUDA")
if(NOT CUDA)
message("-- Forcing compilation without CUDA.")
add_definitions(-DNO_CUDA)
else(NOT CUDA)
find_package(CUDA)
if(CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS --default-stream per-thread; -std=c++11; -g; -O3; -arch=sm_35; -lineinfo; --use_fast_math;)
add_definitions(-DCUDA_API_PER_THREAD_DEFAULT_STREAM)
add_definitions(-DCUDA)
SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
else(CUDA_FOUND)
add_definitions(-DNO_CUDA)
message("Cannot find CUDA libraries. Compiling without them." )
endif(CUDA_FOUND)
endif(NOT CUDA)
find_package(Boost COMPONENTS system filesystem program_options timer iostreams python thread)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
set(EXT_LIBS ${EXT_LIBS} ${Boost_LIBRARIES})
else(Boost_FOUND)
message(SEND_ERROR "Cannot find Boost libraries. Terminating." )
endif(Boost_FOUND)
find_package(PythonLibs 2.7 REQUIRED)
if(PYTHONLIBS_FOUND)
message("-- Found Python" )
include_directories(${PYTHON_INCLUDE_DIRS})
set(EXT_LIBS ${EXT_LIBS} ${PYTHON_LIBRARIES})
else(PYTHONLIBS_FOUND)
message(SEND_ERROR "Cannot find python libraries. Terminating." )
endif(PYTHONLIBS_FOUND)
find_package (BZip2)
if (BZIP2_FOUND)
include_directories(${BZIP2_INCLUDE_DIRS})
set(EXT_LIBS ${EXT_LIBS} ${BZIP2_LIBRARIES})
endif (BZIP2_FOUND)
find_package (ZLIB)
if (ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
set(EXT_LIBS ${EXT_LIBS} ${ZLIB_LIBRARIES})
endif (ZLIB_FOUND)
find_package (LibLZMA)
if (LIBLZMA_FOUND)
include_directories(${LIBLZMA_INCLUDE_DIRS})
set(EXT_LIBS ${EXT_LIBS} ${LIBLZMA_LIBRARIES})
endif (LIBLZMA_FOUND)
include_directories($amunmt_SOURCE_DIR}/src)
add_subdirectory(src)
|