Skip to content

Instantly share code, notes, and snippets.

@jrsa
Created August 7, 2016 19:43
Show Gist options
  • Save jrsa/3d3da16f288b0c4fec00c60f50bfed17 to your computer and use it in GitHub Desktop.
Save jrsa/3d3da16f288b0c4fec00c60f50bfed17 to your computer and use it in GitHub Desktop.
diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt
index f947e03..ad0420b 100644
--- a/dlib/CMakeLists.txt
+++ b/dlib/CMakeLists.txt
@@ -457,7 +457,7 @@ if (NOT TARGET dlib)
# Note that we add __STRICT_ANSI__ to avoid freaking out nvcc with gcc specific
# magic in the standard C++ header files (since nvcc uses gcc headers on
# linux).
- list(APPEND CUDA_NVCC_FLAGS "-arch=sm_30;-std=c++11;-D__STRICT_ANSI__;-D_MWAITXINTRIN_H_INCLUDED;-D_FORCE_INLINES")
+ list(APPEND CUDA_NVCC_FLAGS "-arch=sm_30;-D__STRICT_ANSI__;-D_MWAITXINTRIN_H_INCLUDED;-D_FORCE_INLINES")
include(cmake_utils/test_for_cudnn/find_cudnn.txt)
@@ -490,7 +490,7 @@ if (NOT TARGET dlib)
endif()
- if (CUDA_FOUND AND cudnn AND cudnn_include AND COMPILER_CAN_DO_CPP_11 AND cuda_test_compile_worked AND cudnn_test_compile_worked)
+ # if (CUDA_FOUND AND cudnn AND cudnn_include AND COMPILER_CAN_DO_CPP_11 AND cuda_test_compile_worked AND cudnn_test_compile_worked)
set(source_files ${source_files}
dnn/cuda_dlib.cu
dnn/cudnn_dlibapi.cpp
@@ -504,18 +504,18 @@ if (NOT TARGET dlib)
${CUDA_curand_LIBRARY}
)
include_directories(${cudnn_include})
- else()
- set(DLIB_USE_CUDA OFF CACHE STRING ${DLIB_USE_BLAS_STR} FORCE )
- toggle_preprocessor_switch(DLIB_USE_CUDA)
- if (COMPILER_CAN_DO_CPP_11)
- if (NOT cudnn OR NOT cudnn_include OR NOT cudnn_test_compile_worked)
- message(STATUS "*** cuDNN V5.0 OR GREATER NOT FOUND. DLIB WILL NOT USE CUDA. ***")
- message(STATUS "*** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder.")
- endif()
- else ()
- message(STATUS "*** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***")
- endif()
- endif()
+ # else()
+ # set(DLIB_USE_CUDA OFF CACHE STRING ${DLIB_USE_BLAS_STR} FORCE )
+ # # toggle_preprocessor_switch(DLIB_USE_CUDA)
+ # if (COMPILER_CAN_DO_CPP_11)
+ # if (NOT cudnn OR NOT cudnn_include OR NOT cudnn_test_compile_worked)
+ # message(STATUS "*** cuDNN V5.0 OR GREATER NOT FOUND. DLIB WILL NOT USE CUDA. ***")
+ # message(STATUS "*** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder.")
+ # endif()
+ # else ()
+ # message(STATUS "*** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***")
+ # endif()
+ # endif()
endif()
diff --git a/dlib/cmake_utils/test_for_cudnn/find_cudnn.txt b/dlib/cmake_utils/test_for_cudnn/find_cudnn.txt
index 7f596f4..131c31a 100644
--- a/dlib/cmake_utils/test_for_cudnn/find_cudnn.txt
+++ b/dlib/cmake_utils/test_for_cudnn/find_cudnn.txt
@@ -14,3 +14,6 @@ find_library(cudnn cudnn
PATH_SUFFIXES lib64 lib
)
mark_as_advanced(cudnn cudnn_include)
+
+set(cudnn /Developer/NVIDIA/CUDA-7.5/lib/libcudnn.dylib)
+set(cudnn_include /Developer/NVIDIA/CUDA-7.5/include/cudnn.h)
\ No newline at end of file
diff --git a/dlib/cmake_utils/use_cpp_11.cmake b/dlib/cmake_utils/use_cpp_11.cmake
index b29cfdc..615b7fa 100644
--- a/dlib/cmake_utils/use_cpp_11.cmake
+++ b/dlib/cmake_utils/use_cpp_11.cmake
@@ -14,7 +14,7 @@ if (POLICY CMP0054)
endif()
# Set to false unless we find out otherwise in the code below.
-set(COMPILER_CAN_DO_CPP_11 0)
+set(COMPILER_CAN_DO_CPP_11 1)
include(${CMAKE_CURRENT_LIST_DIR}/add_global_compiler_switch.cmake)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment