cross compilation driveworks for drive PX2

Title: cross compiling driveworks for PX2 architecture
Issue description
I am getting the following error on cross compiling the binary for Drive PX2 system
karthikk@SA-KARTHIKK-D4:~/driveworks_self/samples/build_PX2$ sudo make [sudo] password for karthikk:
[ 20%] Built target dw_samples_common
Linking CXX executable sample_egomotion_ackermann
/media/karthikk/HDD_1/src/drivePX2_files/VibrantePDK/toolchains/tegra-4.9-nv/usr/bin/aarch64-gnu-linux/…/…/libexec/aarch64-gnu-linux/gcc/aarch64-gnu-linux/4.9.2/ld: cannot find -lXcursor
collect2: error: ld returned 1 exit status
make[2]: *** [src/egomotion/ackermann/sample_egomotion_ackermann] Error 1
make[1]: *** [src/egomotion/ackermann/CMakeFiles/sample_egomotion_ackermann.dir/all] Error 2
make: *** [all] Error 2

Hello karthikk,

Could you please access https://developer.nvidia.com/driveworks/getting-started-with-drivepx2 and download the file?
And please see page 85 to DW cross-compile. Thanks.

If you are still getting an error about missing libXcursor, the guide Steve posted mentions copying libXcursor.so from the PX2 to the host. However, I couldn’t find libXcursor.so at the location mentioned in that guide, so I copied it from another location in the driveworks installation on the host. Note: I used driveinstall to install all required packages.

Make sure $VIBRANTE_PDK points to wherever you installed Vibrante PDK and then copy the file:
export VIBRANTE_PDK=/opt/VibrantePDK/vibrante-t186ref-linux
cp /usr/local/driveworks/samples/3rdparty/linux-aarch64/vibrante/lib/libXcursor.so $VIBRANTE_PDK/lib-target

This allowed me to successfully compile all of the samples.

Hi Steve and Michael,

Thanks for your inputs.
I manged to compile successfully after moving my source to the same directory

But I encountered an error when copying to PX2 system

After copying and executing in PX2 I got the following error:

nvidia@tegra-ubuntu:/usr/local/driveworks-0.2.1/bin2$ ./sample_object_detector
bash: ./sample_object_detector: cannot execute binary file: Exec format error

Hi,

I couldn’t even cmake in driveworks. It kept complaining about glfw3config.cmake, lodepngconfig.cmake and vibrante etc. things. I couldn’t even find them in my Host system. Just wondering did I miss anything?

Hi,

I have followed cross compile doc and same cross compilation error as following occurs.

Error

CMake Error at cmake/Samples3rdparty.cmake:9 (find_package):
Could not find a package configuration file provided by “glfw3” with any of
the following names:

glfw3Config.cmake
glfw3-config.cmake

Add the installation prefix of “glfw3” to CMAKE_PREFIX_PATH or set
“glfw3_DIR” to a directory containing one of the above files. If “glfw3”
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:31 (include)

– Configuring incomplete, errors occurred!

Any idea on this?

Leo

Recently we had some similar issues:
please check if you are using the right versions:

  • Ubuntu Linux 14.04 (out of the box installation)
  • GCC >= 4.8.X && GCC <= 4.9.x
  • cmake version >= 3.2.2
  • CUDA Toolkit 8.0 or higher
  • You may also need to install (using “apt-get install”) the following packages: libx11-dev libxrandr-dev libxcursor-dev libxxf86vm-dev libxinerama-dev libxi-dev libglu1-mesa-dev

    We encountered the same linking errors, as we were using a to old cmake version.