当前位置:首页 > 编程笔记 > 正文
已解决

fastdds源码编译安装

来自网友在路上 157857提问 提问时间:2023-10-21 03:23:42阅读次数: 57

最佳答案 问答题库578位专家为你答疑解惑

如何根据源码编译 fastdds

如何根据源码编译 fastdds

这里是为了根据源码编译一个 fastdds 。
fastdds 依赖 fastcdr Asio TinyXMl2

下载 fastdds 源码

git clone git@github.com:eProsima/Fast-DDS.git
进入 下载好的 fastdds 中执行
git submodule update --init --recursive
下载3方库。其中需要编译 fastcdr, asio , tinyxml2 foonathan_memory_vendor.
注意其中的 asio 依赖boost。 但是这个asio 依赖的版本相对较高,1.55.0 之上,我使用的是 1.83.0 版本。

  1. foonathan_memory_vendor 安装
    git clone https://github.com/eProsima/foonathan_memory_vendor.git
    mkdir foonathan_memory_vendor/build
    cd foonathan_memory_vendor/build
    cmake … -DCMAKE_INSTALL_PREFIX=~/Fast-DDS/install -DBUILD_SHARED_LIBS=ON
    make install -j32将代码片显示选择的高亮样式 进行展示;

  2. fastcdr 安装
    进去3方库Fast-Cdr 中
    mkdir Fast-CDR/build
    cd Fast-CDR/build
    cmake … -DCMAKE_INSTALL_PREFIX=~/Fast-DDS/install
    make install

  3. tinyxml2 安装
    mkdir tinyxml2/build
    cmake … -DCMAKE_INSTALL_PREFIX=~/Fast-DDS/install
    make install

  4. asio 安装
    asio 安装比较麻烦,需要先安装 boost。 这里亲身验证 boost 1.83.0 可行 1.55.0 之前,包括1,55.0 不行
    安装 boost:
    wget -O boost_1_83_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.gz/download
    tar -zxvf boost_1_83_0.tar.gz
    ./bootstrap.sh --prefix=~/Fast-DDS/install
    ./b2 -j32
    ./b2 install
    安装 asio:
    进入asio
    ./configure --with-boost=~/Fast-DDS/install/include
    make -j32
    make install

  5. fastdds 编译
    至此fastdds 需要的组件已经编译完成,可以开始编译fastdds
    mkdir Fast-DDS/build
    cd Fast-DDS/build
    cmake … -DCMAKE_INSTALL_PREFIX=~/Fast-DDS/install
    make -j32
    make install

验证 fastdds 是否安装成功

参考:
https://fast-dds.docs.eprosima.com/en/latest/fastddscli/cli/cli.html

至此fastdds 安装成功,整个过程网络ok的话,还是比较顺利,我差不多用了1个小时编译完成,从开始下载fastdds 开始

整个安装过程参考:
https://fast-dds.docs.eprosima.com/en/latest/installation/sources/sources_linux.html

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"fastdds源码编译安装":http://eshow365.cn/6-20565-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!