Singa 255 Compile mandatory depedent libaries together with SINGA code#272
Singa 255 Compile mandatory depedent libaries together with SINGA code#272asfgit merged 5 commits intoapache:masterfrom
Conversation
|
If it is configured with option "BUILD_SHARED_LIBS=OFF", singa will find static libs when possible. |
There was a problem hiding this comment.
I think there are to options in terms of using building and linking dependent libs:
- COMPILE_DEPS (default is OFF), compile dependent libs into .a
- COMPILE_DEPS ->compile dependent libs into .so and .a; LINK_SHARED (default is ON), link singa with .so dependent libs.
Either one is OK.
CMakeLists.txt
Outdated
| OPTION(ENABLE_DIST "enable distributed training" OFF) | ||
| OPTION(DISABLE_WARNINGS "disable warnings under windows" ON) | ||
| OPTION(USE_MODULES "Use submodules to compile" OFF) | ||
| OPTION(BUILD_SHARED_LIBS "Use shared library" OFF) |
There was a problem hiding this comment.
use shared libs or build shared libs?
use shared libs: the dependent libs are shared libs
build shared libs: build libsinga.so
CMakeLists.txt
Outdated
| SET(global_cuda_objs "") | ||
| include(ExternalProject) | ||
| ExternalProject_Add(cnmem | ||
| GIT_REPOSITORY "https://github.com/NVIDIA/cnmem.git" |
There was a problem hiding this comment.
can we just download from a specific commit?
the master could change later, including the APIs.
CMakeLists.txt
Outdated
| BUILD_COMMAND "make" "ONLY_CBLAS=1" | ||
| INSTALL_COMMAND "make" "PREFIX=${CMAKE_BINARY_DIR}/" "install" | ||
| ) | ||
| IF(USE_CUDA) |
There was a problem hiding this comment.
duplicated? Line 77..
| @@ -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}) | |||
There was a problem hiding this comment.
no need to add the dependent libs?
| SET(USE_CUDNN FALSE) | ||
| ENDIF() | ||
|
|
||
| IF(USE_CBLAS) |
There was a problem hiding this comment.
Yes. USE_CBLAS would always be ON. If we remove it, then we need to remove other places using USE_CBLAS
Add protobuf. Add OpenBLAS. delete submodules SINGA-255 Compile mandatory depedent libaries together with SINGA code Add externalproject for singa. SINGA-255 Compile mandatory depedent libaries together with SINGA code Add USE_SHARED_LIBS option and some cmake codes.
|
|
||
| IF(USE_CUDA) | ||
| INCLUDE("cmake/Cuda.cmake") | ||
| SET(CNMEM_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") |
There was a problem hiding this comment.
could you please also compile cnmem into .a?
CMakeLists.txt
Outdated
| OPTION(USE_OPENCL "Use OpenCL" OFF) | ||
| OPTION(ENABLE_DIST "enable distributed training" OFF) | ||
| OPTION(DISABLE_WARNINGS "disable warnings under windows" ON) | ||
| OPTION(USE_MODULES "Use submodules to compile" OFF) |
There was a problem hiding this comment.
"compile dependent libs as submodules together with singa"
Change .gitmodules and default options. SINGA-255 Compile mandatory depedent libaries together with SINGA code Move cnmem to exportproject instead of git submodules.
Add git tag and remove some options.
Revise batchnorm test cases for spatial mode.
Add To-do to pass the test. SINGA-255 Compile mandatory depedent libaries together with SINGA code Fix comments and change cnmem repo address. SINGA-255 Compile mandatory depedent libaries together with SINGA code Find protobuf lib paths automatically. SINGA-255 Compile mandatory depedent libaries together with SINGA code Add protobuf 2.6.1. Remove protobuf-2.7. Make cudnn ON by default.
No description provided.