-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Fast dds #5968
Add Fast dds #5968
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please shrink the test_package? seems like a lot to make sure the contents are all inplace... but I am not familiar with this library
recipes/fast-dds/all/conanfile.py
Outdated
version = tools.Version(self.settings.compiler.version) | ||
if compiler.get_safe("cppstd"): | ||
tools.check_min_cppstd(self, 11) | ||
if os == "Linux" and compiler == "gcc" and version < "5": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a template conan-io/conan#8002 you can reuse to also print a warning for the consumer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got your point - i took the dictionary for C++11 from https://github.com/conan-io/conan-center-index/blob/41d4fbb8c218f9d938ccb8b9d888bff52002e62e/recipes/cxxopts/all/conanfile.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and btw - nice idea - to have a standard template here ;)
recipes/fast-dds/all/conanfile.py
Outdated
self.cpp_info.components["fastrtps"].system_libs = [ | ||
"pthread" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.cpp_info.components["fastrtps"].system_libs = [ | |
"pthread" | |
] | |
self.cpp_info.components["fastrtps"].system_libs.append("pthread") |
recipes/fast-dds/all/conanfile.py
Outdated
self.cpp_info.components["fastrtps"].system_libs = [ | ||
"rt", | ||
"dl", | ||
"atomic" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.cpp_info.components["fastrtps"].system_libs = [ | |
"rt", | |
"dl", | |
"atomic" | |
] | |
self.cpp_info.components["fastrtps"].system_libs.extends(["rt", "dl", "atomic"]) |
recipes/fast-dds/all/CMakeLists.txt
Outdated
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are blocking older compilers this should not be required (it also blocks consumers from setting the cppstd
settings)
set(CMAKE_CXX_STANDARD 11) | |
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
recipes/fast-dds/all/conanfile.py
Outdated
if ("MT" in self.settings.compiler.runtime and self.options.shared): | ||
# This combination leads to an fast-dds error when linking | ||
# linking dynamic '*.dll' and static MT runtime | ||
raise ConanInvalidConfiguration("Mixing a dll eprosima library with a static runtime is a bad idea") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ConanInvalidConfiguration("Mixing a dll eprosima library with a static runtime is a bad idea") | |
raise ConanInvalidConfiguration("Mixing a dll {} library with a static runtime is a bad idea".format(self.name)) |
This comment has been minimized.
This comment has been minimized.
All green in build 10 (
|
Wuhu - finally :D |
self.cpp_info.components["tools"].name = "tools" | ||
self.cpp_info.components["tools"].bindirs = [os.path.join("bin","tools")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As usual, too generic for a conan component name where pkg_config name is not overriden. Anyway this component doesn't exist upstream (there are tools, but their targets are not exported).
I advice also to be explicit on the type of "names" (names["cmake_find_package"] etc, this library doesn't provide official pkgconfig files for example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be resolved in #6429
self.cpp_info.components["fastrtps"].build_modules["cmake_find_package"] = [self._module_file_rel_path] | ||
self.cpp_info.components["fastrtps"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] | ||
# component fast-discovery | ||
self.cpp_info.components["fast-discovery"].name = "fast-discovery" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fast-discovery-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh Jesus.... Damn.... I would rise an issue and assign it to myself. And in a separate PR resolve the issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be resolved in #6429
Hi, I tried to compile HelloWorld example program that comes with Fast-DDS source code as a standalone CMake project using the provided Conan recipe. The process crashes as soon as the publisher starts (or the subscriber, depends on which order publisher and subscriber are executed). The crashing process prints out the following on terminal:
I guess the issue is due to the fact that the recipe requires |
@gbellizio - thanks for trying it out - i though at the time of creation i checked that V0.7.0 has already included the patches but i can check again - the test package should validate the publishing process --> https://github.com/conan-io/conan-center-index/blob/master/recipes/fast-dds/all/test_package/test_package.cpp. Can you give some small details like Windows or Linux build and cross build or normal? :) the normal HelloWorld - or with shared memory? |
Hi @dotChris90 and thanks for fast reply. My build environment is Fedora Linux 34 using latest version of conan (v. 1.39.0), g++ 11. I compiled the normal version of HelloWorkd example by copying source files from Fast-DDS code base into a standalone CMake project. By downloading Fast-DDS source code from github and building it by following instructions on project page (which makes use of patched version of foonathan-memory, https://github.com/eProsima/foonathan_memory_vendor.git) the same example successfully runs. foonathan_memory_vendor.git downloads code form the original repository and switches to commit c619113 which is two years old. By looking at the test package I noted that only the publisher is instantiated. The issue happens as soon as the subscriber joins. |
Thanks for the hint. I will try it out at weekend. :) I thought before I was trying out publishing subscription in one process. After i was reducing to minimal example (publishing in test_package). But I have to admit : not tried out two separated process. One last question : which version u referencing? |
fast-dds/2.3.3 |
@gbellizio - i did setup on fedora and ubuntu system - both the same with 2.3.3 and 2.3.2. yes you are right -.- building, linking everything works like expected. But on runtime - crash - all 3 examples - normal HelloWorld, shared memory and TCP. ultimate worst case -.- I read on github some other people where facing this issue too --> foonathan/memory#123 I will create an issue (because this PR already merged), mention that i work on it and compare their foonathan patch with the 0.7.0 again. I took the 0.7.0 because packaging should work with versions and not commit_ids .... but maybe i was too quick ... i keep you updated. |
I saw that 0.7.0 truly have more changes to 0.6.2 than i though - especially related to errors and node_sizes. i will try 0.6.2 - then with a patched 0.6.2 and then discuss with others how to handle it. |
@gbellizio i actually found a quick solution (sorry took long since recovery from covid vaccination ^^). the 0.7.0 memory version will run if! i compile with the extra option self._cmake.definitions["FOONATHAN_MEMORY_CHECK_ALLOCATION_SIZE"] = False when this tiny change was included - then i could run all three examples - normal Helloworld, tcp, shared memory. |
I will add this option to the memory package and fast-dds will use the option = False as long as i come up with a better solution. i maybe asking fast-dds team why they dont reference 0.7.0 |
Hi @dotChris90. I just gave it a try by disabling the size checks as you suggested. Unfortunately, runtime errors still persist, at least in debug mode:
In release mode the example program works as expected, but I'm not sure we are safe from memory allocation issues for more complex (and realistic) code: |
@gbellizio - thanks for pointing it out .... i will try to discuss with eprosima together best =.= |
Specify library name and version: fast-dds/2.3.2 (also known as fastrtps/2.3.2)
Fast-DDS is an implementation of the DDS standard for IoT devices.
DDS is an awesome pub/sub mechanism which has a lot of time critical important properties for industry.
I didnt find so far a DDS implementation in CCI - that has to change now :)
conan-center hook activated.