Jetson TK1, Qt and Cross-Compilation

Hi,

I’m trying - and failing - to figure out how to set up a Qt cross-compiler for the Jetson TK1.

These are the steps I’ve taken so far:

  1. Downloaded the JetPack TK1 installer onto my Ubuntu 16.04 host machine
  2. Run the installer and deployed the rootfs onto my TK1 board
  3. Installed Qt5 onto the TK1 using “sudo apt-get install qt5-default”
  4. Installed Qt5 onto my Ubuntu 16.04 host using “sudo apt-get install qt5-default” and also QtCreator using “sudo apt-get install qtcreator”
  5. Downloaded and extracted the Linaro arm-linux-gnueabihf toolchain
  6. rsync’d the /usr/bin, /usr/lib and /usr/include files up to my Ubuntu host machine into a ~/tk1_rootfs dir
  7. Set up a new “device” in Qt Creator targeting the TK1 - this works and can successfully connect
  8. Added a “manual” GCC compiler, pointing to the Linaro arm-linux-gnueabihf tools
  9. Attempted to add new “Qt Version”, selecting “qmake” from ~/tk1_rootfs/usr/bin directory rsync’d from the TK1
  10. An error now appears saying “/lib/ld-linux-armhf.so.3: No such file or directory”

The last step is where my understanding ends. Presumably, I need to make extra dependencies available - having tried copying up the /lib folder from the TK1 to the ~/tk1_rootfs dir, this still makes no difference.

Unfortunately I have very limited experience with setting up cross-compilers so any help or advice would be greatly appreciated. Am I going about things the wrong way? Do I need to specify “sysroots” in Qt Creator?

Thanks

I haven’t set up for Qt, but I’d suggest cloning the root partition, then mounting it on “~/tk1_rootfs” via loopback. This will give you an exact copy of the entire root partition. See:
http://elinux.org/Jetson/Cloning

An example of mounting via loopback if the clone is named “system.img.raw”:

sudo mount -o loop /where/ever/it/is/system.img.raw /home/whoever/tk1_rootfs

If you want this copy to be read-only:

sudo mount -o loop,ro /where/ever/it/is/system.img.raw /home/whoever/tk1_rootfs

Note that you can leave the original content of “~/tk1_rootfs” there while testing…the mount will hide what is there until umount. If something fails you’ll be guaranteed it isn’t because of a difference with the Jetson (perhaps the Jetson requires another package in that case, or cross-compile itself has other environment setup issues).

FYI, you can update the real JTK1 and then rsync to the loopback mounted clone image to keep the clone updated without doing another full clone (clone images are typically 15GB in size).

This post here explains how to configure cross compiling with Qt on Ubuntu and has some scripts to automate the process for setting up the environment, [url]https://devtalk.nvidia.com/default/topic/1015414/jetson-tx2/cross-compiling-with-qt/[/url].