RTI Connext DDS Micro is RTI's product targeting small footprint devices, and it was also the basis for RTI Connext DDS Cert, a product for small footprint, safety critical use cases. While Connext DDS Micro is distributed with binaries for a few common architectures, it is also distributed with the full source-code since we anticipate that the majority of our users will compile, and even port, to their specific platform.
The Raspberry Pi is a popular IoT device with numerous sensors and add-ons available, and is a great device to run Connext DDS Micro on. In this blogpost, I'll cover how to easily compile Connext DDS Micro for the Raspberry Pi. Please note that porting Connext DDS Micro to a new OS/platform is not covered in this blogpost!
CMake is the preferred tool to build Connext DDS Micro because it simplifies configuring the Connext DDS Micro build options. Note that CMake itself does not compile anything. CMake is used to generate build files for a number of environments, such as make, Eclipse CDT, Xcode and Visual Studio. Once you have your build file, any of the tools I mentioned can then be used to build Connext DDS Micro. This system makes it easier to supporting building Connext DDS Micro with different tools. CMake is easy to install with prebuilt binaries and has no dependencies on external tools. If you have not yet installed CMake, please do so now.
We'll assume a Linux development host for the remainder of this blogpost. Start the CMake GUI from a terminal window, preferably in the top-level Connext DDS Micro source directory. Note that there are two directories under source: Unix and Windows. The only difference between these two is that the source in the Unix directory has Unix style line-endings, and the source in the Windows directory has Windows style line-endings.
> cmake-gui .
(Note the period after cmake-gui!)
Make sure the path to the source and binaries is the location of the Connext DDS Micro source-code.
- Press "Configure".
- Select a generator (I typically use Eclipse CDT Unix Makefiles).
- Select "Specify options for cross-compiling"
- Type "Linux" as Operating System
- Type in a Linux version number
- Type arm for Processor
- Select the C and C++ compiler you want to use (full path to the executables).
- Select the compiler root as the Target Root. RTI Connext Micro does not rely on any libraries other than libc and libc++
- Press "Done"
- Press "Configure"
- Check "Grouped"
- Expand RTI Connext Micro and select your build options.
- Type a target name for RTIMICRO_BUILD_TARGET_NAME, for example armv6Linux3gcc4. The target name is sent as part of the participant discovery but is not used by RTI Connext Micro.
- Press "Configure". All red lines should disappear.
- Press "Generate".
- Exit the GUI.
In the terminal window:
> make VERBOSE=1
The libraries will be placed in:
When the libraries are built "RTI Style" the libraries will have the same names as the ones RTI distributes. The libraries are:
- rtime is the core library, including the DDS C API
- discdpde is the Dynamic Participant Dynamic Endpoint plugin
- discdpse is Dynamic Participant Static Endpoint plugin
- rhsm is Reader History plugin
- whsm is Writer History plugin
- cpp is the C++ API
The following conventions are used for library naming:
- Static libraries have a z suffix, shared libraries does not have an additional suffix
- Debug libraries have a d suffix, release libraries does not have an additional suffix
You can also build a single library if that is easier to work with. For more advanced build configurations, such as compiler and linker options, run cmake-gui again, and this time check the "Advanced" checkbox. Next, expand CMAKE to see available build options.
This blogpost only described recompiling Connext DDS Micro for a supported platform (Linux and GCC). The next step is to port Connext DDS Micro to a new OS, or use an unsupported system or compiler.