From commits-return-2210-archive-asf-public=cust-asf.ponee.io@singa.incubator.apache.org Wed May 9 17:15:14 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 59C56180674 for ; Wed, 9 May 2018 17:15:13 +0200 (CEST) Received: (qmail 34263 invoked by uid 500); 9 May 2018 15:15:12 -0000 Mailing-List: contact commits-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list commits@singa.incubator.apache.org Received: (qmail 34254 invoked by uid 99); 9 May 2018 15:15:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2018 15:15:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 148E3C5E90 for ; Wed, 9 May 2018 15:15:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -11.699 X-Spam-Level: X-Spam-Status: No, score=-11.699 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_SHORT=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id m6UQWmrDVT4g for ; Wed, 9 May 2018 15:15:09 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id B34CC5F666 for ; Wed, 9 May 2018 15:15:08 +0000 (UTC) Received: (qmail 34151 invoked by uid 99); 9 May 2018 15:15:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2018 15:15:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E0E80E00EB; Wed, 9 May 2018 15:15:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wangwei@apache.org To: commits@singa.incubator.apache.org Date: Wed, 09 May 2018 15:15:07 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/5] incubator-singa git commit: SINGA-294 Add instructions for building on Windows Repository: incubator-singa Updated Branches: refs/heads/master 9696255e4 -> 0407efbd4 SINGA-294 Add instructions for building on Windows Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/30ad60d1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/30ad60d1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/30ad60d1 Branch: refs/heads/master Commit: 30ad60d1ca5453d9c5b69b3cbe83408a3ed9e7ab Parents: fb7b0d3 Author: Moaz Reyad Authored: Sun May 6 13:29:21 2018 +0800 Committer: Moaz Reyad Committed: Sun May 6 13:29:21 2018 +0800 ---------------------------------------------------------------------- doc/en/docs/install_macos1013.rst | 18 ++++ doc/en/docs/install_win.rst | 178 +++++++++++++++++++++++++++++++++ doc/en/docs/installation.md | 2 + 3 files changed, 198 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/30ad60d1/doc/en/docs/install_macos1013.rst ---------------------------------------------------------------------- diff --git a/doc/en/docs/install_macos1013.rst b/doc/en/docs/install_macos1013.rst index 457b83d..9cc9ad1 100644 --- a/doc/en/docs/install_macos1013.rst +++ b/doc/en/docs/install_macos1013.rst @@ -1,3 +1,21 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + Installing SINGA on macOS 13.10 =============================== http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/30ad60d1/doc/en/docs/install_win.rst ---------------------------------------------------------------------- diff --git a/doc/en/docs/install_win.rst b/doc/en/docs/install_win.rst new file mode 100644 index 0000000..e957336 --- /dev/null +++ b/doc/en/docs/install_win.rst @@ -0,0 +1,178 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + +Building SINGA on Windows +========================= + +The process of building SINGA from source on Microsoft Windows has three parts: install dependencies, build SINGA source, and (optionally) install the python module. + +1. Install Dependencies +---------------------- + +You may create a folder for building the dependencies. + +The dependencies are: + +* Compiler and IDE + * Visual Studio. The community edition is free and can be used to build SINGA. https://www.visualstudio.com/ +* CMake + * Can be downloaded from http://cmake.org/ + * Make sure the path to cmake executable is in the system path, or use full path when calling cmake. +* SWIG + * Can be downloaded from http://swig.org/ + * Make sure the path to swig executable is in the system path, or use full path when calling swig. Use a recent version such as 3.0.12. + +* Protocol Buffers + * Download a suitable version such as 2.6.1: https://github.com/google/protobuf/releases/tag/v2.6.1 . + * Download both protobuf-2.6.1.zip and protoc-2.6.1-win32.zip . + * Extract both of them in dependecies folder. Add the path to protoc executable to the system path, or use full path when calling it. + * Open the Visual Studio solution which can be found in vsproject folder. + * Change the build settings to Release and x64. + * build libprotobuf project. +* Openblas + * Download a suitable source version such as 0.2.20 from http://www.openblas.net + * Extract the source in the dependecies folder. + * If you don't have Perl installed, download a perl environment such as Strawberry Perl (http://strawberryperl.com/) + * Build the Visual Studio solution by running this command in the source folder: + + .. code-block:: bash + + cmake -G "Visual Studio 15 2017 Win64" + + * Open the Visual Studio solution and change the build settings to Release and x64. + * Build libopenblas project + +* Google glog + * Download a suitable version such as 0.3.5 from https://github.com/google/glog/releases + * Extract the source in the dependencies folder. + * Open the Visual Studio solution. + * Change the build settings to Release and x64. + * Build libglog project + +2. Build SINGA source +--------------------- + +* Download SINGA source code +* Compile the protobuf files: + * Goto src/proto folder + +.. code-block:: bash + + mkdir python_out + protoc.exe *.proto --python_out python_out + +* Generate swig interfaces for C++ and Python: + Goto src/api + +.. code-block:: bash + + swig -python -c++ singa.i + +* generate Visual Studio solution for SINGA: + Goto SINGA source code root folder + +.. code-block:: bash + + mkdir build + cd build + +* Call cmake and add the paths in your system similar to the following example: + +.. code-block:: bash + + cmake -G "Visual Studio 15 2017 Win64" ^ + -DGLOG_INCLUDE_DIR="D:/WinSinga/dependencies/glog-0.3.5/src/windows" ^ + -DGLOG_LIBRARIES="D:/WinSinga/dependencies/glog-0.3.5/x64/Release" ^ + -DCBLAS_INCLUDE_DIR="D:/WinSinga/dependencies/openblas-0.2.20/lapack-netlib/CBLAS/include" ^ + -DCBLAS_LIBRARIES="D:/WinSinga/dependencies/openblas-0.2.20/lib/RELEASE" ^ + -DProtobuf_INCLUDE_DIR="D:/WinSinga/dependencies/protobuf-2.6.1/src" ^ + -DProtobuf_LIBRARIES="D:/WinSinga/dependencies/protobuf-2.6.1/vsprojects/x64/Release" ^ + -DProtobuf_PROTOC_EXECUTABLE="D:/WinSinga/dependencies/protoc-2.6.1-win32/protoc.exe" ^ + .. + +* Open the generated solution in Visual Studio +* Change the build settings to Release and x64 +* Add the singa_wrap.cxx file from src/api to the singa_objects project +* In the singa_objects project, open Additional Include Directories. +* Add Python include path +* Add numpy include path +* Add protobuf include path +* In the preprocessor definitions of the singa_objects project, add USE_GLOG +* Build singa_objects project + +* In singa project: + * add singa_wrap.obj to Object Libraries + * change target name to _singa_wrap + * change target extension to .pyd + * change configuration type to Dynamic Library (.dll) + * goto Additional Library Directories and add the path to python, openblas, protobuf and glog libraries + * goto Additional Dependencies and add libopenblas.lib, libglog.lib and libprotobuf.lib + +* build singa project + + +3. Install Python module +------------------------ + +* Change _singa_wrap.so to _singa_wrap.pyd in build/python/setup.py +* Copy the files in src/proto/python_out to build/python/singa/proto + +* Optionally create and activate a virtual environment: + +.. code-block:: bash + + mkdir SingaEnv + virtualenv SingaEnv + SingaEnv\Scripts\activate + +* goto build/python folder and run: + +.. code-block:: bash + + python setup.py install + +* Make _singa_wrap.pyd, libglog.dll and libopenblas.dll available by adding them to the path or by copying them to singa package folder in the python site-packages + +* Verify that SINGA is installed by running: + +.. code-block:: bash + + python -c "from singa import tensor" + +A video tutorial for the build process can be found here: + + +.. |video| image:: https://img.youtube.com/vi/cteER7WeiGk/0.jpg + :scale: 100% + :align: middle + :target: https://www.youtube.com/watch?v=cteER7WeiGk + ++---------+ +| |video| | ++---------+ + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/30ad60d1/doc/en/docs/installation.md ---------------------------------------------------------------------- diff --git a/doc/en/docs/installation.md b/doc/en/docs/installation.md index dd5e961..18eb239 100755 --- a/doc/en/docs/installation.md +++ b/doc/en/docs/installation.md @@ -310,6 +310,8 @@ unit tests file named "test_singa" in the project binary folder. If you get errors when running test_singa.exe due to libglog.dll/libopenblas.dll missing, just copy the dll files into the same folder as test_singa.exe +Instructions for building on Windows with Python support can be found [here](install_win.html). + ## FAQ * Q: Error from 'import singa' using PySINGA installed from wheel.