diff --git a/lib/THCUNN/CMakeLists.txt b/lib/THCUNN/CMakeLists.txt index abc49775..f15a8b93 100644 --- a/lib/THCUNN/CMakeLists.txt +++ b/lib/THCUNN/CMakeLists.txt @@ -6,9 +6,18 @@ IF(NOT Torch_FOUND) ENDIF() IF(NOT CUDA_FOUND) - FIND_PACKAGE(CUDA 4.0 REQUIRED) + FIND_PACKAGE(CUDA 6.5 REQUIRED) ENDIF() +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.3") + if(CUDA_VERSION VERSION_LESS "8.0") + MESSAGE(STATUS "Found gcc >=5 and CUDA <= 7.5, adding workaround C++ flags") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES") + endif(CUDA_VERSION VERSION_LESS "8.0") + endif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.3") +endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + IF(NOT THCUNN_INSTALL_LIB_SUBDIR) SET(THCUNN_INSTALL_LIB_SUBDIR "lib" CACHE PATH "THCUNN install library directory") ENDIF()