In the following steps you will create the build cache and the executable for your Adaptive Application.
Optional: Copy Example
- Copy the directory
/Examples/amsr-vector-app-example-hello-world
to your workspace. - Rename the copied directory.

Note: Your workspace may be located outside of the directory of your BSW Package.
Step 1: Set Environment Variable
- Open a terminal session.
- 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
- In the terminal, change to the directory to your copied Hello World App directory.
cd ~/<path to Hello World App>
- Initialize the build-cache with CMake.
- The
AMSR_EM_EXAMPLE_APP_MSC=ON
setting tells the EM example application to act as machine state client (MSC). cmake -S . --preset=gcc7_linux_x86_64 -C ${AMSR_SRC_DIR}/CMakeConfig/linux_gcc7.cmake -D AMSR_EM_EXAMPLE_APP_MSC=ON
- You will find the build-cache in the build directory of the Hello World App directory:
./build/gcc7_linux_x86_64
.
Step 3: Generate the application code
Run the code generators for both amsr
(Adaptive MICROSAR) and hwsrc
(Hello World src) prefixed targets and reload the build cache:
cd build/gcc7_linux_x86_64
ctest -R '(amsr|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 Adaptivedependencies, call the following (in the build-directory):
cmake --build . --target hwsrc_app --parallel $(nproc)
Optional next step: Change the log message
Next step in the tutorial: Install and Run the Application