A work in progress Python binding for Eclipse Cyclone DDS.
Eclipse CycloneDDS Python requires Python version 3.6 or higher. It can be installed with included Cyclone DDS binaries or leveraging an existing Cyclone DDS installation by installing from source.
This is the most straightforward method to install Cyclone DDS Python, but there are a couple of caveats. The pre-built package:
- does not include the Cyclone DDS IDL compiler,
- has no support for DDS Security,
- has no support for shared memory via Iceoryx,
- comes with generic Cyclone DDS binaries that are not optimized per-platform.
If these are of concern, proceed with an installation from source. If not, running this installation is as simple as:
$ pip install cyclonedds
If you get permission errors you are using your system python. This is not recommended, we recommend using a virtual environment, poetry, pipenv or pyenv. If you just want to get going, you can add --user
to your pip command to install for the current user. See the Installing Python Modules Python documentation.
When installing from source you can make use of the full list of features offered by Cyclone DDS. First install Cyclone DDS as normal. Then continue by setting the CYCLONEDDS_HOME
environment variable to the installation location of Cyclone DDS, which is the same as what was used for CMAKE_INSTALL_PREFIX
. You will have to have this variable active any time you run Python code that depends on cyclonedds
so adding it to .bashrc
on Linux, ~/bash_profile
on MacOS or the System Variables in Windows can be helpful. This also allows you to switch, move or update Cyclone DDS without recompiling the Python package.
You can either install the source from the latest release from pypi:
$ export CYCLONEDDS_HOME="/path/to/cyclone"
$ pip install cyclonedds --no-binary :all:
or you can download the code from this repository to get the bleeding edge and directly install from your local filesystem:
$ git clone https://github.com/eclipse-cyclonedds/cyclonedds-python
$ cd cyclonedds-python
$ export CYCLONEDDS_HOME="/path/to/cyclone"
$ pip install ./src/pycdr
$ pip install ./src/cyclonedds
If you get permission errors you are using your system python. This is not recommended, we recommend using a virtual environment, poetry, pipenv or pyenv. If you just want to get going, you can add --user
to your pip command to install for the current user. See the Installing Python Modules Python documentation.
The code for the Python backend for the IDL compiler is contained in src/idlpy
and builds like any other cmake project:
$ git clone https://github.com/eclipse-cyclonedds/cyclonedds-python
$ cd cyclonedds-python/src/idlpy
$ mkdir build
$ cmake -DCMAKE_INSTALL_PREFIX=<install-location> \
-DCMAKE_PREFIX_PATH="<cyclonedds-install-location>" \
..
$ cmake --build .
$ cmake --build . --target install
For more details on this process take a look at the Eclipse Cyclone DDS C++ repository which explains the cmake process in depth.