[Documentation] Update install instructions
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 17 Jan 2019 16:24:04 +0000 (14:24 -0200)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Thu, 24 Jan 2019 02:40:20 +0000 (11:40 +0900)
In order to install it on Debian, it is needed first to get
the ssat and tensorflow packages.

Add instructions about how to do that.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Documentation/getting-started.md

index 87f70d7..6bb50a3 100644 (file)
@@ -7,26 +7,82 @@ The following dependencies are needed to compile/build/run.
 * glib 2.0
 * meson >= 0.40
 
+### Install via PPA repository (Debian/Ubuntu)
+
+The nnstreamer releases are at a PPA repository. In order to install it, use:
+
+```bash
+$ sudo apt-add-repository ppa:nnstreamer
+$ sudo apt install nnstreamer
+```
+
 ### Linux Self-Hosted Build
 
-**Approach 1.** Build with debian tools
+**Approach 1.** Build with Debian/Ubuntu tools
+
+***Clone the needed repositories***
 
-* How to use mk-build-deps
 ```bash
-$ mk-build-deps --install debian/control
-$ dpkg -i nnstreamer-build-deps_2018.6.16_all.deb
+$ git clone https://github.com/myungjoo/SSAT ssat
+$ git clone https://git.tizen.org/cgit/platform/upstream/tensorflow
+$ git clone https://github.com/nnsuite/nnstreamer
 ```
-Note that the version name may change. Please check your local directory after excecuting ```mk-build-deps```.
 
-* How to use debuild
+***Fix tensorflow for it to build properly***
+
+There is a shell script call at tensorflow/contrib/lite/Makefile that may
+fail, depending on the shell you're using. The best is to replace
+the ARCH detection macro (it is named renamed to HOST_ARCH on tensorflow
+upstream) from:
+
+```makefile
+ARCH := $(shell if [[ $(shell uname -m) =~ i[345678]86 ]]; then echo x86_32; else echo $(shell uname -m); fi)
+```
+
+to:
+
+```makefile
+ARCH := $(shell uname -m | sed -e 's/i[3-8]86/x86_32/')
+```
+
+***Build .deb packages***
+
+Installing required depencencies:
+
 ```bash
-$ export DEB_BUILD_OPTIONS="parallel=8"
-$ time debuild -us -uc
-$ export DEB_BUILD_OPTIONS=""
+$ for i in ssat tensorflow nnstreamer; do \
+  (cd $i && sudo mk-build-deps --install debian/control && sudo dpkg -i *.deb || break); \
+  done
 ```
+
+Creating the .deb packages:
+
+```bash
+$ export DEB_BUILD_OPTIONS="parallel=$(($(cat /proc/cpuinfo |grep processor|wc -l) + 1))"
+$ for i in ssat tensorflow nnstreamer; do \
+  (cd $i && time debuild -us -uc || break); \
+  done
+```
+
 If there is a missing package, debuild will tell you which package is missing.
 If you haven't configured debuild properly, yet, you will need to add ```-uc -us``` options to ```debuild```.
 
+***Install the generated \*.deb files***
+
+The files will be there at the parent dir. E. g. at nnbuilder/.. directory.
+
+In order to install them (should run as root):
+
+```bash
+$ sudo apt install ./ssat_*.deb ./tensorflow-lite-dev_*.deb ./tensorflow-dev_*.deb
+$ sudo apt install ./nnstreamer_0.1.0-1rc1_amd64.deb
+```
+
+If you need nnstreamer development package:
+
+```bash
+#apt install ./nnstreamer-dev_0.1.0-1rc1_amd64.deb
+```
 
 **Approach 2.** Build with meson
 * https://mesonbuild.com/Getting-meson.html