Veethree D7 SDK
Loading...
Searching...
No Matches
Build toolchains on Linux

< Build Toolchain

This page goes into detail about the toolchains packaged by the D7 SDK. It will explain the external dependencies for the host machine, why there are separate toolchains for the host machine and the target device, the dependency between them and a rough guide on what each toolchain contains.

Location of the toolchains

From the D7 SDK installation directory, the toolchains can be found in the toolchain/sysroots subdirectory. On Linux it should show:

toolchain/sysroots/
├── armv8a-veethree-linux
└── x86_64-veethree-linux

In each sysroot you will find executables, shared libraries, static libraries, include headers and package configuration files for CMake and pkg-config packages in the locations you would expect in a regular Linux distribution; i.e. binaries in usr/bin, libraries in usr/lib, headers in usr/include, configurations in etc, etc.

Target device toolchain

The target device toolchain contains the headers, shared libraries and static libraries necessary for compiling an application for the target.

All the files in toolchain/sysroots/armv8a-veethree-linux, binary or text, refer to the rootfs on the target device and are also compiled for the target device; as such, they will not run on the host.

Using the target toolchain

You need to enable the development environment in every shell where you will be compiling projects for the target device. This should be done by sourcing the $HOME/d7-sdk/toolchain/environment-setup-armv8a-veethree-linux script in the current shell. This will set a number of environment variables in the current shell to make sure that C and C++ projects are compiled and linked for the target device.

For examples of sourcing the toolchain and building app see:

Developing for the D7 Platform using Qt Creator

To use Qt Creator for compiling for the D7, you will need to add the D7 SDK's Qt Creator Kit. Please see Adding the D7 SDK as a Kit in Qt Creator for a guide on how to do that.

Host toolchain

Note: The target toolchain depends on utilities from the host sysroot.

In addition to the development tools, the host toolchain also contains some of the libraries available on the target to allow testing some application functionality on the host machine before testing on the target.

Not all the target functionality is available on the host. Specifically, hardware interfaces (described in I/O: Analog, Digital, PWM) are mocked on the host, and libraries required for that functionality are not included in the host toolchain (for instance, libgpiod is not available on the host toolchain because gpio functionality is not available on the host via the D7 SDK).

External dependencies for the host toolchain

While the host sysroot provides the cross compiler for the target, it does not provide a compiler for the host machine.

The host machine is expected to provide its own compiler and glibc. The minimum supported compiler on Linux is GCC 13.3. The host sysroot in the D7 SDK does, however, provide CMake, pkg-config, make, a linker and other development utilities that can be used for the host. On Ubuntu 24.04 it is sufficient to run

sudo apt update -y && sudo apt install gcc-13 build-essential

build-essential provides ar, ranlib, nm etc.

On other Linux distributions, follow your distribution's guide for installing GCC 13.3 etc.

Note
If testing applications on the desktop, make sure the host's glibc is not newer than the one in the host toolchain sysroot.

Currently the host toolchain in the D7 SDK is compiled against glibc 2.39. The glibc from Ubuntu 24.04 LTS will work.

Using the host toolchains

To build and run apps on the host, the host toolchains need to be sourced to set required environment variables in the current shell. Please refer to D7 SDK user walkthrough - Linux Host Builds for full instructions to build and run both CLI and QML apps.

Building D7 SDK applications on the host using Qt Creator

To use Qt Creator for compiling D7 SDK applications for the host, it is good practice to create a clone of the default desktop kit, such that it can be rebuilt as many times as needed in case it ever drifts from a working configuration.

Please see Qt host build kit for linux.