OpenDDS / OpenDDS

OpenDDS is an open source C++ implementation of the Object Management Group (OMG) Data Distribution Service (DDS). OpenDDS also supports Java bindings through JNI.
http://www.opendds.org
Other
1.28k stars 463 forks source link

Configure ACE/TAO Directly Using CMake #4578

Open iguessthislldo opened 1 month ago

iguessthislldo commented 1 month ago

https://github.com/DOCGroup/ACE_TAO/issues/266 should be considered the upstream issue, but this documents the issue from our perceptive.

Right now, when building OpenDDS with CMake, if you don't pass OPENDDS_ACE, it will attempt to download and configure ACE/TAO using MPC (get_ace_tao.cmake, build_ace_tao.cmake, configure_ace_tao.pl). This workaround works in basic cases and I was optimistic about it at first, but every single build parameter has to be translated from CMake to MPC/Make/MSBuild and every platform has to be hardcoded. This caused has problems when the CMake support was developed, specifically trying to make the building of ACE/TAO seamless, and has caused more issues since the CMake support was released (See #4381, #4375, #4478, #4531, #4328).

This would also allow allow easy installation of ACE/TAO along side OpenDDS, including on Windows. Right now OpenDDS builds ACE/TAO, but doesn't install it.

The proper solution to these and the inevitable future problems with the current approach is to cut MPC out of the build process entirely and add proper CMake support to ACE/TAO. There's a couple of ways we could go about it:

  1. OpenDDS's CMakeLists.txt were essentially written from scratch. This is possible but daunting for the tests. For ACE/TAO this is daunting for not just the tests, but all the libraries and programs sitting around. This almost certainly not what we're going to do.
  2. Build on @ocielliottc's work in https://github.com/DOCGroup/MPC/pull/164. This still requires MPC so would need to be changed to the point where it can generate independent CMakeLists.txt files that can be committed.
  3. Build on @huangminghuang's work in https://github.com/huangminghuang/ACE_TAO/tree/cmake and https://github.com/huangminghuang/OpenDDS/tree/cmake. This used a python program separate from MPC to generate the CMake projects.

I created a proof of concept of 1 (ACE_TAO, OpenDDS) in order to test what's needed for IDL generation for TAO. This can build a subset of ACE/TAO and OpenDDS needed for the RTPS Devguide example and run it all in less than 45 seconds on my machine. This requires Ninja and has only been tested on Ubuntu.

git clone https://github.com/iguessthislldo/OpenDDS --branch igtd/pure-cmake-poc --depth 1
cd OpenDDS
git clone https://github.com/iguessthislldo/ACE_TAO --branch igtd/pure-cmake-poc --depth 1
cmake -S . -B build -G Ninja -DCMAKE_UNITY_BUILD=TRUE && cmake --build build --verbose
(cd build/DevGuideExamples/DCPS/Messenger && ctest --verbose)
iguessthislldo commented 1 month ago

Some more thoughts that would probably need to be addressed regardless of how we do this: