You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/02/27 12:41:33 UTC

[GitHub] yajiedesign closed pull request #9899: fix cmake

yajiedesign closed pull request #9899: fix cmake
URL: https://github.com/apache/incubator-mxnet/pull/9899
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16d365355ce..caf1b268e6b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 3.0.2)
 
-project(mxnet C CXX)
+
 
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build/private/local_config.cmake)
   include(${CMAKE_CURRENT_SOURCE_DIR}/build/private/local_config.cmake)
@@ -46,6 +46,15 @@ if(USE_CUDA AND NOT USE_OLDCMAKECUDA)
         (${CMAKE_VERSION} VERSION_GREATER "3.9.0") OR (${CMAKE_VERSION} VERSION_EQUAL "3.9.0")
       )
     )
+    
+    set(CUDA_TOOLSET_LIST "auto" "7.5" "8.0" "9.0" "9.1")
+    set(CUDA_TOOLSET "auto" CACHE STRING "Select CUDA Version.")
+    set_property( CACHE CUDA_TOOLSET PROPERTY STRINGS "" ${CUDA_TOOLSET_LIST} )
+    if("${CUDA_TOOLSET}" STREQUAL "auto")
+        set(CMAKE_GENERATOR_TOOLSET "host=x64")
+    else()
+        set(CMAKE_GENERATOR_TOOLSET "cuda=${CUDA_TOOLSET},host=x64")
+    endif()
     set(FIRST_CUDA TRUE)
     project(mxnet C CXX CUDA)
   else()
@@ -180,14 +189,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
 if(USE_CUDA)
   find_package(CUDA REQUIRED)
   add_definitions(-DMSHADOW_USE_CUDA=1)
-  if(FIRST_CUDA AND (NOT USE_OLDCMAKECUDA))
-    if(CUDA_TOOLSET STREQUAL "")
-      set(CUDA_TOOLSET "${CUDA_VERSION_STRING}")
-    endif()
-    set(CMAKE_GENERATOR_TOOLSET "cuda=${CUDA_TOOLSET},host=x64")
-  else()
-    set(FIRST_CUDA FALSE)
-  endif()
   if(USE_NCCL)
     find_package(NCCL)
     if(NCCL_FOUND)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services