【开源分享】vsomeip 安装、编译、运行步骤笔记

文章目录

  • [1. 摘要](#1. 摘要)
  • [2. 安装、编译](#2. 安装、编译)
    • [2.1 开发环境说明](#2.1 开发环境说明)
    • [2.2 安装依赖](#2.2 安装依赖)
    • [2.3 获取代码](#2.3 获取代码)
    • [2.4 编译代码](#2.4 编译代码)
    • [2.5 安装](#2.5 安装)
  • [3. 测试验证](#3. 测试验证)
  • 参考

1. 摘要

本文主要描述 vsomeip 的安装、编译与运行步骤。下载源码,安装必要依赖,如Boost和CMake。通过CMake配置编译 vsomeip 库,确保环境配置正确。运行 hello_world 示例验证安装,注意配置环境变量与日志输出。一步步引导,助您快速上手VSOMEIP通信框架。如果您对智驾中间件感兴趣,请持续关注!


2. 安装、编译

2.1 开发环境说明

博主的开发环境是Windows 11,安装WSL2,Linux子系统,版本信息如下:


2.2 安装依赖

bash 复制代码
sudo apt-get install libboost-system-dev libboost-thread-dev libboost-log-dev

bash 复制代码
sudo apt-get install asciidoc source-highlight doxygen graphviz
bash 复制代码
sudo apt-get install gcc g++ make

2.3 获取代码

bash 复制代码
git clone git@gitee.com:mirrors/vsomeip.git

代码结构如下:


2.4 编译代码

bash 复制代码
mkdir build
cd build
cmake ..
make

2.5 安装

bash 复制代码
sudo make install

安装过程输出:

bash 复制代码
Consolidate compiler generated dependencies of target vsomeip3
[ 67%] Built target vsomeip3
Consolidate compiler generated dependencies of target vsomeip3-cfg
[ 69%] Built target vsomeip3-cfg
Consolidate compiler generated dependencies of target vsomeip3-sd
[ 84%] Built target vsomeip3-sd
Consolidate compiler generated dependencies of target vsomeip3-e2e
[ 98%] Built target vsomeip3-e2e
Consolidate compiler generated dependencies of target routingmanagerd
[100%] Built target routingmanagerd
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/application.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/constants.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/defines.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/enumeration_types.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/error.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/export.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/function_types.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/handler.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/internal/deserializable.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/internal/serializable.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/message.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/message_base.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/payload.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/plugin.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/plugins/application_plugin.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/plugins/pre_configuration_plugin.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/primitive_types.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/runtime.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/trace.hpp
-- Installing: /usr/local/include/vsomeip/../compat/vsomeip/vsomeip.hpp
-- Installing: /usr/local/include/vsomeip/application.hpp
-- Installing: /usr/local/include/vsomeip/constants.hpp
-- Installing: /usr/local/include/vsomeip/defines.hpp
-- Installing: /usr/local/include/vsomeip/deprecated.hpp
-- Installing: /usr/local/include/vsomeip/enumeration_types.hpp
-- Installing: /usr/local/include/vsomeip/error.hpp
-- Installing: /usr/local/include/vsomeip/export.hpp
-- Installing: /usr/local/include/vsomeip/function_types.hpp
-- Installing: /usr/local/include/vsomeip/handler.hpp
-- Installing: /usr/local/include/vsomeip/internal/deserializable.hpp
-- Installing: /usr/local/include/vsomeip/internal/logger.hpp
-- Installing: /usr/local/include/vsomeip/internal/policy_manager.hpp
-- Installing: /usr/local/include/vsomeip/internal/serializable.hpp
-- Installing: /usr/local/include/vsomeip/message.hpp
-- Installing: /usr/local/include/vsomeip/message_base.hpp
-- Installing: /usr/local/include/vsomeip/payload.hpp
-- Installing: /usr/local/include/vsomeip/plugin.hpp
-- Installing: /usr/local/include/vsomeip/plugins/application_plugin.hpp
-- Installing: /usr/local/include/vsomeip/plugins/pre_configuration_plugin.hpp
-- Installing: /usr/local/include/vsomeip/primitive_types.hpp
-- Installing: /usr/local/include/vsomeip/runtime.hpp
-- Installing: /usr/local/include/vsomeip/structured_types.hpp
-- Installing: /usr/local/include/vsomeip/trace.hpp
-- Installing: /usr/local/include/vsomeip/vsomeip.hpp
-- Installing: /usr/local/include/vsomeip/vsomeip_sec.h
-- Installing: /usr/local/lib/libvsomeip3.so.3.4.10
-- Installing: /usr/local/lib/libvsomeip3.so.3
-- Installing: /usr/local/lib/libvsomeip3.so
-- Installing: /usr/local/lib/libvsomeip3-e2e.so.3.4.10
-- Installing: /usr/local/lib/libvsomeip3-e2e.so.3
-- Set runtime path of "/usr/local/lib/libvsomeip3-e2e.so.3.4.10" to ""
-- Installing: /usr/local/lib/libvsomeip3-e2e.so
-- Installing: /usr/local/lib/libvsomeip3-cfg.so.3.4.10
-- Installing: /usr/local/lib/libvsomeip3-cfg.so.3
-- Set runtime path of "/usr/local/lib/libvsomeip3-cfg.so.3.4.10" to ""
-- Installing: /usr/local/lib/libvsomeip3-cfg.so
-- Installing: /usr/local/lib/libvsomeip3-sd.so.3.4.10
-- Installing: /usr/local/lib/libvsomeip3-sd.so.3
-- Set runtime path of "/usr/local/lib/libvsomeip3-sd.so.3.4.10" to ""
-- Installing: /usr/local/lib/libvsomeip3-sd.so
-- Installing: /usr/local/etc/vsomeip/vsomeip.json
-- Installing: /usr/local/etc/vsomeip/vsomeip-local.json
-- Installing: /usr/local/etc/vsomeip/vsomeip-tcp-client.json
-- Installing: /usr/local/etc/vsomeip/vsomeip-tcp-service.json
-- Installing: /usr/local/etc/vsomeip/vsomeip-udp-client.json
-- Installing: /usr/local/etc/vsomeip/vsomeip-udp-service.json
-- Installing: /usr/local/lib/cmake/vsomeip3/vsomeip3Config.cmake
-- Installing: /usr/local/lib/cmake/vsomeip3/vsomeip3ConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/vsomeip3/vsomeip3Targets.cmake
-- Installing: /usr/local/lib/cmake/vsomeip3/vsomeip3Targets-relwithdebinfo.cmake
-- Installing: /usr/local/lib/pkgconfig/vsomeip3.pc

3. 测试验证

为了验证我们编译的代码是否可用,可以参考示例说明,运行测试demo。

demo 路径和代码结构如下:


bash 复制代码
cd examples/hello_world
mkdir build
cd build
cmake ..
make

编译过程如下:


编译完成后,将配置文件拷贝到demo可执行程序下:


运行 server 端程序:

bash 复制代码
sudo ldconfig
env VSOMEIP_CONFIGURATION=./helloworld-local.json VSOMEIP_APPLICATION_NAME=hello_world_service ./hello_world_service

server 端:


新开一个终端,运行 client 端程序:

bash 复制代码
env VSOMEIP_CONFIGURATION=./helloworld-local.json VSOMEIP_APPLICATION_NAME=hello_world_client ./hello_world_client

client 端:


参考

【1】vsomeip-in-10-minutes

【2】给新手----编译VSOMEIP保姆级别教程

【3】vsomeip ------ 10分钟快速了解 vsomeip (vsomeip wiki 文档翻译)

相关推荐
kingx36 小时前
BugKu PRA 渗透测试 2(Harry‘s Blog):9 Flag 全链实战复盘
中间件·渗透测试·log4j2·内网渗透·反序列化
sun_weitao11 小时前
用 FastAPI + MQTT 做一个 ESP32最小化跑通示例
中间件·vue·fastapi
真上帝的左手19 小时前
12. 消息队列-Kafka进阶
分布式·中间件·kafka
车载中间件通信2 天前
[TC8测试]TCP_FLAGS_PROCESSING_06
数据库·网络协议·tcp/ip·中间件·tc8
见合八方2 天前
借助半导体光放大器实现功率预算超31dB的112.5Gbit/s长距无源光网络
网络·5g·soa·光通信·激光雷达·半导体光放大器
kingx33 天前
网络安全事件应急响应:X集团 WebServer 入侵溯源与处置
中间件·web·应急响应·取证·恶意样本
特立独行的猫a3 天前
ROS 2 主流DDS中间件入门:Cyclone DDS 与 Fast DDS 完全指南
中间件·ros2·dds·fast dds·cyclone dds
小易老师AI实战3 天前
用中间件把任务规划嵌进智能体循环
中间件·状态管理·智能体·工具调用·langgraph·任务规划
绿蕉4 天前
从硬件内卷到“中间件荒“——仿真工具、开发接口、开源生态
中间件·机器人
小易老师AI实战5 天前
LangGraph Agent 任务规划中间件:TodoListMiddleware 原理解析
中间件·agent·langgraph·任务规划·大模型智能体