# voxl-tflite-server forward compatibility ?

Source: https://forum.modalai.com/topic/806/voxl-tflite-server-forward-compatibility
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: mpa
Posted: 2022-03-16 17:52:23 UTC by Philemon Benner
Replies: 18 · Views: 4363

## Philemon Benner · 2022-03-16 17:52:23 UTC

@Matt-Turi 
Hey, 
still working on the custom voxl-tflite-server. Is it possible to use voxl-tflite-server with modern c++ ?. I wanna integrate my own libraries in voxl-tflite-server but they are written in CXX-17. I tried to compile my third party librarys, with the given voxl-cross compilers but that didn't really work out. I also tried building tflite-server with voxl-cross native compilers, but that throwed errors about skipping tensorflow lite librarys because they are incompatible. Do you have any suggestion what i could do to get both working together on voxl?

## Reply by Guest · 2022-03-16 18:06:59 UTC

Hey @Philemon-Benner,

The gcc compiler version on voxl is 4.9 and there is no straightforward way to upgrade. In order to integrate the tflite-server with some other libraries, they would have to be generated with the same compiler, i.e. built in voxl-cross. This is why we have a collection of third party libs [here](https://gitlab.com/voxl-public/voxl-sdk/third-party), as well as why we are limited to using tensorflow v2.2.3. 

If migrating the libraries you are using to a supported c++ version is too difficult, you could use a docker image on target with the extra support you need. This would require rebuilding and running the tflite-server within the docker, but would allow use of modern c++.

## Reply by Philemon Benner · 2022-03-16 18:18:49 UTC

Thank you

## Reply by Philemon Benner · 2022-03-17 15:54:51 UTC

@Matt-Turi Ok so i got my third party librarys installed with the 865 Compiler given in voxl-cross, but i am getting an error when trying to run it on the voxl:
```
Process: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by Process)
```
i looked that up and about what i found out is that the compiler version is too old for it, i don't really know what CXXABI_1.3.11 is but the voxl only has CXXABI_1.3.10. Is the 865 toolchain for something else? And where are the differences in 820 and 865?

## Reply by Guest · 2022-03-17 16:12:02 UTC

Hey @Philemon-Benner,

The toolchain you used is a gcc-7 compiler that is included in voxl-cross is for our qrb5165 based platforms, and is a bit ahead of what is on voxl. You would need to use the gcc-4.9 toolchain, i.e. aarch64-gnu-4.9.toolchain.cmake to fix the c++ issues you are seeing.

## Reply by Philemon Benner · 2022-03-17 16:30:08 UTC

@Matt-Turi Okey but that's weird to me because in qrb5165-emulator you have a gcc-7 compiler. Libs like libuvc from voxl-uvc-server are being built with it. There i had no issues including that to the tflite-server and running it on the voxl.

## Reply by Guest · 2022-03-17 16:36:06 UTC

libuvc for voxl is built in voxl-emulator, not the qrb5165 emulator. If you check out the readme on the dev branch, you can see the separate build instructions for separate platforms.

## Reply by Philemon Benner · 2022-03-17 16:45:51 UTC

@Matt-Turi Ok yeah i see. I don't even know why i went to qrb emulator but when building the libuvc library from source in qrb emulator, it still worked for me. I have a running version of it on the Voxl, should that even be possible if it's just made for qrb5165 devices?

## Reply by Guest · 2022-03-17 16:51:54 UTC

Ah I see. libuvc is a c library, so the code is backwards compatible with gcc-4.9 and can be compiled with the newer gcc. The libs you are trying to compile are c++, so they are affected by the differences between compiler versions.

## Reply by Philemon Benner · 2022-03-17 16:56:35 UTC

@Matt-Turi Ok good to know.

## Reply by Philemon Benner · 2022-03-17 16:58:50 UTC

@Matt-Turi btw why is voxl-emulator architecture armv7l if we have aarch64 on actual voxl? Will this be a problem when compiling in emulator?

## Reply by Eric Katzfey (ModalAI staff) · 2022-03-17 17:37:50 UTC (in reply to Philemon Benner)

@Philemon-Benner Voxl is 64 bit and the OS is 64 bit. However, Qualcomm provides many of their packages for the device as 32 bit and, consequently, anything that has a dependency on these packages must also be 32 bit. That is why you can build 64 bit applications and have them run successfully on Voxl. It just means that that application had no 32 bit dependencies.

## Reply by Philemon Benner · 2022-03-17 17:43:05 UTC

Okey thanks for explaining

## Reply by Philemon Benner · 2022-03-17 17:49:38 UTC

@Matt-Turi 
I know it's not really related to the voxl but if include directorys in cmake like that:
```
include_directories(/home/root/third_party/AWS/wrkspace/lib)
```
the compiler should find the packages located in there or?
```
[100%] Linking CXX executable Process
/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: cannot find -lDiscovery-cpp
/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: cannot find -lEventstreamRpc-cpp
```
but the linked library is located there:
```
voxl-cross:~(master)$ ls /home/root/third_party/AWS/wrkspace/lib | grep Discovery-cpp
Discovery-cpp
libDiscovery-cpp.a
```

## Reply by Chad Sweet (ModalAI staff) · 2022-03-19 16:21:04 UTC

Not totally sure what you're asking, but try looking into [target_link_libraries](https://cmake.org/cmake/help/latest/command/target_link_libraries.html) in the cmake documentation

## Reply by Philemon Benner · 2022-03-22 12:43:22 UTC

@Matt-Turi Ok so i got it working with CXX17, it's working in voxl-emulator:
```
voxl-emulator:~$ file program
voxl-mission-logic: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=somekey , for GNU/Linux 5.4.0, not stripped
voxl-emulator:~$ ./program --arg someArg
[2022-03-22 12:23:14.804] [info] someText
[2022-03-22 12:23:14.807] [info] someText
[2022-03-22 12:23:15.279] [info] someText
```
But on actual voxl it's not working:
```
voxl:/data$ ./program --arg someArg
FATAL: kernel too old
Aborted
```
Kernel Versions in voxl-emulator and voxl_platform_3-3-0-0.5.0-a system image are actually different:
emulator kernel version: 5.13.0-35-generic
voxl kernel version: 3.18.71-perf
Shouldn't voxl emulator have the same kernel version as the voxl?
in the docs it says:

* voxl-emulator simulates the VOXL system image and is built alongside the base system image

## Reply by Philemon Benner · 2022-03-22 13:11:14 UTC

Upgrading to newest system image didn't work either

## Reply by Eric Katzfey (ModalAI staff) · 2022-03-22 16:03:40 UTC (in reply to Philemon Benner)

@Philemon-Benner voxl-emulator is a Docker image, not a complete Virtual Machine, so it uses the same kernel as the machine you run it on.

## Reply by Philemon Benner · 2022-03-22 16:07:42 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Ok thanks for the fast answer.
