Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.3k
Singa 255 Compile mandatory depedent libaries together with SINGA code#272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
932a0cda98446f47e38c8f2c0b844826d40File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +0,0 @@ | ||
| [submodule "lib/cnmem"] | ||
| path = lib/cnmem | ||
| url = https://github.com/NVIDIA/cnmem.git | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -18,59 +18,94 @@ | ||
| SET(SINGA_LINKER_LIBS "") | ||
| #INCLUDE("cmake/ProtoBuf.cmake") | ||
| IF(USE_MODULES) | ||
| #IF(USE_SHARED_LIBS) | ||
| # include(FindProtobuf) | ||
| # SET(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib") | ||
| # link_directories(${CMAKE_BINARY_DIR}/lib) | ||
| # SET(PROTOBUF_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") | ||
| # SET(PROTOBUF_LIBRARY "${CMAKE_BINARY_DIR}/lib/libprotobuf.so") | ||
| # SET(PROTOBUF_PROTOC_LIBRARY "${CMAKE_BINARY_DIR}/lib/libprotoc.so") | ||
| # SET(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_BINARY_DIR}/bin/protoc") | ||
| # INCLUDE_DIRECTORIES(SYSTEM ${PROTOBUF_INCLUDE_DIR}) | ||
| # LIST(APPEND SINGA_LINKER_LIBS ${PROTOBUF_LIBRARY}) | ||
| # #IF(USE_CBLAS) | ||
| # SET(CBLAS_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") | ||
| # SET(CBLAS_LIBRARIES "${CMAKE_BINARY_DIR}/lib/libopenblas.so") | ||
| # INCLUDE_DIRECTORIES(SYSTEM ${CBLAS_INCLUDE_DIR}) | ||
| # LIST(APPEND SINGA_LINKER_LIBS ${CBLAS_LIBRARIES}) | ||
| #ENDIF() | ||
| #ELSE() | ||
| include(FindProtobuf) | ||
| SET(PROTOBUF_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") | ||
| SET(PROTOBUF_LIBRARY "${CMAKE_BINARY_DIR}/lib/libprotobuf.a") | ||
| SET(PROTOBUF_PROTOC_LIBRARY "${CMAKE_BINARY_DIR}/lib/libprotobuf.a") | ||
| SET(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_BINARY_DIR}/bin/protoc") | ||
| INCLUDE_DIRECTORIES(SYSTEM ${PROTOBUF_INCLUDE_DIR}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${PROTOBUF_LIBRARY}) | ||
| #IF(USE_CBLAS) | ||
| SET(CBLAS_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") | ||
| SET(CBLAS_LIBRARIES "${CMAKE_BINARY_DIR}/lib/libopenblas.a") | ||
| INCLUDE_DIRECTORIES(SYSTEM ${CBLAS_INCLUDE_DIR}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${CBLAS_LIBRARIES}) | ||
| #ENDIF() | ||
| #ENDIF() | ||
| ELSE() | ||
| FIND_PACKAGE( Protobuf REQUIRED ) | ||
| #MESSAGE(STATUS "proto libs " ${PROTOBUF_LIBRARY}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${PROTOBUF_LIBRARY}) | ||
| #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() | ||
| ENDIF() | ||
| FIND_PACKAGE( Protobuf REQUIRED ) | ||
| INCLUDE_DIRECTORIES(SYSTEM ${PROTOBUF_INCLUDE_DIR}) | ||
| MESSAGE(STATUS "proto libs " ${PROTOBUF_LIBRARIES}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${PROTOBUF_LIBRARIES}) | ||
| #INCLUDE("cmake/ProtoBuf.cmake") | ||
| #INCLUDE("cmake/Protobuf.cmake") | ||
| FIND_PACKAGE(Glog) | ||
| IF(GLOG_FOUND) | ||
| MESSAGE(STATUS "GLOG FOUND at ${GLOG_INCLUDE_DIR}") | ||
| #MESSAGE(STATUS "GLOG FOUND at ${GLOG_INCLUDE_DIR}") | ||
| ADD_DEFINITIONS("-DUSE_GLOG") | ||
| LIST(APPEND SINGA_LINKER_LIBS ${GLOG_LIBRARIES}) | ||
| INCLUDE_DIRECTORIES(${GLOG_INCLUDE_DIR}) | ||
| INCLUDE_DIRECTORIES(${GLOG_INCLUDE_DIR}) | ||
| ENDIF() | ||
| IF(USE_LMDB) | ||
| FIND_PACKAGE(LMDB REQUIRED) | ||
| INCLUDE_DIRECTORIES(SYSTEM ${LMDB_INCLUDE_DIR}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${LMDB_LIBRARIES}) | ||
| MESSAGE(STATUS "FOUND lmdb at ${LMDB_INCLUDE_DIR}") | ||
| #MESSAGE(STATUS "FOUND lmdb at ${LMDB_INCLUDE_DIR}") | ||
| ENDIF() | ||
| IF(USE_CUDA) | ||
| INCLUDE("cmake/Cuda.cmake") | ||
| SET(CNMEM_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please also compile cnmem into .a? | ||
| SET(CNMEM_LIBRARY "${CMAKE_BINARY_DIR}/lib/libcnmem.a") | ||
| LIST(APPEND SINGA_LINKER_LIBS ${CNMEM_LIBRARY}) | ||
| 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() | ||
| IF(USE_OPENCL) | ||
| FIND_PACKAGE(OpenCL REQUIRED) | ||
| IF(NOT OpenCL_FOUND) | ||
| MESSAGE(SEND_ERROR "OpenCL was requested, but not found.") | ||
| ELSE() | ||
| MESSAGE(STATUS "Found OpenCL headers at ${OpenCL_INCLUDE_DIRS}") | ||
| INCLUDE_DIRECTORIES(SYSTEM ${OpenCL_INCLUDE_DIR}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${OpenCL_LIBRARIES}) | ||
| FIND_PACKAGE(ViennaCL REQUIRED) | ||
| IF(NOT ViennaCL_FOUND) | ||
| MESSAGE(SEND_ERROR "ViennaCL is required if OpenCL is enabled.") | ||
| ELSE() | ||
| MESSAGE(STATUS "Found ViennaCL headers at ${ViennaCL_INCLUDE_DIR}") | ||
| INCLUDE_DIRECTORIES(SYSTEM ${ViennaCL_INCLUDE_DIR}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${ViennaCL_LIBRARIES}) | ||
| ENDIF() | ||
| ENDIF() | ||
| #MESSAGE(STATUS "Found OpenCL headers at ${OpenCL_INCLUDE_DIRS}") | ||
| INCLUDE_DIRECTORIES(SYSTEM ${OpenCL_INCLUDE_DIR}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${OpenCL_LIBRARIES}) | ||
| FIND_PACKAGE(ViennaCL REQUIRED) | ||
| IF(NOT ViennaCL_FOUND) | ||
| MESSAGE(SEND_ERROR "ViennaCL is required if OpenCL is enabled.") | ||
| ELSE() | ||
| #MESSAGE(STATUS "Found ViennaCL headers at ${ViennaCL_INCLUDE_DIR}") | ||
| INCLUDE_DIRECTORIES(SYSTEM ${ViennaCL_INCLUDE_DIR}) | ||
| LIST(APPEND SINGA_LINKER_LIBS ${ViennaCL_LIBRARIES}) | ||
| ENDIF() | ||
| ENDIF() | ||
| ENDIF() | ||
| #FIND_PACKAGE(Glog REQUIRED) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -95,6 +95,7 @@ ADD_DEPENDENCIES(singa_objects copy_protobuf) | ||
| IF(UNIX OR APPLE) | ||
| ADD_LIBRARY(singa SHARED $<TARGET_OBJECTS:singa_objects> ${cuda_objs}) | ||
| TARGET_LINK_LIBRARIES(singa ${SINGA_LINKER_LIBS}) | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need to add the dependent libs? | ||
| SET_TARGET_PROPERTIES(singa PROPERTIES LINK_FLAGS "") | ||
| ENDIF() | ||
| #pass configure infor to swig | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. USE_CBLAS would always be ON. If we remove it, then we need to remove other places using USE_CBLAS