Skip to content
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

Merged
merged 23 commits into from
Jul 2, 2021
Merged

Add Fast dds #5968

merged 23 commits into from
Jul 2, 2021

Conversation

dotChris90
Copy link
Contributor

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 :)


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

Copy link
Contributor

@prince-chrismc prince-chrismc left a 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

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":
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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 ;)

Comment on lines 177 to 179
self.cpp_info.components["fastrtps"].system_libs = [
"pthread"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.cpp_info.components["fastrtps"].system_libs = [
"pthread"
]
self.cpp_info.components["fastrtps"].system_libs.append("pthread")

Comment on lines 181 to 185
self.cpp_info.components["fastrtps"].system_libs = [
"rt",
"dl",
"atomic"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.cpp_info.components["fastrtps"].system_libs = [
"rt",
"dl",
"atomic"
]
self.cpp_info.components["fastrtps"].system_libs.extends(["rt", "dl", "atomic"])

Comment on lines 7 to 9
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Copy link
Contributor

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)

Suggested change
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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))

@dotChris90 dotChris90 closed this Jun 30, 2021
@dotChris90 dotChris90 reopened this Jun 30, 2021
@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

All green in build 10 (97b799770e357c70ce5a0d37a4476617530d022a):

  • fast-dds/2.3.2@:
    All packages built successfully! (All logs)

@dotChris90
Copy link
Contributor Author

Wuhu - finally :D

@dotChris90 dotChris90 requested a review from danimtb July 1, 2021 12:49
@conan-center-bot conan-center-bot merged commit ecffe66 into conan-io:master Jul 2, 2021
Comment on lines +206 to +207
self.cpp_info.components["tools"].name = "tools"
self.cpp_info.components["tools"].bindirs = [os.path.join("bin","tools")]
Copy link
Contributor

@SpaceIm SpaceIm Jul 2, 2021

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).

Copy link
Contributor Author

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"
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@gbellizio
Copy link

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:

[foonathan::memory] Allocator foonathan::memory::memory_pool (at 0x4697c8) received invalid size/alignment 56, max supported is 48terminate called after throwing an instance of 'foonathan::memory::bad_node_size'
  what():  allocation node size exceeds supported maximum of allocator

I guess the issue is due to the fact that the recipe requires foonathan-memery v 0.7.0 library, but Fast-DDS try to use a patched snapshot at commit c619113 (from https://github.com/eProsima/foonathan_memory_vendor/blob/master/CMakeLists.txt line 79)

@dotChris90
Copy link
Contributor Author

@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?

@gbellizio
Copy link

gbellizio commented Aug 6, 2021

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.

@dotChris90
Copy link
Contributor Author

dotChris90 commented Aug 6, 2021

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?

@gbellizio
Copy link

fast-dds/2.3.3

@dotChris90
Copy link
Contributor Author

dotChris90 commented Aug 7, 2021

@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
But i can confirm that "clean workspace" does not help and it's deterministic.

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.

@dotChris90
Copy link
Contributor Author

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.

@dotChris90
Copy link
Contributor Author

dotChris90 commented Aug 13, 2021

@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.

grafik

@dotChris90
Copy link
Contributor Author

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

@gbellizio
Copy link

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:

[foonathan::memory] Buffer overflow at address 0x1d65520 detected, corresponding memory block 0x1d654f0 has only size 48.[1]    18046 IOT instruction (core dumped)  ./DDSHelloWorldExample publisher

image

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:

image

@dotChris90
Copy link
Contributor Author

@gbellizio - thanks for pointing it out .... i will try to discuss with eprosima together best =.=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants