diff options
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) |