Ubuntu 18.04 fastdds编译

1.下载fastdds

git clone https://github.com/eProsima/Fast-DDS.git

cd Fast-DDS

下载完后出现目录Fast-DDS,cd进入Fast-DDS目录,然后切换到2.14.1的分支,master分支编译失败

git checkout remotes/origin/2.14.1

git branch -a

2.下载子模块

git submodule update --init --recursive

3.下载、编译memory

git clone https://github.com/foonathan/memory

mkdir memory/build

cd memory/build

cmake .. -DCMAKE_INSTALL_PREFIX=~/Fast-DDS/install -DBUILD_SHARED_LIBS=ON

cmake --build . --target install

或make install

4.下载、编译fastcdr 

git clone https://github.com/eProsima/Fast-CDR.git

mkdir Fast-CDR/build

cd Fast-CDR/build

cmake .. -DCMAKE_INSTALL_PREFIX=~/Fast-DDS/install

cmake --build . --target install

5.boost库编译

wget  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

cd boost_1_83_0

./bootstrap.sh --prefix=/home/dds/Fast-DDS/install

./b2 -j32

./b2 install

6.asio编译

cd Fast-DDS/thirdparty/asio/asio/

sudo apt install autoconf

./autogen.sh

./configure --with-boost=/home/dds/Fast-DDS/install/include

make -j32

sudo make install

7.fastdds编译

mkdir Fast-DDS/build
cd Fast-DDS/build
cmake .. -DCMAKE_INSTALL_PREFIX=/home/dds/Fast-DDS/install
make -j32
make install

8.编译测试程序

cd ~/Fast-DDS/Fast-DDS/examples/cpp/dds/HelloWorldExample

mkdir build

cd build

cmake -DCMAKE_INSTALL_PREFIX=/home/dds/Fast-DDS/install

make

9.设置环境变量

vim ~/.bashrc

export LD_LIBRARY_PATH=/home/farben/Fast-DDS/install/lib

source ~/.bashrc

10.运行测试程序

./DDSHelloWorldExample publisher
./DDSHelloWorldExample subscriber

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值