You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2016/10/10 15:46:09 UTC

[3/8] incubator-singa git commit: SINGA-247 Add windows support for singa

SINGA-247 Add windows support for singa

Update instructions.


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

Branch: refs/heads/master
Commit: 8531af5723cbc917af9f6378178fea39fb258f95
Parents: 6c9e0b4
Author: xiezl <xi...@comp.nus.edu.sg>
Authored: Fri Sep 23 23:51:26 2016 +0800
Committer: Wei Wang <wa...@comp.nus.edu.sg>
Committed: Mon Oct 10 17:44:53 2016 +0800

----------------------------------------------------------------------
 cmake/Dependencies.cmake    |  1 +
 doc/en/docs/dependencies.md | 79 ++++++++++++++++++++++++++++++++++++++++
 doc/en/docs/installation.md | 13 ++++---
 src/CMakeLists.txt          |  1 -
 4 files changed, 87 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8531af57/cmake/Dependencies.cmake
----------------------------------------------------------------------
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 5f3d6a7..d9dbae7 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -31,6 +31,7 @@ IF(GLOG_FOUND)
     MESSAGE(STATUS "GLOG FOUND at ${GLOG_INCLUDE_DIR}")
     ADD_DEFINITIONS("-DUSE_GLOG")
     LIST(APPEND SINGA_LINKER_LIBS ${GLOG_LIBRARIES})
+	INCLUDE_DIRECTORIES(${GLOG_INCLUDE_DIR})
 ENDIF()
 
 IF(USE_LMDB)

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8531af57/doc/en/docs/dependencies.md
----------------------------------------------------------------------
diff --git a/doc/en/docs/dependencies.md b/doc/en/docs/dependencies.md
new file mode 100644
index 0000000..d7da27d
--- /dev/null
+++ b/doc/en/docs/dependencies.md
@@ -0,0 +1,79 @@
+# Dependent library installation
+
+## Windows
+
+This section is used to compile and install the dependent libraries under
+windows system from source codes. The ONLY compiler used is Visual Studio 2015.
+If you intend to generate a 32-bit/64-bit singa solution, please configure all the
+VS projects for the dependent libraries as 32-bit/64-bit. This can be done by
+"Configuration Manager" in VS 2015 or use coresponding generator in cmake. When compiling the following libraries, you
+may get system-specific warnings/errors. Please fix them according to the
+prompts by VS.
+
+### Google Logging
+
+The glog library is an optional library for singa project. But it is needed for
+protobuf check on cmake. Since the latest release version of glog will encounter error C2084 on sprintf function
+under VS2015, we test the compilation and installation with the
+latest codes of glog. The code is from [git](https://github.com/google/glog). 
+
+Step 1: Download and decompress the source code. Or use `git clone
+https://github.com/google/glog` to get the code.
+
+Step 2: Open "glog.sln" file under project folder. You will get a conversion
+dialog and please finish it by the prompts. Compile all the projects in the solution after
+proper configuration, especially "libglog" and "libglog_static" projects. 
+
+Step 3: Copy all the header files and the entire directory named "glog" under
+"src\windows\" folder into the installation include folder (or system folder).
+Copy all the generated library files into the installation library folder (or
+system folder).
+
+Step 4: Done.
+
+### Google protobuf 
+
+Tested on version 2.6.1:
+
+Step 1: Download and decompress the source code.
+
+Step 2: Open "protobuf.sln" file under "vsprojects" folder. You will get a conversion
+dialog and please finish it by the prompts. Compile all the projects in the solution after proper
+configuration. Especially "libprotobuf", "libprotobuf-lite", "libprotoc" and
+"protoc" projects.
+
+Step 3: Run "extract_includes.bat" script under "vsprojects" folder, you will
+get a new "include" folder with all the headers.
+
+Step 4: Copy the library files, such as "libprotobuf.lib",
+"libprotobuf-lite.lib", "libprotoc.lib", etc., into your installation library folder (or
+system folder). Copy the binary file "protoc" into your installation binary
+folder (or system folder). Copy all the headers and folders in "include" folder into your
+installation include foder (or system folder).
+
+Step 5: Done.
+
+### CBLAS
+
+There are ready-to-use binary packages online
+([link](https://sourceforge.net/projects/openblas/files/). However, we still install
+OpenBLAS with version 0.2.18 as test:
+
+Step 1: Download and decompress the source code.
+
+Step 2: Start a cmd window under the OpenBLAS folder then run the following
+commands to generate the solution: 
+
+    $ md build $$ cd build
+    $ cmake -G "Visual Studio 14" ..
+
+Or run `cmake -G "Visual Studio 14 Win64"` as you wish.
+
+Step 3: Install Perl into your system and put perl.exe on your path. Open "OpenBlas.sln" and build the solution, especially "libopenblas"
+project.
+
+Step 4: Copy the library files under "build\lib" folder and all header files
+under OpenBLAS folder into installation library and include folders (or system
+folders).
+
+Step 5: Done.

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8531af57/doc/en/docs/installation.md
----------------------------------------------------------------------
diff --git a/doc/en/docs/installation.md b/doc/en/docs/installation.md
index a797c57..47aa245 100755
--- a/doc/en/docs/installation.md
+++ b/doc/en/docs/installation.md
@@ -216,16 +216,16 @@ To build SINGA with OpenCL support, you need to pass the flag during cmake:
 
 ### Windows
 
-The compiler used for windows can ONLY be Visual Studio 2015 as some c++11
+The ONLY compiler used for windows is Visual Studio 2015 as some c++11
 features (Generic lambdas, auto, non-static data member intitializers, etc.)
-followed by singa are only supported in this version (Details can be found
+followed by singa are only supported in this version (details can be found
 [here](https://msdn.microsoft.com/en-us/library/hh567368.aspx)). 
 
 For the dependent library installation, please refer to
-[Dependencies](doc/en/docs/dependencies.md).
+[Dependencies](dependencies.md).
 After all the
 dependencies are successfully installed, just run the following commands to
-generate the VS project in cmd under singa folder:
+generate the VS solution in cmd under singa folder:
 
     $ md build && cd build
     $ cmake -G "Visual Studio 14" -DUSE_CUDA=OFF -DUSE_PYTHON=OFF .. 
@@ -251,8 +251,9 @@ can run the following command:
 
     $ cmake -LAH
 
-After generating the VS project, please open the "singa.sln" project file under
-the "build" folder and compile it via a normal VS project. You will find the
+If you use cmake GUI tool in windows, please make sure you configure the right
+parameters for the singa solution by select "Advanced" box. After generating the VS project, please open the "singa.sln" project file under
+the "build" folder and compile it as a normal VS solution. You will find the
 unit tests file named "test_singa" in the project binary folder.
 
 ## FAQ

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8531af57/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7493ffb..ce3e792 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -17,7 +17,6 @@
 #
 
 # generate protobuf sources
-
 FILE(GLOB proto_files proto/*.proto)
 protobuf_generate_cpp(proto_srcs proto_hdrs ${proto_files})
 #MESSAGE(STATUS "proto_srcs: ${proto_srcs}")