Build Application Files

In the following steps you will create the build cache and the executable for your Hello World Application.

Optional: Copy Example

  1. Copy the directory /Examples/amsr-vector-app-example-hello-world to your workspace.

  2. Rename the copied directory.

Your workspace may be located outside of the directory of your BSW Package.

Step 1: Set Environment Variable

  1. Open a terminal session.

  2. Set the environment variable AMSR_SRC_DIR to the path of the BSW Package delivery.

export AMSR_SRC_DIR=~/<path to BSW Package>

Step 2: Initialize the build-cache

  1. In the terminal, change to the directory to your copied Hello World App directory.

    cd ~/<path to Hello World App>
  2. Initialize the build-cache with CMake.

    The VES_EXECUTIONMANAGER_EXAMPLE_APP_MSC setting tells the EM example application to act as machine state client (MSC).

    cmake -S . --preset=gcc11_linux_x86_64 -C ${AMSR_SRC_DIR}/CMakeConfig/linux_gcc11.cmake -D VES_EXECUTIONMANAGER_EXAMPLE_APP_MSC=ON

You will find the build-cache in the build directory of the Hello World App directory: ./build/gcc11_linux_x86_64.

Step 3: Generate the Application Code

Run the code generators for both ves (Vector Embedded Software) and hwsrc (Hello World src) prefixed targets and reload the build cache:

cd build/gcc11_linux_x86_64
ctest -R '(ves|hwsrc)_.*\.DvACfg.Generate' --progress --parallel $(nproc)
cmake .

Step 4: Build the Executable

The main CMake target is the executable hwsrc_app.

To build it together with its MICROSAR Adaptive dependencies, call the following (in the build-directory):

cmake --build . --target hwsrc_app --parallel $(nproc)