FastDDS cmake 安装 on linux

FastDDS 源码安装:

1. 安装 foonathan memory

# ----------------------
# for foonathan_memory
# ----------------------
mkdir ~/Fast-DDS && cd ~/Fast-DDS
git clone https://github.com/eProsima/foonathan_memory_vendor.git
mkdir foonathan_memory_vendor/build && cd foonathan_memory_vendor/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_SHARED_LIBS=ON
sudo cmake --build . --target install

2. 安装 fast CDR

cd ~/Fast-DDS
git clone https://github.com/eProsima/Fast-CDR.git
mkdir Fast-CDR/build && cd Fast-CDR/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_SHARED_LIBS=ON
sudo cmake --build . --target install

3. 安装 eProsima Fast DDS

cd ~/Fast-DDS
git clone https://github.com/eProsima/Fast-DDS.git
mkdir Fast-DDS/build && cd Fast-DDS/build
cmake ..  -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_SHARED_LIBS=ON
sudo cmake --build . --target install

echo 'export LD_LIBRARY_PATH=/usr/local/lib/' >> ~/.bashrc

FastDDS 样例编译运行:

1. 编译

cd <Your DDS Directory>/Fast-DDS/examples/cpp/dds/HelloWorldExample/
mkdir build && cd build
cmake ../ && make

2. 运行

- Terminal 1

./DDSHelloWorldExample publisher

- Terminal 2

./DDSHelloWorldExample subscriber

- 运行结果

官网安装步骤链接:3. Linux installation from sources — Fast DDS 2.7.1 documentation (eprosima.com)https://fast-dds.docs.eprosima.com/en/latest/installation/sources/sources_linux.html#global-installation-sl

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值