Bootstrap

FastDDS安装测试记录

 1、安装依赖的软件

sudo apt install cmake g++ python3-pip wget git
sudo apt install libasio-dev libtinyxml2-dev
sudo apt install libssl-dev
sudo apt install libp11-dev libengine-pkcs11-openssl
sudo apt install softhsm2

 

2、安装foonathan_memory_vendor

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
cmake --build . --target install

3、安装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/
cmake --build . --target install

4、安装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=~/Fast-DDS/install -DCOMPILE_EXAMPLES=ON  // 编译示例加上
cmake --build . --target install

安装fastdds的时候会报关于asio的错误,这里把版本讲一下,解决方案来源:

Fast-DDS/src/cpp/rtps/transport/TCPChannelResource.h:279:45 error! · eProsima/Fast-DDS · Discussion #5371 · GitHub

 安装包下载:https://sourceforge.net/projects/asio/files/asio/1.30.2%20%28Stable%29/

将安装包下载安装:(参考linux安装安装 Asio 库_ubuntu安装asio-CSDN博客)

unzip ...

./configure

sudo make install 

之后修改库加载路径

export LD_LIBRARY_PATH=/usr/local/lib/

5、测试:

示例代码:Fast-DDS/Fast-DDS/build/examples/cpp/hello_world$

./hello_world publisher

./hello_world subscriber

;