# Change the default DDS implementation

**URL:** <https://discourse.openrobotics.org/t/change-the-default-dds-implementation/2813>\
**Category:** ROS General\
**Created:** [October 2, 2017, 4:43pm UTC](https://discourse.openrobotics.org/t/change-the-default-dds-implementation/2813 "2017-10-02T16:43:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrannonKing](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/brannonking/32/556_2.png) [@BrannonKing](https://discourse.openrobotics.org/u/BrannonKing)\
**Post date:** [October 2, 2017, 4:43pm UTC](https://discourse.openrobotics.org/t/change-the-default-dds-implementation/2813/1 "2017-10-02T16:43:02Z")

</div>

I read through the wiki document on changing the default DDS implementation. However, it does not answer the question. It says how to change the one used at runtime through use of the RMW\_IMPLEMENTATION environment variable. It also explains that they are chosen by alphabetical order if that variable is not set and FastRTPS was not compiled in. However, I want to compile in FastRTPS and OpenSplice and CoreDX support, but I want CoreDX to be used when RMW\_IMPLEMENTATION is absent. How do I make this happen?

---

<div class="post-metadata">

**Author:** ![BrannonKing](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/brannonking/32/556_2.png) [@BrannonKing](https://discourse.openrobotics.org/u/BrannonKing)\
**Post date:** [October 2, 2017, 5:24pm UTC](https://discourse.openrobotics.org/t/change-the-default-dds-implementation/2813/2 "2017-10-02T17:24:19Z")

</div>

I found the ordering in get\_default\_rmw\_implementation.cmake. However, it’s not clear to me how RMW\_IMPLEMENTATION affects this (at compile time). Does RMW\_IMPLEMENTATION being set during compile cause a single middleware to get compiled in or does it just change the default middleware?

---

<div class="post-metadata">

**Author:** ![marguedas](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/marguedas/32/1633_2.png) [@marguedas](https://discourse.openrobotics.org/u/marguedas)\
**Post date:** [October 2, 2017, 5:36pm UTC](https://discourse.openrobotics.org/t/change-the-default-dds-implementation/2813/3 "2017-10-02T17:36:43Z")

</div>

Hi @BrannonKing,

You can change the default rmw implementation by defining the `RMW_IMPLEMENTATION` environment variable before compiling (you will need to make sure to recompile the `rmw_implementation` package for the change to take effect).  
You can also change the default rmw implementation used by modifying [this file](https://github.com/ros2/rmw/blob/master/rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake#L38).

Setting this variable before compiling only changes which rmw\_implementation library will be opened by default. It still compiles all rmw implementation allowing you to select another one at runtime by setting `RMW_IMPLEMENTATION` if you want to.
