singa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhaoj...@apache.org
Subject [19/50] [abbrv] incubator-singa git commit: SINGA-185 Add CBLAS and GLOG detection for singav1
Date Mon, 13 Jun 2016 13:20:12 GMT
SINGA-185 Add CBLAS and GLOG detection for singav1

Add cblas and glog detection. USE_CBLAS is ON as a default setting.


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/c6ae7861
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/c6ae7861
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/c6ae7861

Branch: refs/heads/master
Commit: c6ae7861afd6c65846ed0497cf94fb277e5f4897
Parents: 870d1a9
Author: xiezl <xiezhongle@comp.nus.edu.sg>
Authored: Mon May 30 14:17:41 2016 +0800
Committer: xiezl <xiezhongle@comp.nus.edu.sg>
Committed: Mon May 30 14:17:41 2016 +0800

----------------------------------------------------------------------
 CMakeLists.txt                   |  2 +-
 cmake/Cuda.cmake                 |  2 +-
 cmake/Dependencies.cmake         | 16 ++++++++++++++--
 cmake/Thirdparty/FindCBLAS.cmake | 11 +++++++++++
 cmake/Thirdparty/FindGlog.cmake  | 11 +++++++++++
 cmake/Thirdparty/FindLMDB.cmake  |  2 +-
 6 files changed, 39 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c6ae7861/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d585497..fbe3adc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ SET(SINGA_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include;${PROJECT_BINARY_DIR}")
 INCLUDE_DIRECTORIES(${SINGA_INCLUDE_DIR})
 
 #OPTION(CPU_ONLY "use GPU libs" OFF)
-OPTION(USE_CBLAS "Use CBlas libs" OFF)
+OPTION(USE_CBLAS "Use CBlas libs" ON)
 OPTION(USE_CUDA "Use Cuda libs" ON)
 OPTION(USE_CUDNN "Use Cudnn libs" ON)
 OPTION(USE_OPENCV "Use opencv" OFF)

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c6ae7861/cmake/Cuda.cmake
----------------------------------------------------------------------
diff --git a/cmake/Cuda.cmake b/cmake/Cuda.cmake
index 4985bb8..a74c82b 100644
--- a/cmake/Cuda.cmake
+++ b/cmake/Cuda.cmake
@@ -22,4 +22,4 @@ ENDIF()
 
 INCLUDE_DIRECTORIES(SYSTEM ${CUDA_INCLUDE_DIRS})
 LIST(APPEND SINGA_LINKER_LIBS ${CUDA_CUDART_LIBRARY} ${CUDA_curand_LIBRARY} ${CUDA_CUBLAS_LIBRARIES})
-MESSAGE(STATUS "libs " ${SINGA_LINKER_LIBS})
+#MESSAGE(STATUS "libs " ${SINGA_LINKER_LIBS})

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c6ae7861/cmake/Dependencies.cmake
----------------------------------------------------------------------
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index e995553..5505ad6 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -1,11 +1,12 @@
-SET(Singa_LINKER_LIBS "")
+SET(SINGA_LINKER_LIBS "")
 
 INCLUDE("cmake/ProtoBuf.cmake")
 
 IF(USE_LMDB)
     FIND_PACKAGE(LMDB REQUIRED)
     INCLUDE_DIRECTORIES(SYSTEM ${LMDB_INCLUDE_DIR})
-    LIST(APPEND Singa_LINKER_LIBS ${LMDB_LIBRARIES})
+    LIST(APPEND SINGA_LINKER_LIBS ${LMDB_LIBRARIES})
+    MESSAGE(STATUS "FOUND lmdb at ${LMDB_INCLUDE_DIR}")
 ENDIF()
 
 IF(NOT CPU_ONLY)
@@ -15,6 +16,17 @@ ELSE()
     SET(USE_CUDNN FALSE)
 ENDIF()
 
+IF(USE_CBLAS)
+    FIND_PACKAGE(CBLAS REQUIRED)
+    INCLUDE_DIRECTORIES(SYSTEM ${CBLAS_INCLUDE_DIR})
+    LIST(APPEND SINGA_LINKER_LIBS ${CBLAS_LIBRARIES})
+    MESSAGE(STATUS "FOUND cblas at ${CBLAS_LIBRARIES}")
+ENDIF()
+
+FIND_PACKAGE(Glog REQUIRED)
+INCLUDE_DIRECTORIES(SYSTEM ${GLOG_INCLUDE_DIRS})
+LIST(APPEND SINGA_LINKER_LIBS ${GLOG_LIBRARIES})
+#MESSAGE(STATUS "Found glog at ${GLOG_INCLUDE_DIRS}")
 
 #LIST(APPEND SINGA_LINKER_LIBS "/home/wangwei/local/lib/libopenblas.so")
 #MESSAGE(STATUS "link lib : " ${SINGA_LINKER_LIBS})

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c6ae7861/cmake/Thirdparty/FindCBLAS.cmake
----------------------------------------------------------------------
diff --git a/cmake/Thirdparty/FindCBLAS.cmake b/cmake/Thirdparty/FindCBLAS.cmake
new file mode 100644
index 0000000..413d1c1
--- /dev/null
+++ b/cmake/Thirdparty/FindCBLAS.cmake
@@ -0,0 +1,11 @@
+
+FIND_PATH(CBLAS_INCLUDE_DIR NAMES cblas.h PATHS "$ENV{CBLAS_DIR}/include")
+FIND_LIBRARY(CBLAS_LIBRARIES NAMES openblas PATHS "$ENV{CBLAS_DIR}/lib")
+
+INCLUDE(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CBLAS DEFAULT_MSG CBLAS_INCLUDE_DIR CBLAS_LIBRARIES)
+
+IF(CBLAS_FOUND)
+    #    MESSAGE(STATUS "Found cblas at ${CBLAS_INCLUDE_DIR}")
+    MARK_AS_ADVANCED(CBLAS_INCLUDE_DIR CBLAS_LIBRARIES)
+ENDIF()

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c6ae7861/cmake/Thirdparty/FindGlog.cmake
----------------------------------------------------------------------
diff --git a/cmake/Thirdparty/FindGlog.cmake b/cmake/Thirdparty/FindGlog.cmake
new file mode 100644
index 0000000..c0fdf83
--- /dev/null
+++ b/cmake/Thirdparty/FindGlog.cmake
@@ -0,0 +1,11 @@
+
+FIND_PATH(GLOG_INCLUDE_DIR NAMES glog/logging.h PATHS "$ENV{GLOG_DIR}/include")
+FIND_LIBRARY(GLOG_LIBRARIES NAMES glog)
+
+INCLUDE(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_INCLUDE_DIR GLOG_LIBRARIES)
+
+IF(GLOG_FOUND)
+    #    MESSAGE(STATUS "Found glog at ${GLOG_INCLUDE_DIR}")
+    MARK_AS_ADVANCED(GLOG_INCLUDE_DIR GLOG_LIBRARIES)
+ENDIF()

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c6ae7861/cmake/Thirdparty/FindLMDB.cmake
----------------------------------------------------------------------
diff --git a/cmake/Thirdparty/FindLMDB.cmake b/cmake/Thirdparty/FindLMDB.cmake
index c402d99..cf45e00 100644
--- a/cmake/Thirdparty/FindLMDB.cmake
+++ b/cmake/Thirdparty/FindLMDB.cmake
@@ -6,7 +6,7 @@ INCLUDE(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(LMDB DEFAULT_MSG LMDB_INCLUDE_DIR LMDB_LIBRARIES)
 
 IF(LMDB_FOUND)
-    MESSAGE(STATUS "Found lmdb at $ENV{LMDB_DIR}")
+    MESSAGE(STATUS "Found lmdb at ${LMDB_INCLUDE_DIR}")
     MARK_AS_ADVANCED(LMDB_INCLUDE_DIR LMDB_LIBRARIES)
     
 ENDIF()


Mime
View raw message