You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ma...@apache.org on 2019/07/18 18:07:07 UTC

[incubator-mxnet] branch conan updated: [MXNET-1229] use OpenBLAS, lapack & OpenCV from conan (#13400)

This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch conan
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/conan by this push:
     new 08a09ef  [MXNET-1229] use OpenBLAS, lapack & OpenCV from conan (#13400)
08a09ef is described below

commit 08a09efb70c80ee6234a443ee761a7dcc8627c79
Author: SSE4 <to...@gmail.com>
AuthorDate: Thu Jul 18 11:06:17 2019 -0700

    [MXNET-1229] use OpenBLAS, lapack & OpenCV from conan (#13400)
    
    * - use OpenBLAS, lapack & OpenCV from conan
    
    Signed-off-by: SSE4 <to...@gmail.com>
    
    * - add license to the conanfile.py
    
    Signed-off-by: SSE4 <to...@gmail.com>
    
    * - remove lapack (OpenBLAS provides it)
    
    * - remove lapack (OpenBLAS provides it)
    
    * - remove lapack (OpenBLAS provides it)
    
    * - add option for conan
    
    * Update CMakeLists.txt
---
 CMakeLists.txt                   |  7 +++++++
 cmake/Modules/FindOpenBLAS.cmake |  7 +++++++
 conanfile.py                     | 23 +++++++++++++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f8c33b..5fbfab8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,13 @@ mxnet_option(USE_TENSORRT         "Enable infeference optimization with TensorRT
 mxnet_option(USE_ASAN             "Enable Clang/GCC ASAN sanitizers." OFF)
 mxnet_option(ENABLE_TESTCOVERAGE  "Enable compilation with test coverage metric output" OFF)
 mxnet_option(USE_INT64_TENSOR_SIZE "Use int64_t to represent the total number of elements in a tensor" OFF)
+mxnet_option(USE_CONAN            "Enable conan.io for package management." OFF)
+
+if(USE_CONAN AND EXISTS ${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
+  include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
+  conan_basic_setup(TARGETS)
+  message(STATUS "using conan")
+endif()
 
 message(STATUS "CMAKE_CROSSCOMPILING ${CMAKE_CROSSCOMPILING}")
 message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}")
diff --git a/cmake/Modules/FindOpenBLAS.cmake b/cmake/Modules/FindOpenBLAS.cmake
index a3a79ca..1847c3c 100644
--- a/cmake/Modules/FindOpenBLAS.cmake
+++ b/cmake/Modules/FindOpenBLAS.cmake
@@ -15,6 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
+if(TARGET CONAN_PKG::openblas)
+  set(OpenBLAS_FOUND ON)
+  set(OpenBLAS_LIB CONAN_PKG::openblas)
+  set(OpenBLAS_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_OPENBLAS})
+  return()
+endif()
+
 file(TO_CMAKE_PATH "$ENV{OpenBLAS_HOME}" OpenBLAS_HOME)
 file(TO_CMAKE_PATH "$ENV{OpenBLAS}" OpenBLAS_DIR)
 
diff --git a/conanfile.py b/conanfile.py
new file mode 100644
index 0000000..de23e4c
--- /dev/null
+++ b/conanfile.py
@@ -0,0 +1,23 @@
+# 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.
+
+from conans import ConanFile
+
+class IncubatorMXNetConan(ConanFile):
+    settings = "os", "compiler", "build_type", "arch"
+    requires = "openblas/0.2.20@conan/stable", "opencv/3.4.3@conan/stable"
+    generators = ["cmake"]