Linux
Linux software install
Google repo的使用
Vector AP StartApplication编译脚本解析
Yocto的cmake版本升级
不能自动安装的解决方式
S32G-BSP35.0-SDK使用方法
S32G从SDK生成文件系统的制作过程
Linux Samba设置
Linux添加双网卡
S32G USB-Redirector安装指南
VS code自动生成Doxygen格式注释
Linux下使用多线程下载
使用pandoc 生成带中文的pdf
minicom无法输入的问题解决办法
使用 systemd unit 添加一条路由规则
CMake 教程
步骤 1:基本起点
步骤 2:添加lib库
步骤 3:为库添加使用要求
步骤 4:添加生成器表达式
步骤 5:安装和测试
步骤 6:添加支持测试仪表板
步骤 7: 添加系统内省
步骤 8:自定义命令和生成的文
步骤 9:打包安装程序
步骤 10:选择静态库或共享库
步骤 11:添加导出配置
步骤 12:打包 Debug 和 Release
添加虚拟网卡
Vector AP 去掉防篡改校验
Vector AP startapplication编译与使用
Vector AP问题汇总
Vector AP大型项目开发流程
Vector AP EM
Vector AP 最简单的开发示例
Linux kernel 版本降级
Vector AP StartApplicaiton
startappplication-machine-design
startapplicaiton-machine-integration
amsr-vector-fs-em-executionmanager-design
amsr-vector-fs-em-executionmanager
Vector AP 复杂模型的开发
第一章 Machine和MachineDesign
第二章 Execute Manager
第三章 Log
第四章 State Manager
第五章 State Manager 源码的理解
第六章 Someip daemon
第七章 IPC Service Discovery Daemon
crond的使用方法
解决蓝牙鼠标在 Ubuntu 中单位时间内断开的问题
VPS服务器自建教程
v2rayA的客户端使用配置
GDB调试指南入门篇:揭开程序运行世界的神秘面纱
GDB调试指南高级篇:成为调试专家,掌控程序的命运
Linux安装PyQt5并配置Qt Designer
ADB 命令大全
GoogleTest(一)
GoogleTest(二)简单的TEST宏
GoogleTest(三)简单类函数测试
C++ Template
1. 函数模板
2. 类模板
3. 非类型模板参数
软件版本号规范
EPOLL
C++手札
C++ 使用{}初始化有哪些好处?
现代 C++ decltype 深入解析
函数对象(functor)
Linux性能剖析:CPU、内存、网络与I/O压力测试
AP StateManager
C++ Lambda表达式
C++ 中的Lambda表达式
Lambda 表达式语法
Lambda 表达式的示例
手动发送UDP数据包
pyqt5生成的UI界面不能输入中文
自己搭建repo镜像
摄影
Sony仿富士PP值设置
诗词歌赋
本文档使用 MrDoc 发布
-
+
首页
Vector AP StartApplication编译脚本解析
```shell #!/bin/bash ####################################################################################################################### # COPYRIGHT # ------------------------------------------------------------------------------------------------------------------- # \verbatim # Copyright (c) 2023 by Vector Informatik GmbH. All rights reserved. # # This software is copyright protected and proprietary to Vector Informatik GmbH. # Vector Informatik GmbH grants to you only those rights as set out in the license conditions. # All other rights remain with Vector Informatik GmbH. # \endverbatim # ------------------------------------------------------------------------------------------------------------------- # FILE DESCRIPTION # ------------------------------------------------------------------------------------------------------------------- # \file build_startapplication.sh # \brief Build the Start Application using TACO build environment. ####################################################################################################################### # 脚本运行出错立即停止 set -e # 脚本管道出错,立即停止 set -o pipefail EXEC=echo DRY_RUN=1 COMPILE_ONLY=false # 获取startapplication 所在目录 STARTAPPLICATION_DIR="$(cd "$(dirname "$0")" && pwd)" SIP_DIR=$STARTAPPLICATION_DIR/../.. # 编译目录 BUILD_DIR=BuildStartApplication # 安装目录 INSTALL_DIR=$BUILD_DIR/install # 插件目录 INSTALL_ADDON_DIR=$BUILD_DIR/install_addon # cmake的--preset,其含义是cmake的预配置文件,可以搜索找到这个文件 PRESET="gcc_fsl_aarch64" # CMake 将使用指定路径下的 fsl_aarch64_gcc.cmake 文件作为初始缓存文件。 # CMake 初始缓存文件包含了一系列 CMake 变量和选项的设置,用于配置构建过程。 # 通过使用这个文件,你可以预先定义一些构建选项,而不需要在命令行中手动指定。 CMAKE_INITIAL_CACHE_FILE="$SIP_DIR/CMakeConfig/fsl_aarch64_gcc.cmake" # 打印字体的颜色 RED='\033[0;31m' NOCOLOR='\033[0m' help_text () { echo "" echo "Usage:" echo " build_startapplication.sh [options]" echo "" echo "The execution of the build script without any options will run the script in the dry run mode." echo "The parameter --execute must be given explicitly along with the following options to execute the Start Application build." echo "Otherwise a dry run of the script takes place." echo "" echo "Options:" echo echo " --execute Execute the Start Application build." echo " --cmake-preset <compiler-name> Use another compiler." echo " e.g. --cmake-preset gcc7_linux_x86_64" echo " --cmake-initial-cache-file <path> Provide the path to a cmake initial cache file." echo " This path must be relative to the SIP directory." echo " e.g. --cmake-initial-cache-file ./CMakeConfig/linux_gcc7.cmake" echo " --cmake-settings <settings> Use non-default compiler and cmake settings." echo " e.g. --cmake-settings \"-D AMSR_IPCMULTICAST_IMPL=DAEMON" echo " -D CMAKE_BUILD_TYPE=Release\"" echo " --compile-only Skip build cache initialisations and generator calls and perform" echo " only build and install of the targets." echo " --help Display the usage and other script options." echo "" } # Extract arguments and corresponding values # 我们的startapplication编译就是用的--execute,实际是清空变量,什么都没干 while [ $# -gt 0 ] do argument="$1" case $argument in --execute) # 清空 EXEC EXEC="" # 清空 DRY_RUN DRY_RUN=0 # 清空 IGNORE_COMMAND IGNORE_COMMAND="" # Shift argument and value shift ;; --cmake-preset) if [ -z $2 ]; then echo -e "${RED}Error: Invalid argument value" echo "--cmake-preset is empty" exit 1 fi PRESET="$2" # Shift argument and value shift shift ;; --cmake-initial-cache-file) if [ -z $2 ]; then echo -e "${RED}Error: Invalid argument value" echo "--cmake-initial-cache-file is empty" exit 1 fi CMAKE_INITIAL_CACHE_FILE="$SIP_DIR/$2" if [ ! -f "$CMAKE_INITIAL_CACHE_FILE" ]; then echo -e "${RED}Error: File not exists: $SIP_DIR/$2" exit 1 fi # Shift argument and value shift shift ;; --cmake-settings) if [ -z $2 ]; then echo -e "${RED}Error: No cmake options set" echo "--cmake-settings is empty" fi CMAKE_SETTINGS="$2" # Shift argument and value shift shift ;; --compile-only) COMPILE_ONLY=true # Check if Build Cache is available if [ ! -d $SIP_DIR/$BUILD_DIR ]; then echo -e "${RED}Error: No build cache available" echo -e "${NOCOLOR}Use --execute to run a full build of the Start Application." exit 1 fi shift ;; --help) help_text shift exit 1 ;; *) echo -e "${RED}Error: Invalid argument "$1" used" exit 1 esac done echo "" echo -e "${NOCOLOR}" echo "=================== Build the Start Application using TACO =========================" echo " Call CMake with the Start Application target. This will build and" echo " install the Start Application and all required BSW components." echo "------------------------------------------------------------------------------------" # Export environment variable for TACO builds $EXEC export AMSR_SRC_DIR="$SIP_DIR" # Change directory to Examples/startapplication $EXEC cd ${AMSR_SRC_DIR}/Examples/startapplication if [ $COMPILE_ONLY = false ]; then # Initialize cache for building the Start Application using TACO # 展开式为:cmake -S . -B /path/to/BuildStartApplication --preset=gcc_fsl_aarch64 -C /path/to/SIP_DIR/CMakeConfig/fsl_aarch64_gcc.cmake $EXEC cmake -S . $CMAKE_SETTINGS \ -B $AMSR_SRC_DIR/$BUILD_DIR \ --preset=$PRESET \ -C $CMAKE_INITIAL_CACHE_FILE fi # Change directory to the previously created build cache directory $EXEC cd $AMSR_SRC_DIR/$BUILD_DIR if [ $COMPILE_ONLY = false ]; then # Generating source code for Start Application using ctest $EXEC ctest -R '.*\.DvACfg\.Generate' --verbose --parallel $(nproc) fi # Build the Start Application by building for target startapp_apps $EXEC cmake --build . --target startapp_apps --parallel $(nproc) # Install the Start Application to INSTALL_DIR using parameter --prefix $EXEC cmake --install . --component STARTAPP_Runtime --prefix $AMSR_SRC_DIR/$INSTALL_DIR RETVAL=$? # Generate Software Update packages if [ -z "${SA_SKIP_GENERATE_UPDATE_PACKAGE}" ]; then if [ $RETVAL -ne 0 ]; then exit $RETVAL else $EXEC $STARTAPPLICATION_DIR/infrastructure/update_management/generate_update_packages.sh --install-dir $SIP_DIR/$INSTALL_DIR --install-addon-dir $SIP_DIR/$INSTALL_ADDON_DIR RETVAL=$? fi fi if [ $DRY_RUN -eq 0 ]; then if [ $RETVAL -ne 0 ]; then exit $RETVAL else echo "--------------------------------------------------------------------------------" echo " The Start Application was installed to:" echo " $SIP_DIR/$INSTALL_DIR" if [ ! -z $CMAKE_TOOLCHAIN_FILE_PATH ]; then echo " with toolchain file: $CMAKE_TOOLCHAIN_FILE_PATH" fi fi fi if [ $DRY_RUN -eq 1 ]; then echo "" echo "==================================================================================" echo "This is only a dry run." echo "To execute the Start Application build, call the script with --execute." echo "To display the help for other script options, call the script with --help." echo "==================================================================================" fi ``` ## cmake中不理解的地方 ```cmake dvacfg_file_gen(${TARGET} INPUT "${STARTAPP_ADPA_FILE}" OUTPUT "amsr_applicationbase.cmake" "amsr_em_exec_config.cmake" "amsr_logapi_config.cmake" "amsr_thread_config.cmake" "amsr_modelleddatatypes_api.cmake" "amsr_persistency_config.cmake" GENERATOR DvACfg::amsr_applicationbase DvACfg::amsr_em_exec_config DvACfg::amsr_logapi_config DvACfg::amsr_thread_config DvACfg::amsr_modelleddatatypes_api DvACfg::amsr_persistency_config DIRECTORY "startapp_per_app1") ``` 1、这个函数调用的用途是什么? 2、INPUT参数跟的是文件还是文件夹 3、OUTPUT参数后的`.cmake`的文件,这个文件名是自己随意取的吗?还是有遵守某种规则 4、GENERATOR后的参数`DvACfg::amsr_applicationbase`这个也是自己随意取的吗? 5、为什么Examaple中的amsr-vector-app-example-hello-world,打开工程后,达芬奇中没有dashboard
admin
2024年3月14日 17:17
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码