SINGA-274 Create Debian packages
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/515ed0e4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/515ed0e4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/515ed0e4 Branch: refs/heads/master Commit: 515ed0e4dfe2c51eecd671ca541977abc7dd6730 Parents: 65dad40 Author: Moaz Reyad <[email protected]> Authored: Mon Dec 26 17:48:28 2016 +0800 Committer: wangwei <[email protected]> Committed: Sun Jan 8 11:07:35 2017 +0800 ---------------------------------------------------------------------- doc/en/docs/installation.md | 15 +++++ tool/debian/build.sh | 67 ++++++++++++++++++++ .../debian/singa-cpp_1.0.0_amd64/DEBIAN/control | 12 ++++ .../singa-python_1.0.0_amd64/DEBIAN/control | 15 +++++ .../singa-python_1.0.0_amd64/DEBIAN/postinst | 4 ++ .../singa-python_1.0.0_amd64/DEBIAN/postrm | 4 ++ 6 files changed, 117 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/515ed0e4/doc/en/docs/installation.md ---------------------------------------------------------------------- diff --git a/doc/en/docs/installation.md b/doc/en/docs/installation.md index 50c3884..4712ea2 100755 --- a/doc/en/docs/installation.md +++ b/doc/en/docs/installation.md @@ -1,5 +1,15 @@ # Installation +## Install with Debian packages + +Debian binary packages for Ubuntu/Debian operating systems are available: + +[SINGA-1.0.0 Python](http://www.comp.nus.edu.sg/~moaz/singa-python_1.0.0_amd64.deb) + +[SINGA-1.0.0 C++](http://www.comp.nus.edu.sg/~moaz/singa-cpp_1.0.0_amd64.deb) + +These packages are built for amd64 architecture. They provide SINGA CPU-only functions. + ## Install PySINGA PySINGA has been tested on Linux (Ubunu 14.04 and 16.04) and Mac OS (10.11). @@ -304,6 +314,11 @@ 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, please just copy the dll files into the same folder as test_singa.exe +## Build the Debian packages + + $ cd debian + $ ./build.sh + ## FAQ * Q: Error from 'import singa' using PySINGA installed from wheel. http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/515ed0e4/tool/debian/build.sh ---------------------------------------------------------------------- diff --git a/tool/debian/build.sh b/tool/debian/build.sh new file mode 100755 index 0000000..3fb4858 --- /dev/null +++ b/tool/debian/build.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# 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. + +# singa-cpp + +mkdir build +cd build +cmake ../../.. -DUSE_MODULES=ON +make +cd .. + +mkdir -p singa-cpp_1.0.0_amd64/usr/local/include +cp -r ../../include/singa singa-cpp_1.0.0_amd64/usr/local/include +cp -r build/include/singa/proto singa-cpp_1.0.0_amd64/usr/local/include/singa +cp build/include/singa/singa_config.h singa-cpp_1.0.0_amd64/usr/local/include/singa + +mkdir -p singa-cpp_1.0.0_amd64/usr/local/lib +cp build/lib/libsinga.so singa-cpp_1.0.0_amd64/usr/local/lib + +mkdir -p singa-cpp_1.0.0_amd64/usr/share/doc/singa +cp ../../LICENSE singa-cpp_1.0.0_amd64/usr/share/doc/singa/ + +dpkg -b singa-cpp_1.0.0_amd64 + +rm -rf ./build + + +# singa-python + +mkdir build +cd build +cmake ../../.. -DUSE_PYTHON=ON -DUSE_MODULES=ON +make +cd python +make +cd ../.. + +mkdir -p singa-python_1.0.0_amd64/usr/local/lib/singa/singa/ +cp -r ../../python/singa singa-python_1.0.0_amd64/usr/local/lib/singa +cp -r ../../python/rafiki singa-python_1.0.0_amd64/usr/local/lib/singa + +cp build/python/setup.py singa-python_1.0.0_amd64/usr/local/lib/singa +cp build/python/singa/singa_wrap.py singa-python_1.0.0_amd64/usr/local/lib/singa/singa +cp build/python/singa/_singa_wrap.so singa-python_1.0.0_amd64/usr/local/lib/singa/singa/ +cp -r build/python/singa/proto singa-python_1.0.0_amd64/usr/local/lib/singa/singa + +mkdir -p singa-python_1.0.0_amd64/usr/share/doc/singa +cp ../../LICENSE singa-python_1.0.0_amd64/usr/share/doc/singa/ + +dpkg -b singa-python_1.0.0_amd64 + +rm -rf ./build http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/515ed0e4/tool/debian/singa-cpp_1.0.0_amd64/DEBIAN/control ---------------------------------------------------------------------- diff --git a/tool/debian/singa-cpp_1.0.0_amd64/DEBIAN/control b/tool/debian/singa-cpp_1.0.0_amd64/DEBIAN/control new file mode 100644 index 0000000..401370a --- /dev/null +++ b/tool/debian/singa-cpp_1.0.0_amd64/DEBIAN/control @@ -0,0 +1,12 @@ +Package: Singa +Version: 1.0.0 +Architecture: amd64 +Maintainer: Moaz Reyad <[email protected]> +Depends: libgoogle-glog-dev, libprotobuf-dev, libstdc++6 , libc6 +Installed-Size: 24820 +Section: devel +Priority: optional +Source: https://github.com/apache/incubator-singa +Homepage: http://singa.apache.org +Description: Singa is an Apache Incubating project for developing an open source deep learning library. + The Singa project was initiated by the DB System Group at National University of Singapore in 2014. It focused on distributed deep learning by partitioning the model and data onto nodes in a cluster and parallelize the training. The prototype was accepted by Apache Incubator in March 2015. Four versions have been released as shown In the following table. Since V1.0, SINGA is general to support traditional machine learning models such as logistic regression. Singa's software stack includes three major components, namely, core, IO and model. The core component provides memory management and tensor operations; IO has classes for reading (and writing) data from (to) disk and network; The model component provides data structures and algorithms for machine learning models, e.g., layers for neural network models, optimizers/initializer/metric/loss for general machine learning models. http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/515ed0e4/tool/debian/singa-python_1.0.0_amd64/DEBIAN/control ---------------------------------------------------------------------- diff --git a/tool/debian/singa-python_1.0.0_amd64/DEBIAN/control b/tool/debian/singa-python_1.0.0_amd64/DEBIAN/control new file mode 100644 index 0000000..949d124 --- /dev/null +++ b/tool/debian/singa-python_1.0.0_amd64/DEBIAN/control @@ -0,0 +1,15 @@ +Package: singa-python +Version: 1.0.0 +Installed-Size: 30488 +Maintainer: Moaz Reyad <[email protected]> +Section: devel +Source: https://github.com/apache/incubator-singa +Homepage: http://singa.apache.org +Architecture: amd64 +Priority: optional +Depends: libc6, libstdc++6, libprotobuf-dev, libgoogle-glog-dev, python, libpython2.7, python-setuptools, python-numpy +Description: Singa is an Apache Incubating project for developing an open source deep learning library. + The Singa project was initiated by the DB System Group at National University of Singapore in 2014. It focused on distributed deep learning by partitioning the model and data onto nodes in a cluster and parallelize the training. The prototype was accepted by Apache Incubator in March 2015. Four versions have been released as shown In the following table. Since V1.0, SINGA is general to support traditional machine learning models such as logistic regression. Singa's software stack includes three major components, namely, core, IO and model. The core component provides memory management and tensor operations; IO has classes for reading (and writing) data from (to) disk and network; The model component provides data structures and algorithms for machine learning models, e.g., layers for neural network models, optimizers/initializer/metric/loss for general machine learning models. + + + http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/515ed0e4/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postinst ---------------------------------------------------------------------- diff --git a/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postinst b/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postinst new file mode 100755 index 0000000..7aee702 --- /dev/null +++ b/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postinst @@ -0,0 +1,4 @@ +#!/bin/bash + +cd /usr/local/lib/singa +python setup.py install http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/515ed0e4/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postrm ---------------------------------------------------------------------- diff --git a/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postrm b/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postrm new file mode 100755 index 0000000..11add34 --- /dev/null +++ b/tool/debian/singa-python_1.0.0_amd64/DEBIAN/postrm @@ -0,0 +1,4 @@ +#!/bin/bash + +cd /usr/local/lib/singa +rm -r build dist singa.egg-info
