Ubuntu环境下SomeIP/CommonAPI环境搭建详细步骤

环境搭建

1.Boost安装

下载Boost源码 : https://www.boost.org/users/download/

编译安装

首先安装编译所需依赖

sudo apt-get install build-essential g++ 
sudo apt-get install installpython-dev autotools-dev 
sudo apt-get install installlibicu-dev build-essential 
sudo apt-get install libbz2-dev libboost-all-dev

进入到BOOST源码根目录

./bootstrap.sh -h

可以查看一些编译的选项,我们主要注意这三个

  --with-libraries=list     build only a particular set of libraries,
                            describing using either a comma-separated list of
                            library names or "all"
                            [all]
  --with-toolset=TOOLSET    use specific TOOLSET to build B2 and as default
                            for building Boost
                            [automatically detected]

  --prefix=PREFIX           install Boost into the given PREFIX
                            [/usr/local]

执行

./bootstrap.sh --with-libraries=all --with-toolset=gcc --prefix=/home/xxx/xxx/xxx

执行完成会在当前目录下看到一个生成的可执行文件:b2,这个可执行程序是用来编译Boost的,也有一些配置选项

./b2 --help

主要注意选择编译静/动态库这一项,一般选择是动态库

link=static|shared      Whether to build static or shared libraries

执行

./b2 link=shared

安装

sudo ./b2 install

这样Boost就安装到你的指定目录下了。

2. vsomeIP安装

下载vsomeIP源码:https://github.com/GENIVI/vsomeip.git

进入到vsomeIP源码根目录

mkdir build && cd build
cmake -DENABLE_SIGNAL_HANDLING=1 -DDIAGNOSIS_ADDRESS=0x10 -DCMAKE_INSTALL_PREFIX=/home/xxx/xxx/vsomeip -DBOOST_ROOT=/home/xxx/xxx/boost ..
make -j32
sudo make install

一些参数解释

参数作用
ENABLE_SIGNAL_HANDLING开启信号处理
DIAGNOSIS_ADDRESS指定some/ip client id的第一个字节
CMAKE_INSTALL_PREFIX指定安装位置
BOOST_ROOT指定调用Boost库的位置

前两条网上也找到如下诠释

1、vsomeip接收SIGINT/SIGTERM信号,用ctro+c可以成功退出程序。
2、指定some/ip client id的第一个字节,如果在网络上多机通信,有必要区分不同的client,这个时候这个参数很有用。

cmake时如有报错或警告

– Found Doxygen: /usr/bin/doxygen

sudo apt-get install doxygen

– Checking for module ‘libsystemd’

sudo apt-get install libsystemd-dev

asciidoc is not installed. Readme can not be built.

sudo apt-get install asciidoc

– No package ‘automotive-dlt’ found

下载dlt-daemon:https://github.com/COVESA/dlt-daemon

cd /path/to/workspace/dlt-daemon
mkdir build
cd build
cmake ..
make -j32
sudo make install
sudo ldconfig # in case you executed make install

如果不是报错,警告尝试解决不了可先忽略。install完成后即可在指定目录下找到vsomeIP库。

3. CommonAPI Core Runtime安装

下载CommonAPI Core Runtime源码:https://github.com/COVESA/capicxx-core-runtime

进入到capicxx-core-runtime源码根目录

mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/xxx/xxx ..
make -j32
make install

4. CommonAPI SomeIP Runtime安装

下载CommonAPI SomeIP Runtime源码:https://github.com/COVESA/capicxx-someip-runtime

进入到CommonAPI SomeIP Runtime源码根目录

mkdir build
cmake -DUSE_INSTALLED_COMMONAPI=ON -DCMAKE_INSTALL_PREFIX=/xxx/xxx ..
make -j32
sudo make install

5. CommonAPI Core Runtime代码生成工具

这个不建议自己编译,本人尝试编译各种稀奇古怪的问题,直接使用官方提供的release就行。

想要尝试编译的下载:https://github.com/COVESA/capicxx-core-tools

直接下载release: https://github.com/COVESA/capicxx-core-tools/releases
下这个:commonapi_core_generator.zip不要下载source的

6. CommonAPI SomeIP Runtime代码生成工具

这个也不建议编译,直接下载官方release。

想要尝试编译的下载:https://github.com/COVESA/capicxx-someip-tools

直接下载release:https://github.com/COVESA/capicxx-someip-tools/releases
下这个:commonapi_someip_generator.zip不要下载source的

至此SomeIP/CommonAPI环境搭建完毕,基础使用见下回分解。

如需联系,请加QQ:918619587

  • 21
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值