relocate ros2 install from a source build
What is the best way to move a ros2 installation from one machine to another? Is it a matter of just copying the entire /opt/ros
directory? or are their other dependencies as well? The rub and motivating case is that I'm building ros2 galactic from source on Ubuntu 18.04. It would be nice to be able to install on a number of machines without have to build from source on each one.
Of course there are "other dependencies". If only the many build dependencies used to build your binaries, and the related run dependencies (ie: runtime libraries, etc).
Care to elaborate what they might be?...or maybe a better question is what dependencies are needed specifically to build from source that aren't needed for normal use? This be passed to other machines via a docker image and I'd like to keep the image as slim as reasonably possible.
When building from source, you go through the sections to setup your system in order for the build to succeed.
Almost all of the steps where you use
pip
orapt
install dependencies.ROS (1 or 2, doesn't matter) is like an SDK: it's a set of building blocks which you use to create other applications with. And in order to be able to build those applications, you almost invariably need at least the exact same set of dependencies (build and run) as you need to build ROS itself.
So while it is possible to figure out the run dependencies (
rosdep
supports querying packages for just theirexec_depend
s fi), I'm wondering whether that will actually work. If you're looking to only deploy an application, you can do this. If those other installs are going to be used for any sort of development (ie: build a ...(more)If this is more than a one-time-thing, you may want to look at things like Clearpaths bundle approach, or Bloom's support for generating
debian
packaging, or try to mimic the way the Linux tarball is built (not documented there, just linking to where that tarball is used to install ROS 2).As a direct answer to the question "how do I only install the
exec_depend
s of packages:rosdep install --from-paths /path/to/your/ros/install -i --dependency-types=exec
. Note that this is a relatively new addition, and many packages don't distinguish between theirexec
orbuild
dependencies. Your mileage may vary.