Robotics StackExchange | Archived questions

Static Build of a ROS application

Hey all ,

I am currently working on a embedded board (very limited support ) to be used in the Automotive industry as a sensor/actuator interface device (with CAN and High Speed Eth interfaces ).

Currently I am trying to build a Talker , Subscriber to be put on the target device .

I dont want to go through catkin to take care of my ROS dependencies . I know that catkin will link all the .so files by adding the locations in the env variables

Is there any way to build a simple ROS application using static build so that i can simply copy the standalone executable and verify its working on my target system

PS:- I have tried building the C++ application using regular CMake with --static argument , but doesnt seem to help much .

Kindly point out to me if its really worth spending time building a static build just for POC(Proof Of Concept ) If someone out there has attempted to do something like this , please share your insights .

EDIT #1 (2/18/2019)

Important Links i came accross https://ro-che.info/articles/2016-09-09-static-binaries-scientific-computing

http://statifier.sourceforge.net/

Statifier is one tool that might be useful .

Use this command line to compile your code directly with g++:

g++ yourtest.cpp -o yourtest -I/opt/ros/indigo/include -L/opt/ros/indigo/lib \ -Wl,-rpath,/opt/ros/indigo/lib -lroscpp -lrosconsole -lrostime \ -lroscppserialization -lboostsystem -lboost_thread -pthread -lactionlib

I have there should be ways within g++ to build statically.

Asked by chrissunny94 on 2019-02-11 06:17:51 UTC

Comments

Please see #q314797 for a very recent discussion of the same topic.

Asked by gvdhoorn on 2019-02-11 06:32:03 UTC

Alright , thanks .

I guess its a very narrow and pointless path to take . "Trying to build apps statically "

Asked by chrissunny94 on 2019-02-13 02:24:47 UTC

No, it's a legitimate thing to ask, but it's just something that takes a little more work with ROS 1 (not sure about ROS 2).

Asked by gvdhoorn on 2019-02-13 02:39:41 UTC

@gvdhoorn , has statifier been of any help to you ?

Asked by chrissunny94 on 2019-02-18 00:35:29 UTC

I've not used that tool, so I cannot comment.

Asked by gvdhoorn on 2019-02-18 02:24:01 UTC

Answers