Cross-compile for OpenCV... Impossible?

Hi,

I’ve been trying to find a way to link my application against the OpenCV4Tegra libs in a cross-dev environment, with no success at all. Here’s a brief summary of my attempts so far (all commands run on my development Ubuntu 14.04 / x86_64):

$ sudo dpkg -i libopencv4tegra-repo_ubuntu1404_2.4.10.1_amd64.deb
...
$ sudo apt-get update
...
$ sudo apt-get install libopencv4tegra-dev
...
  • I would expect armhf shared libs to ve available at this point, but to my surprise only x86-64 become available… WTF? what can you exactly do with these libraries when the whole Tegra architecture is armhf?

  • Attempting the same process with “libopencv4tegra-repo_l4t-r21_2.4.10.1_armhf.deb” raises an armhf dependency hell.

  • Yes, I’ve read http://elinux.org/Jetson/Installing_OpenCV, and it doesn’t help because it only mentions cross-compilation as an option, and then proceeds to build everything on the Jetson TK1 target. Also, this will not give you NVIDIA’s CPU optimizations that are only available in the closed-source prebuilt OpenCV4Tegra packages.

Any ideas?

Hi EmilioG,

Cross compilation of OpenCV might be challenging as it depends on many libraries.

We will explore this in the future, but there is no answer in the short-term.

Thanks

If it is helpful to anyone out there, I’ve managed to cross-compile copying every required library from the Jetson TK1 to the host build environment.

It’s not clean, and requires some patience, as some dependencies spawn new dependencies and so on, but it is definitively a finite process, specially if you only use limited OpenCV functionalities.

Hope this helps,
E.

Instead of file copy, clone the rootfs and loopback mount the image. Using that you will have an exact copy of the entire Jetson. You can be creative with symbolic links if needed.