open-rmf / rmf_site

Experimental visualizer for dense buildings in RMF
32 stars 13 forks source link

Consider removing dynamic linking optimization #202

Closed luca-della-vedova closed 7 months ago

luca-della-vedova commented 7 months ago

The dynamic linking optimization that we use here does reduce compile times quite significantly (on my machine it went from 55s to 46s), but as noted in the docs it makes redistributing the app more tricky.

Specifically, because (probably?) colcon expects the binary to be statically linked, building the package with colcon and trying to run it results in the following error:

[...] error while loading shared libraries: libbevy_dylib-165be36195c0d4d6.so: cannot open shared object file: No such file or directory

On the other hand, if we remove the optimization we get longer compile times but ros2 run works like a charm. It's a tradeoff but I believe for greater integration with ROS 2 we should probably drop the dynamic linking (maybe only use it on the local developer workstation if they really want?)

CC @Yadunund @mxgrey for feedback

Yadunund commented 7 months ago

Is it possible to conditionally enable the optimization based on some cargo build args?

luca-della-vedova commented 7 months ago

I believe we could do a feature flag so people that want to build with dynamic linking could do cargo run --features dynamic-linking [...], that is some extra typing but I'm not sure there is a better way to do it