Common API Some/IP 环境的搭建

来源:互联网 发布:韩国idol和演员 知乎 编辑:程序博客网 时间:2024/06/07 16:39

SOME/IP是汽车行业使用的一个通信协议,符合autoSAR标准。

他的git是https://github.com/GENIVI/capicxx-core-tools/wiki

首先你的ubuntu需要安装cmake,git 和jre8

jre的版本高了可能不行

第一步:

$ git clone https://github.com/GENIVI/capicxx-core-runtime.git$ cd capicxx-core-runtime/$ lsAUTHORS  cmake  CMakeLists.txt  CommonAPI.pc.in  commonapi.spec.in  docx  doxygen.in  include  INSTALL  LICENSE  README  src<.>/capicxx-core-runtime$ mkdir build<.>/capicxx-core-runtime$ cd build<.>/capicxx-core-runtime/build$ cmake ..<.>/capicxx-core-runtime/build$ make
这个时候可能会出错 提示找不到 expat这个东西

我们进行安装:

wget http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gztar -xzf expat-2.1.0.tar.gz cd expat-2.1.0/./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabimakemake install
然后我们下载some/IP  和   vsome/IP

操作如下:

$ git clone https://github.com/GENIVI/capicxx-someip-runtime.git$ git clone https://github.com/GENIVI/vsomeip.git
编译vsome/ip

$ cd vsomeip<.>/vsomeip$ mkdir build<.>/vsomeip$ cd build<.>/vsomeip/build$ cmake ..<.>/vsomeip/build$ make
编译some/IP

$ cd capicxx-someip-runtime<.>/capicxx-someip-runtime$ mkdir build<.>/capicxx-someip-runtime$ cd build<.>/capicxx-someip-runtime/build$ cmake -DUSE_INSTALLED_COMMONAPI=OFF ..<.>/capicxx-someip-runtime/build$ make
这个时候cmake可能会出错,将上面的cmake改为如下:

cmake -D USE_INSTALLED_COMMONAPI=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..

你需要把代码生成器下载到你的工程中,这些你去

https://github.com/GENIVI/capicxx-core-tools/wiki

上面找,其实这上面都有详细的步骤,只是需要注意

1:编译commonAPI的时候遇到找不到expat的问题

2:编译some/ip  

cmake -DUSE_INSTALLED_COMMONAPI=OFF ..
这个时候可能报错

3:git上按照流程来的代码可能有问题,编译不过