Ask Your Question
0

ROS static build

asked 2019-02-05 09:56:40 -0500

2ROS0 gravatar image

updated 2019-02-05 16:38:28 -0500

Hi,

I'm looking to install static versions of ROS libraries in a remote system. Is there a tarball that can be downloaded? The apt packages don't seem to contain static versions.

Google brings me to the rosbuild page.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2019-02-05 16:12:53 -0500

ahendrix gravatar image

I'm not aware of any publicly available static builds of ROS.

tl;dr: abandon hope all ye who enter here

The company I work for uses a heavily modified version of ROS with a different build system, and we have had significant trouble when attempting to build and statically link the various libraries that make up roscpp. I was eventually able to get static builds to work, but it took several months of development effort and a number of changes to the roscpp_common and ros_comm stacks.

The core problem with linking ROS statically is that the initialization and destruction order of globals in a statically linked binary is not defined, and ROS has a lot of global singletons that rely upon each other. Without any kind of enforcement of construction/destruction order, we were seeing a lot of core dumps during node shutdown. (upstream ROS gets around this because the globals are spread across many shared libraries, and the shared library loading order results in correct global construction order)

It is possible to enforce construction and destruction order by using static variables in accessor functions instead of globals, but the sheer number of places where this had to be done made it a substantial task.

This size of the resulting patches and the lack of consistent maintenance on the ros_comm repo means that it is very unlikely that these patches would be accepted if I submitted them.

The general transform that needs to be applied looks like this:

Foo fooSingleton;

becomes

Foo& getFooSingleton() {
    static Foo fooSingleton;
    return fooSingleton;
}
edit flag offensive delete link more

Comments

1

I asked a similar question a while back: https://answers.ros.org/question/2590...

ahendrix gravatar image ahendrix  ( 2019-02-05 16:13:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-02-05 09:56:40 -0500

Seen: 322 times

Last updated: Feb 05 '19