Veethree D7 SDK
Loading...
Searching...
No Matches
D7 SDK build toolchains

< Details index

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

On Windows it should show:

toolchain\sysroots\
├── armv8a-veethree-linux
└── x86_64-w64-mingw32

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.

Enabling the development environment in a shell

On Linux, source the environment-setup-armv8a-veethree-linux script in the current shell:

source $HOME/d7-sdk/toolchain/environment-setup-armv8a-veethree-linux

On Windows, is it enough to simply invoke the batch script:

%USERPROFILE%\d7-sdk\toolchain\environment-setup-armv8a-veethree-linux.bat

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.

You need to enable the development environment in every shell where you will be compiling projects for the target device.

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 Hardware interface on the target) 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

Linux

Note
For now, this section only applies to Linux.

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 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.

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.

Enabling the development environment in a shell

On Linux, source the environment-setup-x86_64 script in the current shell:

source $HOME/d7-sdk/toolchain/environment-setup-x86_64

In addition to that, if you wish to run the applications that use Qt libraries on the host, you will need to have the Qt libraries installed separately. Please see Installing Qt libraries and Qt Creator. When configuring a CMake project that uses Qt libraries, you will need to specify Qt's installation directory:

# Assuming Qt was installed to the default location $HOME/Qt
# configure a CMake project to use the host's separate Qt libraries
cmake -S . -B build -G Ninja ... -DCMAKE_PREFIX_PATH=$HOME/Qt/6.8.3/gcc_64

Note: The version of Qt libraries installed on the host must match that of the libraries from the D7 SDK. Currently, that is version 6.8.3.

Windows

On Windows, the libraries that exist in the host SDK have been built to be compatible with the Desktop Qt 6.8.3 MinGW 64-bit kit.

The toolchain can be downloaded from here independently of QtCreator.

After extracting the toolchain. You will need to add the %toolchain_path%/mingw1310_64/bin folder to the PATH environment variable to make the tools available on the command line and to other tools such as CMake. Pick one of the two methods below.

Prepending toolchain to PATH

Temporary PATH value

You will need to run this everytime you start a new terminal session. For persistent variables see the next section.

REM Update the EXTRACT_PATH variable before running this
set EXTRACT_PATH="Path Archive was extracted"
set PATH=%EXTRACT_PATH%\Tools\mingw1310_64\bin;%PATH%
Persistent PATH value

Adding variables here will persist between terminal sessions.

  1. Open the start menu and search for "Environment variables"
  2. You should see "Edit the system environment variables". Click that result
  3. The System properties window should appear. Click "Environment variables" at the bottom
  4. Now edit either the User variables or System variables PATH entry.
    1. System variables affect every user on the system
    2. User variables only affect the currenty signed in user
  5. Add the toolchain bin folder to PATH %EXTRACT_PATH%\Tools\mingw1310_64\bin
    1. Replace %EXTRACT_PATH% with the actual toolchain path
  6. Once finished, click Ok
  7. Click Apply on the system properties window
  8. The new entry will now persist and will be automatically added to PATH

Enabling the development environment in a shell

On Windows, run the environment-setup-x86_64-mingw32.bat script in the current cmd.exe window:

.\$HOME\d7-sdk\toolchain\environment-setup-x86_64-mingw32.bat

In addition to that, if you wish to run the applications that use Qt libraries on the host, you will need to have the Qt libraries installed separately. Please see Installing Qt libraries and Qt Creator. When configuring a CMake project that uses Qt libraries, you will need to specify Qt's installation directory:

# Assuming Qt was installed to the default location %%USERPROFILE%/Qt
# configure a CMake project to use the host's separate Qt libraries
cmake -S . -B build -G Ninja ... -DCMAKE_PREFIX_PATH=%%USERPROFILE%/Qt/6.8.3/mingw_64

Note: The version of Qt libraries installed on the host must match that of the libraries from the D7 SDK. Currently, that is version 6.8.3 MinGW 64-bit.

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 Creator host build kit.