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

相关推荐
谷大羽18 小时前
Kafka Stream实战教程
spring boot·后端·中间件·kafka·stream
隔着天花板看星星1 天前
Kafka-创建topic源码
大数据·分布式·中间件·kafka
get2002 天前
Gin 框架中间件详细介绍
中间件·gin
一水鉴天2 天前
智能工厂的设计软件 为了监管控一体化的全能Supervisor 的监督学习 之 序5 架构for认知系统 总述 (架构全图)
人工智能·学习·中间件·架构
谢尔登2 天前
【Next】中间件
服务器·javascript·中间件
极客先躯2 天前
高级java每日一道面试题-2024年11月09日-缓存中间件篇-Redis和Memecache有什么区别?
java·缓存·中间件·每日一道面试题·高级java·缓存中间件篇
隔着天花板看星星3 天前
Kafka-Controller角色需要做什么?
大数据·分布式·中间件·kafka
留乘船3 天前
使用gin -gorm-jwt-中间件拦截的一个小项目
开发语言·学习·中间件·golang·gin
Amd7945 天前
Nuxt.js 应用中的 vite:serverCreated 事件钩子
中间件·开发·vite·日志·nuxt·跨域·钩子
0x派大星6 天前
【Goland】——Gin 框架中间件详解:从基础到实战
开发语言·后端·中间件·golang·go·gin