Skip to content

Singa 255 Compile mandatory depedent libaries together with SINGA code - #272

Merged
asfgit merged 5 commits into
apache:masterfrom
xiezl:SINGA-255
Oct 25, 2016
Merged

Singa 255 Compile mandatory depedent libaries together with SINGA code#272
asfgit merged 5 commits into
apache:masterfrom
xiezl:SINGA-255

Conversation

@xiezl

Copy link
Copy Markdown
Contributor

No description provided.

@xiezl

Copy link
Copy Markdown
ContributorAuthor

If it is configured with option "BUILD_SHARED_LIBS=OFF", singa will find static libs when possible.
I moved all submodules/dependent libs into external cmake projects. Hence, lib folder is gone.

@xiezlxiezl left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are to options in terms of using building and linking dependent libs:

  1. COMPILE_DEPS (default is OFF), compile dependent libs into .a
  2. COMPILE_DEPS ->compile dependent libs into .so and .a; LINK_SHARED (default is ON), link singa with .so dependent libs.
    Either one is OK.

Comment threadCMakeLists.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)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use shared libs or build shared libs?
use shared libs: the dependent libs are shared libs
build shared libs: build libsinga.so

Comment threadCMakeLists.txt Outdated
SET(global_cuda_objs "")
include(ExternalProject)
ExternalProject_Add(cnmem
GIT_REPOSITORY "https://github.com/NVIDIA/cnmem.git"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just download from a specific commit?
the master could change later, including the APIs.

Comment threadCMakeLists.txt Outdated
BUILD_COMMAND "make" "ONLY_CBLAS=1"
INSTALL_COMMAND "make" "PREFIX=${CMAKE_BINARY_DIR}/" "install"
)
IF(USE_CUDA)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated? Line 77..

Comment threadsrc/CMakeLists.txt
@@ -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})

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to add the dependent libs?

SET(USE_CUDNN FALSE)
ENDIF()

IF(USE_CBLAS)

Copy link
Copy Markdown
ContributorAuthor

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please also compile cnmem into .a?

Comment threadCMakeLists.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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"compile dependent libs as submodules together with singa"

xiezland others added 3 commits October 25, 2016 14:52
Change .gitmodules and default options.
SINGA-255 Compile mandatory depedent libaries together with SINGA code
Move cnmem to exportproject instead of git submodules.
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.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@xiezl@nudles@asfgit@ijingo