# dds_shm **Repository Path**: urlyy/dds_shm ## Basic Information - **Project Name**: dds_shm - **Description**: Cyclone DDS+iceorxy实现基于共享内存的订阅发布,并裁剪无关代码 - **Primary Language**: C - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 7 - **Created**: 2026-01-15 - **Last Updated**: 2026-04-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 一、安装 ## 1. os与项目版本 ubuntu-22.04/ubuntu24.04 以下代码已在该仓库中下好,这里是下载细节。不需要执行。 ```bash git clone https://github.com/eclipse-iceoryx/iceoryx.git -b release_2.0 cd iceoryx rm -rf .git cd .. git clone https://github.com/eclipse-cyclonedds/cyclonedds.git cd cyclonedds # 固定使用的dds版本为这次提交 git checkout ea9f8f7ba8c17b7585a2d4838ee25cd1cb2648a2 rm -rf .git # iceoryx构建时需要cpptoml库。为了避免构建时网络下载,本项目已将cpptoml v0.1.1版本预先下载到`dependencies`目录。 mkdir dependencies cd dependencies wget https://github.com/skystrife/cpptoml/archive/refs/tags/v0.1.1.tar.gz -O cpptoml-v0.1.1.tar.gz ``` ## 2. 环境 ```bash sudo apt install -y git build-essential cmake libssl-dev libcurl4-openssl-dev sudo apt install -y libacl1-dev libncurses5-dev pkg-config maven ``` ## 3.1 简单构建方式 在`~`目录下clone本仓库,然后依次执行`scripts/rebuild_iox.sh`和`scripts/rebuild_dds.sh`。 ## 3.2 手动构建方式 ### 3.2.1 构建iceoryx ```bash cd iceoryx cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DROUDI_ENVIRONMENT=on -DBUILD_SHARED_LIBS=ON -Hiceoryx_meta cmake --build build --config Release --target install ``` ### 3.2.2 构建集成了iceoryx的cyclonedds ```bash cd cyclonedds # 注意修改最后面的路径 cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DENABLE_ICEORYX=On -DBUILD_EXAMPLES=On -DCMAKE_PREFIX_PATH=/path/to/iceoryx/install/ cmake --build build --config Release --target install ``` # 二、配置文件 最基本的配置已经写在 `config` 目录里了。 建议环境变量写在文件里: `vim ~/.bashrc` 注意改路径。 ```bash export CYCLONEDDS_URI=/path/to/config/dds_config.xml export LD_LIBRARY_PATH=/path/to/iceoryx/install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH=/path/to/cyclonedds/install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ``` # 三、测试 先编译例子 ```bash cd /path/to/cyclonedds/examples/loan mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=/path/to/cyclonedds/install .. && make ``` 开三个终端。 终端1: ```bash /path/to/iceoryx/build/iox-roudi -c /path/to/config/iox_config.toml ``` 终端2: ```bash cd /path/to/cyclonedds/examples/loan/build ./LoanPublisher ``` 终端3: ```bash cd /path/to/cyclonedds/examples/loan/build ./LoanSubscriber ``` ## **一键测试方式** 如果本项目在`~`目录下,可以直接依次运行`scripts/remake_example.sh`和`python scripts/run_loan.py`。 ## 对于roudi的启动方式 注意要用`~/dds_shm/iceoryx/build/iox-roudi -m off -c ~/dds_shm/config/iox_config.toml` 关闭进程检测,不然会有问题。