【开源分享】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 文档翻译)

相关推荐
千年死缓11 小时前
gin中间件
中间件·gin
车载诊断技术11 小时前
电子电气架构 --- 整车控制系统
网络·架构·汽车·soa·电子电器架构
General_G1 天前
FastDDS服务发现之PDP和EDP的收发
数据库·中间件·服务发现·fast dds·rtps
萤火夜3 天前
Linux之信号量
中间件
idealzouhu4 天前
【Canal 中间件】Canal 实现 MySQL 增量数据的异步缓存更新
mysql·缓存·中间件·canal
乄bluefox4 天前
学习RocketMQ(记录了个人艰难学习RocketMQ的笔记)
java·spring boot·中间件·rocketmq
橘色的喵5 天前
Iceoryx2:高性能进程间通信框架(中间件)
中间件·rust·高性能·iceoryx·iceoryx2
栀夏6135 天前
Ceph 学习指南 集群部署【 cephadm 】
中间件·存储
无厌3205 天前
Django-中间件
python·中间件·django