Building voxl-streamer on voxl-cross Docker image
-
Hi. I am building the voxl-streamer service (for debugging purposes) for qrb5165 (on voxl mini) using the voxl-cross:V2.7 image and I found that I had to make several changes to the repo to get it to build and deploy.
For example, gstreamer development libraries are not listed in the install_build_deps.sh script. I had to install the gstreamer dev packages manually to the docker image. Also the docker image does not list the arm64 architecture as one of its package architectures. Cuz cross compiling will fail if you install the x86 packages.In summary I had to:
dpkg --add-architecture arm64 apt install libgstreamer1.0-dev:arm64 libgstreamer-plugins-base1.0-dev:arm64 libgstrtspserver-1.0-dev:arm64
The other thing that I did was change the cmake because it was trying to use the wrong compiler for the cross compilation. During the linking stage the linker was complaining that libmodal-json.so was in the wrong format. I compiled libmodal-json for aarch64 obviously.
set(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc-7") set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++-7") link_directories(/usr/lib/aarch64-linux-gnu/)
To my understanding the whole idea of using voxl-cross is to build packages for aarch64 by using an out of the box container.
Can any modalai devs help me figure out if these issues are legit? Or do you guys use a different build process? Maybe @Alex-Gardner ?
-
@AndriiHlyvko voxl-streamer is meant to be built with qrb5165-emulator, not voxl-cross
https://gitlab.com/voxl-public/voxl-sdk/services/voxl-streamer#build-for-qrb5165
-
@tom your docs page doesnt say anything about using the emulator image for building the packages. Either update your docs or fix cross compilation on docker-cross
-
@tom also it doesnt make sense to emulate arm64 just for the build process lol
-
@AndriiHlyvko The formatting is a bit broken so I'll fix it but it's there: https://docs.modalai.com/voxl-emulator/
Not all packages are built using voxl-cross (the majority are but not all).
Some are built using qrb5165-emulator and apq8096-emulator.
I'd recommend reading through the readme or checking how CI is building the package before building it yourself. All of our packages are built nightly in CI to verify that the builds are good.
-
@tom ok sounds good. But why not just change the cmake a little to test the arch and then change the include and link directories accordingly so it wont matter under what arch youre building it? I feel like its a simple change and it'll make it more convenient. Just my two cents
Also that Emulator docs page says: "It is for low-level service development for cross-compiling applications not yet supported by cross-compiling in voxl-cross". So is the plan to make all packages be compiled using voxl-cross?
-
@AndriiHlyvko The issue is with dependencies. The emulator is built using the actual filesystem used on the VOXL platform so you get all of the correct dependencies. With voxl-cross it is sometimes very difficult to setup the dependencies properly.