[ini] Update INI configuration
[platform/core/ml/nntrainer.git] / docs / how-to-run-examples.md
1 # How to run examples
2
3 ## Preparing NNTrainer for execution
4
5 ### Use PPA
6
7 If you don't want to build build binaries, you can directly download from PPA with daily releases.
8
9 ```bash
10 sudo add-apt-repository ppa:nnstreamer/ppa
11 sudo apt-get update
12 sudo apt-get install nntrainer
13 ```
14
15 Note that this may install Tensorflow-Lite packaged by us.
16
17 ## Build examples (Ubuntu 18.04)
18
19 Refer <https://github.com/nnstreamer/nntrainer/blob/master/docs/getting-started.md> for more info.
20
21 Install related packages before building nntrainer and examples.
22
23 1. gcc/g++ >=4.9 ( std=c++14 is used )
24 2. meson >= 0.50
25 3. libopenblas-dev and base
26 4. tensorflow-lite >=1.14.0
27 5. libiniparser
28 6. libjsoncpp >=0.6.0 ( if you wand to use open AI )
29 7. libcurl3 >=7.47 ( if you wand to use open AI )
30 8. libgtest ( for testing )
31
32 Important build options (meson)
33
34 1. enable-tizen : default false, add option for tizen build (-Denable-tizen=false)
35 2. enable-blas : default true, add option to enable blas (-Denable-blas=true)
36 3. enable-app : default true, add option to enable Applications (-Denable-app=true)
37 4. install-app : default true, add option to install Applications (-Dinstall-app=true)
38 5. use_gym : default false, add option to use openAI gym (-Duse_gym=false)
39 6. enable-capi : default true, add option to install C-API (-Denable-capi=true)
40 7. enable-test : default true, add option to test (-Denable-test=true)
41 8. enable-logging : default true, add option to do logging (-Denable-logging=true)
42 9. enable-tizen-feature-check : default true, add option to enable tizen feature check (-Denable-tizen-feature-check=true)
43
44 For example, to build and install NNTrainer and C-API,
45
46 ```bash
47 meson --prefix=${NNTRAINER_ROOT} --sysconfdir=${NNTRAINER_ROOT} --libdir=lib --bindir=bin --includedir=include -Denable-capi=true build
48 ```
49
50 Build source code
51
52 ```bash
53 # Set your own path to install libraries and header files
54 $ sudo vi ~/.bashrc
55
56 export NNTRAINER_ROOT=$HOME/nntrainer
57 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NNTRAINER_ROOT/lib
58 # Include NNStreamer headers and libraries
59 export C_INCLUDE_PATH=$C_INCLUDE_PATH:$NNTRAINER_ROOT/include
60 export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$NNTRAINER_ROOT/include
61 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$NNTRAINER_ROOT/lib/pkgconfig
62
63 $ source ~/.bashrc
64
65 # Download source, then compile it.
66 # Build and install nntrainer
67 $ git clone https://github.com/nnstreamer/nntrainer.git nntrainer.git
68 $ meson --prefix=${NNTRAINER_ROOT} --sysconfdir=${NNTRAINER_ROOT} --libdir=lib --bindir=bin --includedir=include build
69 $ ninja -C build install
70 $ cd ..
71 ```