From 6bfc5f04f73534aec1b5582a8a45573e3fa074f9 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Wed, 26 Jun 2019 13:33:03 +0300 Subject: [PATCH] Added tighter bounds for gcc and nvcc versions. There was a bit of an chicken-and-egg issue: we need gcc 6.0 in order to get bug 48891 (see gcc bugzilla) fixed, but cuda < 9 supports gcc only up to 5.3. This is not a perfect solution, f.ex. ubuntu 16.04 ships with gcc 5.4 but with the fix backported from later versions so in practice that would also work but is not accepted anymore. --- CMakeLists.txt | 4 ++-- src/core/CMakeLists.txt | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15a48d9..349201e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,8 +48,8 @@ message(STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER}) message(STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER_ID}) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4) - message(FATAL_ERROR "GCC version 5.4 or higher required") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) # Because of GCC bug 48891 + message(FATAL_ERROR "GCC version 6.0 or higher required") endif() endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e875faa..9b67f11 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -4,13 +4,7 @@ #----------------------Find CUDA-----------------------------------------------# -find_package(CUDA) -if (NOT CUDA_FOUND) - # find_package(CUDA REQUIRED) gives a confusing error message if it fails, - # therefore we print the reason here explicitly - message(FATAL_ERROR "CUDA not found") -endif() - +find_package(CUDA 9 REQUIRED) #----------------------CUDA settings-------------------------------------------#