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

相关推荐
蜡笔小鑫️5 小时前
金碟中间件-AAS-V10.0安装
中间件
武汉联从信息6 小时前
Oracle中间件 SOA之 OSB 12C服务器环境搭建
soa·osb·oracle中间件
Lspecialnx_7 小时前
文件解析漏洞中间件(iis和Apache)
网络安全·中间件
隔着天花板看星星7 小时前
Spark-Streaming集成Kafka
大数据·分布式·中间件·spark·kafka
Autumn.h1 天前
文件解析漏洞
web安全·网络安全·中间件
武汉联从信息1 天前
Oracle 中间件 Webcenter Portal服务器环境搭建
中间件
小屁不止是运维3 天前
麒麟操作系统服务架构保姆级教程(三)NGINX中间件
linux·运维·服务器·nginx·中间件·架构
what_20183 天前
中间件 mysql安装
mysql·中间件
飞的肖3 天前
在微服务架构中,处理消息的中间件是实现服务间异步通信的关键组件。以下是几种常见的消息中间件及其特点、优点和缺点
微服务·中间件·架构
往日情怀酿做酒 V17639296384 天前
Django基础之中间件
python·中间件·django