1 ------------------------------------------------------------------------
2 AGL-Unicens binding expose Unicens-V2 APIs through AGL framework
3 ------------------------------------------------------------------------
6 AFB_daemon dependency on Standard Linux Distributions
7 -------------------------------------------------------
8 # handle dependencies > (OpenSuse-42.2, Fedora-25, Ubuntu 16.04.2LTS)
10 systemd-devel (libsystemd-dev>=222)
12 file-devel(OpenSuSe) or libmagic-dev(Ubuntu)
15 ElectricFence (BUG should not be mandatory)
16 libopenssl-devel libgcrypt-devel libgnutls-devel (optional but requested by libmicrohttpd for https)
19 zypper in gcc5 gdb gcc5-c++ git make ElectricFence systemd-devel libopenssl-devel libuuid-devel alsa-devel libgcrypt-devel libgnutls-devel libjson-c-devel file-devel
21 Ubuntu >= 16.4 libuuid-devel
22 apt-get install cmake git electric-fence libsystemd-dev libssl-dev uuid-dev libasound2-dev libgcrypt20-dev libgnutls-dev libgnutls-dev libjson-c-dev libmagic-dev
24 libmicrohttpd>=0.9.54 (as today OpenSuse-42.2 or Ubuntu-.16.4 ship older versions)
25 afb-daemon from AGL Gerrit git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
28 # Might want to add following variables into ~/.bashrc
29 echo "#---------- AGL options Start ---------" >>~/.bashrc
30 echo "# Object: AGL cmake option for binder/bindings" >>~/.bashrc
31 echo "# Date: `date`" >>~/.bashrc
32 echo 'export CC=gcc-5; export CXX=g++-5' >>~/.bashrc # if using gcc5
33 echo 'export INSTALL_PREFIX=$HOME/opt' >>~/.bashrc
34 echo 'export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
35 echo 'export LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
36 echo 'export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib64/pkgconfig:$INSTALL_PREFIX/lib/pkgconfig' >>~/.bashrc
37 echo 'export PATH=$INSTALL_PREFIX/bin:$PATH' >>~/.bashrc
38 echo 'export RSYNC_TARGET=MY_TARGET_HOSTNAME' >>~/.bashrc
39 echo 'export RSYNC_PREFIX=./opt' >>~/.bashrc
41 echo "#---------- AGL options End ---------" >>~/.bashrc
44 # install LibMicroHttpd
45 wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.54.tar.gz
46 tar -xzf libmicrohttpd-0.9.54.tar.gz
47 cd libmicrohttpd-0.9.54
48 ./configure --prefix=$INSTALL_PREFIX
52 # retrieve last AFB_daemon from AGL
53 git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
55 # Warning: previous GCC options should be set before initial cmake (clean Build/*)
56 cd app-framework-binder; mkdir build; cd build
57 cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
66 source ~/.bashrc # or any other file where your have place your compilation preferences
69 cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
72 afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs --token="" --verbose
74 speaker-test -twav -D hw:ep01 -c 2
75 firefox http://localhost:1234
78 # Local Source Debug with GDB
80 Warning: technically AGL bindings are shared libraries loaded thought 'dlopen'. GDB supports source debug of dynamically
81 loaded libraries, but user should be warn that the actual path to sharelib symbols is directly inherited from DLOPEN.
82 As a result if you change your directory after binder start with --workdir=xxx then GDB will not find symbols anymore
88 # WORK when running in direct
89 afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs
91 # FAIL when using GDB with warning: Could not load shared library ....
92 gdb -args afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs
94 warning: Could not load shared library symbols for ./build/ucs2-afb/afb-ucs2.so.
95 Do you need "set solib-search-path" or "set sysroot"?
99 To debug sharelib symbol path: start your binder under GDB. Then break your session after the binder has
100 loaded its bindings. Finally use "info sharedlibrary" and check 'SymsRead'. If equal to 'No' then either you start GDB
101 from the wrong relative directory, either you have to use 'set solib-search-path' to force the path.
104 gdb -args afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs
107 NOTICE: API unicens added
108 NOTICE: Waiting port=1234 rootdir=.
109 NOTICE: Browser URL= http://localhost:1234
110 (hit Ctrl-C to break the execution)
111 info sharedlibrary afb-*
115 # Running an debugging on a target
118 export RSYNC_TARGET=root@xx.xx.xx.xx
119 export RSYNC_PREFIX=/opt # WARNING: installation directory should exist
124 cmake -DRSYNC_TARGET=$RSYNC_TARGET -DRSYNC_PREFIX=$RSYNC_PREFIX ..
125 make remote-target-populate
127 ./build/target/start-${RSYNC_TARGET}.sh
128 firefox http://localhost:1234 # WARNING: do not forget firewall if any
130 ssh -tt ${RSYNC_TARGET} speaker-test -twav -D hw:ep01 -c 2
133 Note: remote-target-populate will
134 - create a script to remotely start the binder on the target in ./build/target/start-on-target-name.sh
135 - create a gdbinit file to transparently debug remotely in source code with gdb -x ./build/target/gdb-on-target-name.ini
136 - to run and debug directly from your IDE just configure the run and debug properties with the corresponding filename