ros2 / rosidl_typesupport

Packages which provide the typesupport for ROS messages and services
Apache License 2.0
13 stars 34 forks source link

Bail out if there is more than one typesupport but the user requests libraries to be built statically #10

Closed esteve closed 6 years ago

esteve commented 7 years ago

See https://github.com/ros2/rosidl/pull/183#issuecomment-289164782

Connects to https://github.com/ros2/ros2/issues/306

dirk-thomas commented 7 years ago

Holding this until the problem with ament_cmake_ros and gtest / gmock is resolved.

dirk-thomas commented 7 years ago

I am not yet sure how this is supposed to work / what should be allowed / what should be detected and warned about in cases where a user builds some packages with the option being set to building shared libraries and some other packages with the option being set to static libraries. See related comments on the other PR: https://github.com/ros2/rosidl/pull/183#pullrequestreview-33826335

dirk-thomas commented 7 years ago

We talked about this in the meeting today and concluded that we should ensure that at least the type support packages are built with a consistent / compatible setting of BUILD_SHARED_LIBS before merging this. Probably that means all type support packages are using the same flag - we don't have to support the case of mixing the library types across multiple type support packages.

esteve commented 7 years ago

@dirk-thomas sure, no problem, I can wait until you make those changes. Do you have a rough idea of what would those change involve? Is it just a matter of adding the ament_cmake_ros machinery to any package using rosidl_generate_interfaces to ensure that BUILD_SHARED_LIBS is set to SHARED or is there anything more? Thanks.

dirk-thomas commented 7 years ago

I don't know yet what exactly will be necessary to address this. I will likely not have time in the near future to work on this though.

david-wang-2015 commented 7 years ago

Hello @esteve, I'm trying to build demo statically but get many build errors when I setBUILD_SHARED_LIBS=OFF. Have you managed to build all the ROS2 stack statically? If so, can you show me how? Thanks.

esteve commented 7 years ago

@davwan01 hey! I've only succeeded up to rcl with the branches attached to https://github.com/ros2/ros2/issues/306 Most of them are already merged, but you'd still need:

https://github.com/ros2/rmw_fastrtps/pull/75 https://github.com/ros2/rosidl/pull/183

I haven't tried building rclcpp and anything else above because I've only built ROS2 statically for iOS where I use these Objective-C bindings:

https://github.com/esteve/ros2_objc

so I only need rcl and below to be statically built.

If you'd like to build statically the rest of ROS2, you'd need make a few changes to rclcpp so that it detects BUILD_SHARED_LIBS=OFF, but there may be other issues with the lifecycle subsystem.

In any case, could you paste here the build errors you've encountered? Maybe I can help with that :-) Thanks!

david-wang-2015 commented 7 years ago

@esteve , thanks for the details you shared. I will try and back to you.

david-wang-2015 commented 7 years ago

@esteve I got many errors while building rclcpp. I'm going to look inside and try to fix them.

esteve commented 7 years ago

@davwan01 could you share the error log somewhere (a GitHub gist would be fine)? I might be able to help you with the errors.

dirk-thomas commented 6 years ago

Closing in favor of #19.