diff options
author | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2016-10-10 16:15:54 +0300 |
---|---|---|
committer | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2016-10-10 16:25:11 +0300 |
commit | bab8badb02734ad51f7b5b8c1922d04c8cc4a104 (patch) | |
tree | 2d6e47aee4e44162da2916b876e851248d25bcfc /CMakeLists.txt | |
parent | 0d4b58712262a05498a42656fbd6a413a7652036 (diff) |
cuda options, fixes #13
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 95d13e6d..6d044db3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,23 +8,24 @@ SET(CMAKE_CXX_FLAGS " -std=c++14 -m64 -flto -march=native -fPIC -g -O3 -Ofast -f include_directories(${amunmt_SOURCE_DIR}) -set(CUDA ON CACHE BOOL "Compile without CUDA") +option(CUDA "Select to compile CUDA support by default if available" ON) -if(NOT CUDA) - message("-- Forcing compilation without CUDA.") - add_definitions(-DNO_CUDA) -else(NOT CUDA) -find_package(CUDA) -if(CUDA_FOUND) +if(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) + message("-- Compiling with CUDA support") + else(CUDA_FOUND) + add_definitions(-DNO_CUDA) + message("-- Cannot find CUDA libraries. Compiling without them." ) + endif(CUDA_FOUND) +else(CUDA) + message("-- Forcing compilation without CUDA.") add_definitions(-DNO_CUDA) - message("Cannot find CUDA libraries. Compiling without them." ) -endif(CUDA_FOUND) -endif(NOT CUDA) +endif(CUDA) find_package(Boost COMPONENTS system filesystem program_options timer iostreams python thread) if(Boost_FOUND) |