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 2017/12/12 22:00:11 UTC

[GitHub] piiswrong closed pull request #7809: open dlpack in windows

piiswrong closed pull request #7809: open dlpack in windows
URL: https://github.com/apache/incubator-mxnet/pull/7809
 
 
   

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 c20759cc35..6200c0e43e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,11 @@ mxnet_option(USE_OPENCV           "Build with OpenCV support" ON)
 mxnet_option(USE_OPENMP           "Build with Openmp support" ON)
 mxnet_option(USE_CUDA             "Build with CUDA support"   ON)
 mxnet_option(USE_CUDNN            "Build with cudnn support"  ON) # one could set CUDNN_ROOT for search path
-mxnet_option(USE_LAPACK           "Build with lapack support" ON IF NOT MSVC)
+if(MSVC)
+mxnet_option(USE_LAPACK           "Build with lapack support" OFF)
+else()
+mxnet_option(USE_LAPACK           "Build with lapack support" ON)
+endif()
 mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON)
 mxnet_option(USE_MKLML_MKL        "Use MKLML variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND UNIX AND (NOT APPLE))
 mxnet_option(USE_MKL_EXPERIMENTAL "Use experimental MKL (if MKL enabled and found)" OFF)
@@ -209,11 +213,15 @@ elseif(UNIX)
 endif()
 
 if(USE_LAPACK)
-  add_definitions(-DMXNET_USE_LAPACK=1)
-  list(APPEND mxnet_LINKER_LIBS lapack)
+  if(BLAS STREQUAL "Open" OR BLAS STREQUAL "open")
+    add_definitions(-DMXNET_USE_LAPACK=1)
+  elseif()
+    find_package(LAPACK REQUIRED)
+    add_definitions(-DMXNET_USE_LAPACK=1)
+    list(APPEND mxnet_LINKER_LIBS ${LAPACK_LIB})
+  endif()
 else(USE_LAPACK)
-  # Workaround for Windows until using new Jenkinsfile.
-  if(USE_BLAS STREQUAL "open")
+  if(BLAS STREQUAL "Open" OR BLAS STREQUAL "open")
     add_definitions(-DMXNET_USE_LAPACK=1)
   endif()
 endif()
diff --git a/cmake/Modules/FindLAPACK.cmake b/cmake/Modules/FindLAPACK.cmake
new file mode 100644
index 0000000000..a36b22c0a2
--- /dev/null
+++ b/cmake/Modules/FindLAPACK.cmake
@@ -0,0 +1,84 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+file(TO_CMAKE_PATH "$ENV{LAPACK_HOME}" LAPACK_HOME)
+file(TO_CMAKE_PATH "$ENV{LAPACK}" LAPACK_DIR)
+
+SET(LAPACK_INCLUDE_SEARCH_PATHS
+  /usr/include
+  /usr/include/LAPACK
+  /usr/include/LAPACK-base
+  /usr/local/include
+  /usr/local/include/LAPACK
+  /usr/local/include/LAPACK-base
+  /opt/LAPACK/include
+  /usr/local/opt/LAPACK/include
+  ${PROJECT_SOURCE_DIR}/3rdparty/LAPACK/include
+  ${PROJECT_SOURCE_DIR}/thirdparty/LAPACK/include
+  ${LAPACK_HOME}
+  ${LAPACK_HOME}/include
+)
+
+SET(LAPACK_LIB_SEARCH_PATHS
+        /lib/
+        /lib/LAPACK-base
+        /lib64/
+        /usr/lib
+        /usr/lib/LAPACK-base
+        /usr/lib64
+        /usr/local/lib
+        /usr/local/lib64
+        /opt/LAPACK/lib
+        /usr/local/opt/LAPACK/lib
+        ${PROJECT_SOURCE_DIR}/3rdparty/LAPACK/lib
+        ${PROJECT_SOURCE_DIR}/thirdparty/LAPACK/lib
+        ${LAPACK_DIR}
+        ${LAPACK_DIR}/lib
+        ${LAPACK_HOME}
+        ${LAPACK_HOME}/lib
+ )
+
+#FIND_PATH(LAPACK_INCLUDE_DIR NAMES cblas.h PATHS ${LAPACK_INCLUDE_SEARCH_PATHS})
+FIND_LIBRARY(LAPACK_LIB NAMES lapack PATHS ${LAPACK_LIB_SEARCH_PATHS})
+IF(NOT LAPACK_LIB)
+	FIND_FILE(LAPACK_LIB NAMES liblapack.dll.a PATHS ${LAPACK_LIB_SEARCH_PATHS})
+ENDIF()
+
+SET(LAPACK_FOUND ON)
+
+#    Check libraries
+IF(NOT LAPACK_LIB)
+    SET(LAPACK_FOUND OFF)
+    MESSAGE(STATUS "Could not find LAPACK lib. Turning LAPACK_FOUND off")
+ENDIF()
+
+IF (LAPACK_FOUND)
+  IF (NOT LAPACK_FIND_QUIETLY)
+    MESSAGE(STATUS "Found LAPACK libraries: ${LAPACK_LIB}")
+  ENDIF (NOT LAPACK_FIND_QUIETLY)
+ELSE (LAPACK_FOUND)
+  IF (LAPACK_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "Could not find LAPACK")
+  ENDIF (LAPACK_FIND_REQUIRED)
+ENDIF (LAPACK_FOUND)
+
+MARK_AS_ADVANCED(
+    LAPACK_INCLUDE_DIR
+    LAPACK_LIB
+    LAPACK
+)
+
diff --git a/cmake/Modules/FindOpenBLAS.cmake b/cmake/Modules/FindOpenBLAS.cmake
index 7c5272b7f7..150b2ad41a 100644
--- a/cmake/Modules/FindOpenBLAS.cmake
+++ b/cmake/Modules/FindOpenBLAS.cmake
@@ -49,8 +49,8 @@ SET(Open_BLAS_LIB_SEARCH_PATHS
         /usr/local/opt/openblas/lib
         ${PROJECT_SOURCE_DIR}/3rdparty/OpenBLAS/lib
         ${PROJECT_SOURCE_DIR}/thirdparty/OpenBLAS/lib
-	${OpenBLAS_DIR}
-	${OpenBLAS_DIR}/lib
+        ${OpenBLAS_DIR}
+        ${OpenBLAS_DIR}/lib
         ${OpenBLAS_HOME}
         ${OpenBLAS_HOME}/lib
  )


 

----------------------------------------------------------------
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