Episode 2: Cross compiling for NVIDIA Drive AGX: Linking the right libraries

Hi all,

I’m setting up a cmake-based cross-build for the NVIDIA-drive AGX. That is, I’m building on a x86-64-based host system binaries for the target drive’s AGX arm aarch64.

I managed to set up the cmake project definition so that everything compiles fine. See https://devtalk.nvidia.com/default/topic/1049889/driveworks/failure-to-cross-compile-cuda-for-nvidia-drive-agx/post/5328308/#5328308 for my adventures so far.

Now my link phase fails. I get linker errors saying that all libraries are skipped because they have the wrong format. The reason is that all library pathes that cmake generates for the linker are pointing to the x86-64 versions of the libraries, which do not match the target architecture. This is the case for the CUDA libraries as well as for the system libraries like pthreads.

The first question is: How can I configure the proper library pathes in my CMakeLists.txt for the

  • CUDA libraries, and the
  • system libraries (for example pthreads).

The second question is: Where can I find the system libraries for the target platform at all? I found the CUDA-libs, but cannot find the system libraries.

Any help is welcome,

Dear Michael,
Lets follow this issue on https://devtalk.nvidia.com/default/topic/1049889/driveworks/failure-to-cross-compile-cuda-for-nvidia-drive-agx/post/5328308/#5328308 to avoid duplicate topics.