Several configuration options are available that influence the variant of the Adaptive SDK. These options are set via CMake switches, which need to be specified when building the CMake cache.

This means that each unique combination of configuration flags generates a distinct variant of the SDK from the same BSW Package.

Steps

  1. Start from the BSW Package root directory
  1. Setup CMake build cache
    During this step you can use the default settings or include your custom configurations.
  2. Run Configuration Generators [Optional]
    If this step is needed depends on the CMake build cache setup configuration.
  3. Build the Adaptive stack
  4. After building the stack, in the build directory you will find the build cache for your chosen build preset, for example build/gcc11_linux_x86_64.
  5. Install Libraries and MSRA Daemons
  6. After installing is complete, in the install directory you will find the Adaptive SDK for your chosen preset, for example install/gcc11_linux_x86_64.

1. Setup CMake build cache

You can use the default settings for building the CMake build cache or customize the Adaptive SDK.

notice

Caution: Please ensure for SDK builds a clean CMake cache. For example: Delete the build folder and create a new CMake cache for each SDK build.

notice

Caution: Please do not use the CMake switch AMSR_BUILD_EXAMPLES for production SDKs. This option would add the provided example code and libraries to the SDK.

Use default settings

The following command configures the MSRA libraries as well as the MSRA Platform Daemons of the SDK.

This enables the development of Adaptive Applications and MSRA platform daemons.

Command build cache default

shell

cmake -DCMAKE_VERBOSE_MAKEFILE=OFF \
  -C CMakeConfig/linux_gcc11.cmake \
  --preset=gcc11_linux_x86_64 \
  -DCMAKE_BUILD_TYPE=Release

Customize build cache

To install a specific component feature, such as enabling the TraceAPI for the ZeroCopyBinding component, it must be specified when generating the CMake cache.

Component-specific CMake switches follow the convention: AMSR_<ComponentShortName>_<ConfigurationItem>

The following customizations are available:

Command build cache with customizations

shell

cmake -DCMAKE_VERBOSE_MAKEFILE=OFF \
  -C CMakeConfig/linux_gcc11.cmake \
  --preset=gcc11_linux_x86_64 \
  # CMake switches (see TechRefs)
  -DAMSR_ZEROCOPYBINDING_ENABLE_TRACE_API=ON
  # Append further CMake switches if necessary
  # Activate build of MSRA Daemons
  -DAMSR_BUILD_APP=ON \
  # Generate MSRA Daemons configuration with build cache setup
  -D DVACFG_CMAKE_CONFIGURE=ON

notice

Reference: You can find available CMake Switches for a MSRA component in the corresponding Technical Reference in your delivery at Doc/TechnicalReferences.

Component-independent CMake Switches

notice

Note: Some CMake Switches may not be available in your scope of delivery. For more information, please refer to the Delivery Description at Doc/DeliveryInformation.

CMake Switch

Options

Description

Default Setting

AMSR_BUILD_APP

ON

Build applications and MSRA Daemons

ON

OFF

Ignore applications and MSRA Daemons

AMSR_BUILD_EXAMPLE

ON

Build examples

Caution: Avoid this switch for production SDKs as it produces unnecessary overhead.

OFF

OFF

Ignore examples

AMSR_BUILD_SYSLOG

ON

Enable build logging with syslog

OFF

OFF

Ignore syslog build logging

AMSR_DISABLE_EXCEPTIONS

ON

Explicitly disable C++ exceptions

OFF

OFF

Leave C++ exceptions enabled

AMSR_ENABLE_LOG_DAEMON

ON

Enable usage of logging with redirection to LogDaemon

ON

OFF

Ignore LogDaemon

AMSR_ENABLE_EXEC_MANAGER

ON

Enable usage of Execution Manager application client

ON

OFF

Ignore Execution Manager

AMSR_CRYPTO_ENABLE_NVORIN

ON

Enable NVIDIA Orin crypto provider support.

Note: Requires a nvpkcs11 implementation.

OFF

OFF

Disable NvOrin crypto provider support.

