I have not used docker for this, so I can’t fully answer. Someone else will end up with the end answer, but here are some details you’ll probably need to know first…
Some environments will emulate others, in which case you might end up using “native” tools. If you are running on a PC environment, but producing output to run on arm64, then you are cross compiling, and this is what my statements below assume you are doing (docker might be doing something different).
When you compile for a kernel there is no need to link to a library, and no need for libraries. Also known as kernel space. The only tool this needs is a cross compiler.
You’re compiling for an end user program, which is user space, and not kernel space. When this happens you need a cross compiler plus a linker and plus the libraries to link against. The libraries and linker are the user space requirements and it is no longer “bare metal” (it expects a user space environment). If this is a cross compile environment, then your linker must be a cross linker which runs in the PC environment, but links arm64 libraries. The libraries themselves must be arm64, and nothing on the PC can be used for that.
Beware that some libraries will link with yet other libraries. If a program links to some library “libexample.so
”, it is quite possible that “libexample.so
” itself links to something like “libc.so
”. Whatever your program links against, either directly or indirectly, must be copied from the Jetson to your cross compile environment. A typical cross tool environment would include only the most basic of libraries, and anything else would have to be provided by you.
If your Jetson is capable of running this program (meaning the linked libraries are present already), then you can see a list of every library the linker sees:
ldconfig -p
Your program won’t necessarily use anything except a few of those. If you happen to know what your program build links against, then you can see if the requirement exists on the Jetson via “ldconfig -p
”. If your cross compile environment has a cross linker already, then you could copy the libraries you need from the Jetson to the cross link path on the PC.
On the Jetson itself, if you know the name of a library you must use, then you could run the ldd
command against that library to see what it is itself linked against. Example:
ldd /usr/lib/libexample.so
You can end up spending a lot of time tracing those manually. However, if you have an eMMC model, then you can clone and use the loopback mounted raw clone on the host PC and point your cross linker at this and everything you have on the Jetson will become available as a library on the PC (you’d still need the cross linker and cross compiler). If it is an SD card Jetson, then you can mount the SD card partition directly (or copy it to the PC via dd
and keep the SD card on the Jetson…a good idea since this is a backup too).
The libraries on the Jetson itself might be insufficient if you have not previously set up for running your software, e.g., since you are building QT applications, perhaps you’ve never run a QT program on the Jetson itself and perhaps the needed libraries were never installed. If you can run some basic QT program on the Jetson, then either the clone of eMMC or the dd
of the SD card would get all of the libraries you need.
The above assumes you are running arm64 tools and libraries on a PC, thus the “cross” name in everything. Docker could function as an “adapter” end perhaps you can use arm64 tools directly without using “cross” tools. Someone else will have to answer setup, but even if you do use an environment which can adapt to run arm64 directly on the PC, then you’d still need the libraries I mentioned above. You would still likely find that if your Jetson is set up to run your QT programs, then a clone or dd
of the rootfs partition would be the simplest place to point your linker and simply have all libraries available without digging them out one at a time.