AMSR_CRYPTO_ENABLE_PKCS11

ON

Enable PKCS #11 crypto provider support.

Note: Requires a pkcs11 implementation.

OFF

OFF

Disable PKCS #11 crypto provider support.

AMSR_ENABLE_IDSM

ON

Enable global usage of AMSR IDSM

OFF

OFF

Disable global usage of AMSR IDSM

AMSR_LG_BETA_ENABLED

ON

Enable BETA code in the Components

OFF

OFF

Disable BETA code in the Components

AMSR_LG_QM_ENABLED

ON

Enable QM qualified code in ASIL Components

OFF

OFF

Disable QM qualified code in ASIL Components

2. Run Configuration Generators

The DaVinci configuration generators are executed through ctest to regenerate the configuration artifacts. Then CMake is re-run so that the build cache and build system see all required configuration data.

notice

Note: This step is only required if the CMake build cache was originally configured without setting the option -D DVACFG_CMAKE_CONFIGURE=ON.

Steps:

  1. Generate the (changed) CMake files by executing the following command in the build directory:
  2. ctest -R '.*\.DvACfg\.Generate$' --parallel $(nproc --ignore=1)

  3. Update the CMake build cache to pick up the regenerated configuration:
  4. cmake .

3. Build the Adaptive stack

Prerequisites

  • Before the project can be fully compiled, the configuration generators must be run at least once. Either through the option -D DVACFG_CMAKE_CONFIGURE=ON or through a separate generation step.

Command SDK Build

shell

cmake --build build/<preset-name> --parallel $(nproc --ignore=1)

Example

shell

cmake --build build/gcc11_linux_x86_64 –-parallel $(nproc --ignore=1)

After building the stack, in the build directory of your BSW package you will find the build cache for your chosen build preset, for example build/gcc11_linux_x86_64.

4. Install the SDK

The MSRA build system provides several install components. You can choose which installation option fits best your needs.

Command SDK Installation

shell

cmake --install build/<preset-name> \
  --component <installation-option> <--prefix /path/to/SDK>

Example SDK Installation

shell

cmake --install build/gcc11_linux_x86_64/ \
  --component AMSR_Runtime --prefix /path/to/SDK

After installing is complete, in the install directory of your BSW package you will find the Adaptive SDK for your chosen preset, for example install/gcc11_linux_x86_64.

notice

Reference: When the Adaptive SDK is installed it is ready to be integrated into an adaptive project.

Installation Options

Choose which components you would like to install to your SDK.

notice

Note: Some installation options may not be available in your scope of delivery. For more information, please refer to the Delivery Description at Doc/DeliveryInformation.

Installation Option

Description

Delivery-specific

AMSR_Development

Installs static libraries, headers and interface libraries to the chosen install prefix.

If AMSR_BUILD_APP option is selected, the install component also installs the compiled MSRA Daemons.

No

AMSR_Runtime

Installs exclusively MSRA Daemons to the chosen install prefix.

No

AMSR_Generators

Installs a consistent package of code generators and other files needed for a consistent package to deploy along the libraries.

Not included: Adaptive CLI

Important: To avoid about 500 MB overhead for each SDK package, this command does not install the Adaptive CLI tool. However, the Adaptive CLI tool is necessary for running the generators. Therefore, make sure that the CLI is available when using the SDK.

No

AMSR_Tools

Installs the tool "validation-file-cli" to the chosen install prefix.

Technical Reference: TechnicalReference_validationfilecli.pdf

No

Troubleshooting

Build fails due to RAM limitations

Problem: When building the stack according to the SDK example, the build process consumes (seemingly) infinite RAM and eventually fails or causes the system to become unresponsive.

Cause: The build is executed with too many parallel jobs, which is based on the number of processor cores. Each job requires memory. If the number of jobs is too high relative to the available RAM, the system runs out of memory and the build fails.

Solution: Limit the number of parallel jobs by reducing the value passed to –parallel so that fewer processor cores are used concurrently during the build, for example with: $(nproc --ignore=1).