Cross compile target file including ROS and DriveWorks

Dear whom it may concern,

When I compile my file which uses ros and DW, following error occurs. Could anyone provide any help on it?

zhy@zhy-HP-ZBook-15-G5:~/Desktop/rosTest/scripts$ ./target_build.sh 
rm: cannot remove '../build_target': No such file or directory
-- VIBRANTE_PDK = /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux
-- VIBRANTE_PDK_DEVICE = t186ref
-- VIBRANTE_PDK_BRANCH = 5.1.6.1
-- Vibrante version 5.1.6.1
-- VIBRANTE_PDK = /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux
-- Vibrante version 5.1.6.1
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/../toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
-- Check for working C compiler: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/../toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/../toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++
-- Check for working CXX compiler: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/../toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDA: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/local/cuda (found version "10.2") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Found EGL: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libEGL.so  
-- Found /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libEGL.so:
--  - Includes: [/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include]
--  - Libraries: [/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libEGL.so]
-- Found: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libdrm.so
-- Header at: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include
-- DW_EXPERIMENTAL_FORCE_EGL set and EGL Support Enabled
-- Cross Compiling for Vibrante
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Default - Building with TRT version 5.1.4.2 and cudnn version 7.5.1.14
-- Building GLFW for X11 (static)
-- Looking for XOpenDisplay in /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libX11.so;/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libX11.so;/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libX11.so
-- VIBRANTE_PDK_BRANCH = 5.1.6.1
-- Found vibrante lib: /home/zhy/Desktop/rosTest/3rdparty/linux-aarch64/vibrante/lib/libudev.so
-- Found vibrante lib: /home/zhy/Desktop/rosTest/3rdparty/linux-aarch64/vibrante/lib/libusb-1.0.so
-- Found vibrante_Xlib: /home/zhy/Desktop/rosTest/3rdparty/linux-aarch64/vibrante_Xlibs/lib/libXcursor.so
-- Driveworks Samples install dir: /home/zhy/Desktop/rosTest/build_target/install
-- Cross Compiling for Vibrante
-- Driveworks found at: /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/local/driveworks-2.2/targets/aarch64-Linux
-- Found Driveworks 
-- Using CATKIN_DEVEL_PREFIX: /home/zhy/Desktop/rosTest/build_target/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/zhy/Desktop/rosTest/build_target/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.20
-- BUILD_SHARED_LIBS is on
WARNING: Package name "DriveworksSDK-Samples" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zhy/Desktop/rosTest/build_target
Scanning dependencies of target lodepng-src
Scanning dependencies of target glfw-x11
Scanning dependencies of target update_cuda_deps
Scanning dependencies of target samples_allocator
[  2%] Building CXX object 3rdparty/src/lodepng/CMakeFiles/lodepng-src.dir/src/lodepng.cpp.o
[  2%] Built target update_cuda_deps
[  4%] Building CXX object src/framework/CMakeFiles/samples_allocator.dir/Allocator.cpp.o
[  9%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/context.c.o
[  9%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/monitor.c.o
[ 14%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/input.c.o
[ 14%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/vulkan.c.o
[ 19%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/x11_monitor.c.o
[ 21%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/window.c.o
[ 19%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/x11_init.c.o
[ 24%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/x11_window.c.o
[ 26%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/init.c.o
[ 29%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/xkb_unicode.c.o
[ 34%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/linux_joystick.c.o
[ 34%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/glx_context.c.o
[ 36%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/posix_tls.c.o
[ 39%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/egl_context.c.o
[ 41%] Building C object 3rdparty/src/glfw/CMakeFiles/glfw-x11.dir/3.2-screen/src/posix_time.c.o
[ 43%] Linking CXX static library ../../devel/lib/libsamples_allocator.a
[ 43%] Built target samples_allocator
[ 43%] Built target glfw-x11
Scanning dependencies of target glfw-src
[ 46%] Linking C static library libglfw-src.a
[ 46%] Built target glfw-src
[ 48%] Linking CXX static library liblodepng-src.a
[ 48%] Built target lodepng-src
Scanning dependencies of target samples_framework
[ 51%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/SampleFramework.cpp.o
[ 53%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/Grid.cpp.o
[ 56%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/Window.cpp.o
[ 58%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/DriveWorksSample.cpp.o
[ 60%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/Log.cpp.o
[ 65%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/MouseView3D.cpp.o
[ 68%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/ProfilerCUDA.cpp.o
[ 68%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/WindowGLFW.cpp.o
[ 70%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/SimpleCamera.cpp.o
[ 73%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/ProgramArguments.cpp.o
[ 75%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/ScreenshotHelper.cpp.o
[ 78%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/MathUtils.cpp.o
[ 80%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/SimpleRenderer.cpp.o
[ 85%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/RenderUtils.cpp.o
[ 85%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/WindowLinuxEGL.cpp.o
[ 87%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/SimpleRecordingPlayer.cpp.o
[ 90%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/WindowEGL.cpp.o
[ 92%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/CameraFramePipeline.cpp.o
In file included from /home/zhy/Desktop/rosTest/src/framework/Log.cpp:44:0:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/unique_ptr.h:37,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/memory:80,
                 from /home/zhy/Desktop/rosTest/src/framework/ProfilerCUDA.hpp:34,
                 from /home/zhy/Desktop/rosTest/src/framework/ProfilerCUDA.cpp:11:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:254: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/Log.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/Log.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
src/framework/CMakeFiles/samples_framework.dir/build.make:278: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/ProfilerCUDA.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/ProfilerCUDA.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/stl_algo.h:59:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/algorithm:62,
                 from /home/zhy/Desktop/rosTest/src/framework/MouseView3D.cpp:33:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/stl_map.h:63,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/map:61,
                 from /home/zhy/Desktop/rosTest/src/framework/ProgramArguments.hpp:34,
                 from /home/zhy/Desktop/rosTest/src/framework/ProgramArguments.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
src/framework/CMakeFiles/samples_framework.dir/build.make:230: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/MouseView3D.cpp.o' failed
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/locale_classes.h:40,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/ios_base.h:41,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ios:42,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ostream:38,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/iostream:39,
                 from /home/zhy/Desktop/rosTest/src/framework/SampleFramework.cpp:35:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/MouseView3D.cpp.o] Error 1
compilation terminated.
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/unique_ptr.h:37,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/memory:80,
                 from /home/zhy/Desktop/rosTest/src/framework/DriveWorksSample.hpp:35,
                 from /home/zhy/Desktop/rosTest/src/framework/DriveWorksSample.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:110: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/ProgramArguments.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/ProgramArguments.cpp.o] Error 1
src/framework/CMakeFiles/samples_framework.dir/build.make:62: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/SampleFramework.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/SampleFramework.cpp.o] Error 1
src/framework/CMakeFiles/samples_framework.dir/build.make:86: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/DriveWorksSample.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/DriveWorksSample.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/stl_algo.h:59:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/algorithm:62,
                 from /home/zhy/Desktop/rosTest/src/framework/MathUtils.hpp:35,
                 from /home/zhy/Desktop/rosTest/src/framework/MathUtils.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:206: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/MathUtils.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/MathUtils.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/unique_ptr.h:37,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/memory:80,
                 from /home/zhy/Desktop/rosTest/src/framework/WindowGLFW.hpp:57,
                 from /home/zhy/Desktop/rosTest/src/framework/WindowGLFW.cpp:66:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:182: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/WindowGLFW.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/WindowGLFW.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/unique_ptr.h:37,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/memory:80,
                 from /home/zhy/Desktop/rosTest/src/framework/WindowGLFW.hpp:57,
                 from /home/zhy/Desktop/rosTest/src/framework/Window.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:134: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/Window.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/Window.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/unique_ptr.h:37,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/memory:80,
                 from /home/zhy/Desktop/rosTest/src/framework/SimpleCamera.hpp:42,
                 from /home/zhy/Desktop/rosTest/src/framework/SimpleCamera.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:326: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/SimpleCamera.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/SimpleCamera.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/locale_classes.h:40,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/ios_base.h:41,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ios:42,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ostream:38,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/iostream:39,
                 from /home/zhy/Desktop/rosTest/src/framework/Checks.hpp:8,
                 from /home/zhy/Desktop/rosTest/src/framework/RenderUtils.hpp:36,
                 from /home/zhy/Desktop/rosTest/src/framework/RenderUtils.cpp:1:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:422: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/RenderUtils.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/RenderUtils.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/locale_classes.h:40,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/ios_base.h:41,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ios:42,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ostream:38,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/iostream:39,
                 from /home/zhy/Desktop/rosTest/src/framework/WindowEGL.cpp:39:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:446: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/WindowEGL.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/WindowEGL.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/locale_classes.h:40,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/ios_base.h:41,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ios:42,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ostream:38,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/iostream:39,
                 from /home/zhy/Desktop/rosTest/src/framework/../framework/Checks.hpp:8,
                 from /home/zhy/Desktop/rosTest/src/framework/ScreenshotHelper.hpp:35,
                 from /home/zhy/Desktop/rosTest/src/framework/ScreenshotHelper.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:398: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/ScreenshotHelper.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/ScreenshotHelper.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/locale_classes.h:40,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/ios_base.h:41,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ios:42,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ostream:38,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/iostream:39,
                 from /home/zhy/Desktop/rosTest/src/framework/WindowLinuxEGL.cpp:33:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:470: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/WindowLinuxEGL.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/WindowLinuxEGL.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/unique_ptr.h:37,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/memory:80,
                 from /home/zhy/Desktop/rosTest/src/framework/../framework/SimpleCamera.hpp:42,
                 from /home/zhy/Desktop/rosTest/src/framework/SimpleRecordingPlayer.hpp:43,
                 from /home/zhy/Desktop/rosTest/src/framework/SimpleRecordingPlayer.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:374: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/SimpleRecordingPlayer.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/SimpleRecordingPlayer.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/stdexcept:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/array:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/tuple:39,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/unique_ptr.h:37,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/memory:80,
                 from /home/zhy/Desktop/rosTest/src/framework/CameraFramePipeline.hpp:42,
                 from /home/zhy/Desktop/rosTest/src/framework/CameraFramePipeline.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:302: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/CameraFramePipeline.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/CameraFramePipeline.cpp.o] Error 1
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ext/string_conversions.h:41:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/basic_string.h:6349,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/string:52,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/locale_classes.h:40,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/bits/ios_base.h:41,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ios:42,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/ostream:38,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/iostream:39,
                 from /home/zhy/Desktop/rosTest/src/framework/../framework/Checks.hpp:8,
                 from /home/zhy/Desktop/rosTest/src/framework/SimpleRenderer.hpp:12,
                 from /home/zhy/Desktop/rosTest/src/framework/SimpleRenderer.cpp:31:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
src/framework/CMakeFiles/samples_framework.dir/build.make:350: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/SimpleRenderer.cpp.o' failed
make[2]: *** [src/framework/CMakeFiles/samples_framework.dir/SimpleRenderer.cpp.o] Error 1
CMakeFiles/Makefile2:1188: recipe for target 'src/framework/CMakeFiles/samples_framework.dir/all' failed
make[1]: *** [src/framework/CMakeFiles/samples_framework.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Dear hanyang.zhuang,
I am not sure about the route cause. But see if https://bugs.gentoo.org/594406#c4 helps?

Hi hanyang.zhuang,

I don’t know why you met “fatal error: stdlib.h: No such file or directory” error. Could you refer to https://docs.nvidia.com/driveworks/dwx_samples_building_V5L.html and try if your current cmake settings works in cross compiling DriveWorks SDK samples first?

Hi SivaRamaKrisha and VickNV,

Thanks for your reply for this period regarding cross compile issues.

I have resolved this issue and the main reason is that I’m not setting the cmake file well. I was not familiar enough with the cmake, so the include and library are not well set.

Dear hangang.zhuang,
Glad to hear that you are able to compile successfully, could you share steps here to help others in the community

After all these attempts, it seems to be quite straight forward and easy to realize this approach. The cross compilation using ROS and DW in the Xavier target can be divided into following steps:

  1. Install ROS melodic on target (I'm using DRIVE 10.0 and Xavier as target). Actually, for Ubuntu 18.04 and ROS melodic, Xavier can install it through apt. Following the ros installation guidance http://wiki.ros.org/melodic/Installation/Ubuntu, one can choose to install either one.
    sudo apt install ros-melodic-desktop 
    sudo apt install ros-melodic-ros-base
    

    There may be some problems when doing sudo rosdep init and rosdep update due to the network issue. The solution I found is to try multiple times. Also the apt install command may not work well, please try several times or check the apt source.

  2. Install ROS on host .../drive-t186-linux/targetfs_a These two threads give very good instructions. https://devtalk.nvidia.com/default/topic/1066028/problems-with-ros-cross-compilation/ https://devtalk.nvidia.com/default/topic/1032206/faq/drive-px2-ros-cross-compilation/post/5251406/ When you met "To install dependencies with Qemu-chroot"/"Enter the emulated file system shell with the following command:" and use sudo LC_ALL=C chroot to open the root shell of the targetfs_a on your host, you can use the same method to install ROS as indicated in the first step. Note "targetfs_a" is used for Xavier to replace "targetfs" used for PX2 in the urls above. And everything is used below.
  3. Cross compile source file including "ros" and "dw" with modificed CMakeLists.txt Until now, the include and lib files shall be installed by default in the /opt/ros/melodic/include and /opt/ros/melodic/lib folders. Then, when we cross compile our own source files we just need to add these two paths to the corresponding cmake files. This is the tree of my source file. tree ``` . ├── 3rdparty ├── cmake ├── CMakeLists.txt ├── package.xml ├── scripts └── src ├── ail_ros_node └── framework ```

    The 3rdparty, cmake, src/framework are kept the same as DW sample since I may use them in the future. In the ./CMakeLists.txt, it looks like following. It is almost the same CMakeLists.txt as in the sample root folder:
    ./CMakeLists.txt

    cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
    set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
    include(SamplesSetBuildType) # Set the build type before project is created
    set(SDK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
    set(SDK_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
    set(TEST_BINARY_DESTINATION  ${SDK_SOURCE_DIR}/bin)
    set(TEST_LIBRARY_DESTINATION ${SDK_SOURCE_DIR}/lib)
    set(TEST_ARCHIVE_DESTINATION ${SDK_SOURCE_DIR}/lib)
    function(test_install TEST)
        install(TARGETS ${TEST}
            COMPONENT samples
            RUNTIME DESTINATION ${TEST_BINARY_DESTINATION}
            LIBRARY DESTINATION ${TEST_LIBRARY_DESTINATION}
            ARCHIVE DESTINATION ${TEST_ARCHIVE_DESTINATION}
        )
    endfunction()  
    project(DriveworksSDK-Samples C CXX)
    find_package(CUDA REQUIRED)
    find_package(EGL)
    include(ArchConfiguration)
    include(CommonConfiguration)
    include(SamplesConfiguration)
    include(ResourcesConfiguration)
    include(Samples3rdparty)
    include(SamplesInstallConfiguration)
    include(ExpandDependencyTree)
    include(IncludeTargetDirectories)
    include(UploadVibrante)
    set(SDK_BINARY_DIR ${CMAKE_BINARY_DIR})
    find_package(Driveworks REQUIRED)
    include_directories(${Driveworks_INCLUDE_DIR})
    list(APPEND Driveworks_LIBRARIES
        ${CUDA_LIBRARIES}
        ${CUDA_cublas_LIBRARY}
        samples_allocator
    )
    if(LINUX)
        list(APPEND Driveworks_LIBRARIES)
    elseif(VIBRANTE)
        list(APPEND Driveworks_LIBRARIES ${vibrante_LIBRARIES} ${vibrante_Xlibs_LIBRARIES} nvmedia ${EGL_LIBRARIES})
    endif()
    if(CMAKE_CROSSCOMPILING)
      set(DRIVEWORKS_DATAPATH "../data")
    else()
      set(DRIVEWORKS_DATAPATH "${CMAKE_CURRENT_LIST_DIR}/../data")
    endif()
    include_directories(${SDK_BINARY_DIR}/configured/samples)
    configure_file(src/framework/DataPath.hpp.in
                  ${SDK_BINARY_DIR}/configured/samples/framework/DataPath.hpp)
    set(SAMPLES framework;ail_ros_node)
    foreach(SAMPLE ${SAMPLES})
        add_subdirectory(src/${SAMPLE})
    endforeach()
    add_cuda_dependencies_target(update_cuda_deps ON)
    set_property(TARGET update_cuda_deps PROPERTY FOLDER "Support")
    

    And the src/ail_ros_node/CMakeLists.txt is modified to include ros include and lib. Each ros related header file may need several library files, so either you know which libs are required, or you can check the compiler result then add the related libs. The ${VIBRANTE_PDK} is inherited to the toolchain command for cross compilation. Note “targetfs_a” is needed since Xavier has two SoC. This is a difference to PX2.
    src/ail_node/CMakeLists.txt

    project(ail_ros_node C CXX)
    include_directories(
    	${VIBRANTE_PDK}/targetfs_a/opt/ros/melodic/include
    )
    link_directories(
    	${VIBRANTE_PDK}/targetfs_a/opt/ros/melodic/lib
    )
    set(PUBLIC_DOCS
        README.md
    )
    set(SOURCES
        ail_ros_node.cpp
    )
    set(LIBRARIES
        samples_framework
        ${Driveworks_LIBRARIES}
        roscpp
        roscpp_serialization
        rostime
        rosconsole	
    )
    add_executable(${PROJECT_NAME} ${SOURCES})
    target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBRARIES})
    set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Samples")
    test_install(${PROJECT_NAME})
    

    My source file includes
    src/ail_ros_node/ail_ros_node.cpp

    #include <iostream>
    #include <dw/core/Context.h>
    #include <dw/core/Logger.h>
    #include <framework/Log.hpp>
    #include "std_msgs/String.h"
    #include <sstream>
    #include "ros/ros.h"
    

    The main function is just a copy and paste of DW sample and ROS simple publisher/subscriber.

    The cross compile toolchain is in cmake/ros-xavier-toolchain.cmake and looks like following. Before line 135, it is the same as same\Toolchain-V5L.cmake. I only set VIBRANTE_PDK in the toolchain. After line 135, I modified it a little bit according to the urls showns in step2 and change “targetfs” to “targetfs_a”. I’m not familiar with setting up toolchain so this part can be redundant. So if anyone can provide some help in modification, it is more than welcome:
    cmake/ros-xavier-toolchain.cmake

    set(CMAKE_SYSTEM_NAME "Linux")
    set(CMAKE_SYSTEM_VERSION 1)
    set(VIBRANTE_BUILD ON)       #flags for the CMakeList.txt
    set(CMAKE_SYSTEM_PROCESSOR aarch64)
    # need that one here, because this is a toolchain file and hence executed before
    # default cmake settings are set
    set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
    set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so")
    
    set(VIBRANTE_PDK /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux)
    # set(MYSYSROOT "/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a")
    
    # check that Vibrante PDK must be set
    if(NOT DEFINED VIBRANTE_PDK)
        if(DEFINED ENV{VIBRANTE_PDK})
            message(STATUS "VIBRANTE_PDK = ENV : $ENV{VIBRANTE_PDK}")
            set(VIBRANTE_PDK $ENV{VIBRANTE_PDK} CACHE STRING "Path to the vibrante-XXX-linux path for cross-compilation" FORCE)
        endif()
    else()
         message(STATUS "VIBRANTE_PDK = ${VIBRANTE_PDK}")
    endif()
    if(DEFINED VIBRANTE_PDK)
      if(NOT IS_ABSOLUTE ${VIBRANTE_PDK})
          get_filename_component(VIBRANTE_PDK "${SDK_BINARY_DIR}/${VIBRANTE_PDK}" ABSOLUTE)
      endif()
    endif()
    set(ARCH "aarch64")
    set(VIBRANTE TRUE)
    set(VIBRANTE_V5L TRUE)
    add_definitions(-DVIBRANTE -DVIBRANTE_V5L)
    # determine target device and pdk branch
    if(NOT DEFINED VIBRANTE_PDK_DEVICE AND VIBRANTE_PDK)
        if(${VIBRANTE_PDK} MATCHES "(vibrante|drive)-(t.+)-linux$")
            set(VIBRANTE_PDK_DEVICE ${CMAKE_MATCH_2} CACHE STRING "Cross-compilation target device")
            message(STATUS "VIBRANTE_PDK_DEVICE = ${VIBRANTE_PDK_DEVICE}")
        else()
            message(FATAL_ERROR "Can't determine target device for PDK: ${VIBRANTE_PDK}")
        endif()
    endif()
    if(NOT DEFINED VIBRANTE_PDK_BRANCH AND VIBRANTE_PDK)
        if(EXISTS "${VIBRANTE_PDK}/lib-target/version-nv-pdk.txt")
            set(VIBRANTE_PDK_FILE "${VIBRANTE_PDK}/lib-target/version-nv-pdk.txt")
        elseif(EXISTS "${VIBRANTE_PDK}/lib-target/version-nv-sdk.txt")
            set(VIBRANTE_PDK_FILE "${VIBRANTE_PDK}/lib-target/version-nv-sdk.txt")
        endif()
    
        if(VIBRANTE_PDK_FILE)
           file(READ ${VIBRANTE_PDK_FILE} version-nv-pdk)
           if(${version-nv-pdk} MATCHES "^(.+)-[0123456789]+")
               set(VIBRANTE_PDK_BRANCH ${CMAKE_MATCH_1} CACHE STRING "Cross-compilation PDK branch name")
               message(STATUS "VIBRANTE_PDK_BRANCH = ${VIBRANTE_PDK_BRANCH}")
           else()
               message(FATAL_ERROR "Can't determine PDK branch for PDK ${VIBRANTE_PDK}")
           endif()
        else()
           message(FATAL_ERROR "Can't open ${VIBRANTE_PDK}/lib-target/version-nv-(pdk/sdk).txt for PDK branch detection")
        endif()
    endif()
    if(DEFINED VIBRANTE_PDK_BRANCH)
      string(REPLACE "." ";" PDK_VERSION_LIST ${VIBRANTE_PDK_BRANCH})
    
      # Some PDK's have less than three version numbers. Pad the list so we always
      # have at least three numbers, allowing pre-existing logic depending on major,
      # minor, patch versioning to work without modifications
      list(LENGTH PDK_VERSION_LIST _PDK_VERSION_LIST_LENGTH)
      while(_PDK_VERSION_LIST_LENGTH LESS 3)
        list(APPEND PDK_VERSION_LIST 0)
        math(EXPR _PDK_VERSION_LIST_LENGTH "${_PDK_VERSION_LIST_LENGTH} + 1")
      endwhile()
    
      set(VIBRANTE_PDK_PATCH 0)
      set(VIBRANTE_PDK_BUILD 0)
    
      list(LENGTH PDK_VERSION_LIST PDK_VERSION_LIST_LENGTH)
    
      list(GET PDK_VERSION_LIST 0 VIBRANTE_PDK_MAJOR)
      list(GET PDK_VERSION_LIST 1 VIBRANTE_PDK_MINOR)
      if(PDK_VERSION_LIST_LENGTH GREATER 2)
        list(GET PDK_VERSION_LIST 2 VIBRANTE_PDK_PATCH)
      endif()
    
      if(PDK_VERSION_LIST_LENGTH GREATER 3)
        list(GET PDK_VERSION_LIST 3 VIBRANTE_PDK_BUILD)
      endif()
      set(VIBRANTE_PDK_VERSION ${VIBRANTE_PDK_MAJOR}.${VIBRANTE_PDK_MINOR}.${VIBRANTE_PDK_PATCH}.${VIBRANTE_PDK_BUILD})
      add_definitions(-DVIBRANTE_PDK_VERSION=\"${VIBRANTE_PDK_VERSION}\") # requires escaping so it is treated as a string
                                                                          # and not an invalid floating point with too many decimal points
      add_definitions(-DVIBRANTE_PDK_MAJOR=${VIBRANTE_PDK_MAJOR})
      add_definitions(-DVIBRANTE_PDK_MINOR=${VIBRANTE_PDK_MINOR})
      add_definitions(-DVIBRANTE_PDK_PATCH=${VIBRANTE_PDK_PATCH})
      add_definitions(-DVIBRANTE_PDK_BUILD=${VIBRANTE_PDK_BUILD})
    
      math(EXPR VIBRANTE_PDK_DECIMAL "${VIBRANTE_PDK_MAJOR} * 1000000 + \
                                      ${VIBRANTE_PDK_MINOR} * 10000 + \
                                      ${VIBRANTE_PDK_PATCH} * 100 + \
                                      ${VIBRANTE_PDK_BUILD}")
      add_definitions(-DVIBRANTE_PDK_DECIMAL=${VIBRANTE_PDK_DECIMAL})
    
      message(STATUS "Vibrante version ${VIBRANTE_PDK_VERSION}")
    endif()
    # If VIBRANTE_C_COMPILER and VIBRANTE_CXX_COMPILER are defined, they will be used.
    # if not the PDK-internal compiler will be used (default behavior)
    if(DEFINED VIBRANTE_C_COMPILER AND DEFINED VIBRANTE_CXX_COMPILER)
      # Determine C and CXX compiler versions
      exec_program(${VIBRANTE_C_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE C_COMPILER_VERSION RETURN_VALUE C_COMPILER_VERSION_ERROR)
      exec_program(${VIBRANTE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE CXX_COMPILER_VERSION RETURN_VALUE CXX_COMPILER_VERSION_ERROR)
    
      # Make sure C and CXX compiler versions match
      if(${C_COMPILER_VERSION_ERROR})
        message(FATAL_ERROR "Received error ${C_COMPILER_VERSION_ERROR} when determining compiler version for ${VIBRANTE_C_COMPILER}")
      elseif(${CXX_COMPILER_VERSION_ERROR})
        message(FATAL_ERROR
        "Received error ${CXX_COMPILER_VERSION_ERROR} when determining compiler version for ${VIBRANTE_CXX_COMPILER}")
      elseif(NOT ${C_COMPILER_VERSION} VERSION_EQUAL ${CXX_COMPILER_VERSION})
        message(FATAL_ERROR
        "C and CXX compiler versions must match.\n"
        "Found C Compiler Version = ${C_COMPILER_VERSION}\n"
        "Found CXX Compiler Version = ${CXX_COMPILER_VERSION}\n")
      endif()
      set(CMAKE_C_COMPILER ${VIBRANTE_C_COMPILER})
      set(CMAKE_CXX_COMPILER ${VIBRANTE_CXX_COMPILER})
      set(GCC_COMPILER_VERSION "${C_COMPILER_VERSION}" CACHE STRING "GCC Compiler version")
    else()
      if(VIBRANTE_PDK_DECIMAL LESS 5010300)
        set(TOOLCHAIN "${VIBRANTE_PDK}/../toolchains/tegra-4.9-nv")
        set(CMAKE_CXX_COMPILER "${TOOLCHAIN}/usr/bin/aarch64-gnu-linux/aarch64-gnu-linux-g++")
        set(CMAKE_C_COMPILER "${TOOLCHAIN}/usr/bin/aarch64-gnu-linux/aarch64-gnu-linux-gcc")
        set(GCC_COMPILER_VERSION "4.9" CACHE STRING "GCC Compiler version")
      else()
        set(TOOLCHAIN "${VIBRANTE_PDK}/../toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu")
        set(CMAKE_CXX_COMPILER "${TOOLCHAIN}/bin/aarch64-linux-gnu-g++")
        set(CMAKE_C_COMPILER "${TOOLCHAIN}/bin/aarch64-linux-gnu-gcc")
        set(GCC_COMPILER_VERSION "7.3.1" CACHE STRING "GCC Compiler version")
      endif()
    endif()
    # setup compiler for cross-compilation
    set(CMAKE_CXX_FLAGS           "-fPIC"               CACHE STRING "c++ flags")
    set(CMAKE_C_FLAGS             "-fPIC"               CACHE STRING "c flags")
    set(CMAKE_SHARED_LINKER_FLAGS ""                    CACHE STRING "shared linker flags")
    set(CMAKE_MODULE_LINKER_FLAGS ""                    CACHE STRING "module linker flags")
    set(CMAKE_EXE_LINKER_FLAGS    ""                    CACHE STRING "executable linker flags")
    # Targetfs path
    set(LD_PATH ${VIBRANTE_PDK}/lib-target)
    set(LD_PATH_EXTRA ${VIBRANTE_PDK}/targetfs_a/usr/lib/aarch64-linux-gnu)
    set(LD_PATH_EXTRA_1 ${VIBRANTE_PDK}/targetfs_a/lib/aarch64-linux-gnu)
    set(ROSCONSOLE_BACKEND "print")
    set(CMAKE_FIND_ROOT_PATH ${VIBRANTE_PDK}/targetfs_a )
    # Please, be carefull looks like "-Wl,-unresolved-symbols=ignore-in-shared-libs" can lead to silent "ld" problems
    set(CMAKE_SHARED_LINKER_FLAGS   "--sysroot=${CMAKE_FIND_ROOT_PATH} -L${LD_PATH} -L${LD_PATH_EXTRA} -L${LD_PATH_EXTRA_1} -Wl,-rpath,${LD_PATH} -Wl,-rpath,${LD_PATH_EXTRA} -Wl,-rpath,${LD_PATH_EXTRA_1} ${CMAKE_SHARED_LINKER_FLAGS}")
    set(CMAKE_MODULE_LINKER_FLAGS   "--sysroot=${CMAKE_FIND_ROOT_PATH} -L${LD_PATH} -L${LD_PATH_EXTRA} -L${LD_PATH_EXTRA_1} -Wl,-rpath,${LD_PATH} -Wl,-rpath,${LD_PATH_EXTRA} -Wl,-rpath,${LD_PATH_EXTRA_1} ${CMAKE_MODULE_LINKER_FLAGS}")
    set(CMAKE_EXE_LINKER_FLAGS      "--sysroot=${CMAKE_FIND_ROOT_PATH} -L${LD_PATH} -L${LD_PATH_EXTRA} -L${LD_PATH_EXTRA_1} -Wl,-rpath,${LD_PATH} -Wl,-rpath,${LD_PATH_EXTRA} -Wl,-rpath,${LD_PATH_EXTRA_1} ${CMAKE_EXE_LINKER_FLAGS}")
    set(CMAKE_C_FLAGS "-fPIC --sysroot=${CMAKE_FIND_ROOT_PATH}" CACHE INTERNAL "" FORCE)
    set(CMAKE_CXX_FLAGS "-fPIC --sysroot=${CMAKE_FIND_ROOT_PATH}" CACHE INTERNAL "" FORCE)
    # Set default library search path
    set(CMAKE_LIBRARY_PATH "${LD_PATH} ${LD_PATH_EXTRA} ${LD_PATH_EXTRA_1}")
    # Search for programs only in the build host directories
    set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
    # Search for libraries and headers only in the target directories
    set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
    set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
    # set system default include dir
    include_directories(BEFORE SYSTEM ${VIBRANTE_PDK}/include)
    

    Then we can use cmake to compile it in the same way as the DW tutorial. But before that, we need to fix the broken dependencies as indicated in urls of step 2, which is following. You need to specify your path of lowerdir based on your VIBRANTE_PDK.

    sudo mkdir /lib/aarch64-linux-gnu
    sudo mkdir /tmp/ros-cc-overlayfs
    sudo mount -t overlay -o lowerdir=/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/lib/aarch64-linux-gnu,upperdir=/lib/aarch64-linux-gnu,workdir=/tmp/ros-cc-overlayfs overlay /lib/aarch64-linux-gnu
    

    Finally, we can cmake the source by:

    cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_TOOLCHAIN_FILE=../cmake/ros-xavier-toolchain.cmake \
    ..
    
  4. Some issues may engage
    • If some libraries are required, then you need the command sudo LC_ALL=C chroot and then install it for the VIBRANTE_PDK/targetfs_a folder, and on the target Xavier to align the libraries.
    • If Could NOT find EGL (missing: EGL_LIBRARY) is shown during compiling, then you need to specify the cmake/FindEGL.cmake find_library command as find_library(EGL_LIBRARY EGL ${VIBRANTE_PDK}/lib-target). I'm not clear with the reason why the cross compiler cannot properly find EGL_LIBRAY.
    • If you compiled the 3rd party glfw, then you may meet some errors like ``` make[2]: *** No rule to make target '/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml', needed by '3rdparty/src/glfw/wayland-pointer-constraints-unstable-v1-client-protocol.h'. Stop. ``` That may be due to your ./CMakeLists.txt project name is not set as "project(DriveworksSDK-Samples C CX)". I think it perhaps due to the commandline in ./3rdparty/src/glfw/CMakeLists.txt line 86
      elseif(VIBRANTE_V5L AND NOT ${CMAKE_PROJECT_NAME} STREQUAL DriveworksSDK-Samples)
      

      My solution is just keep the project name as default.

1 Like

Hi,

when trying to replicate this, I also get the error:

[ 92%] Building CXX object src/framework/CMakeFiles/samples_framework.dir/ScreenshotHelper.cpp.o
In file included from /home/christian/absolut_drive/camera/src/framework/Log.cpp:44:0:
/home/christian/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h:
 No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.

It seems like this only comes up when trying to use and compile the framework-files. I have successfully compiled Driveworks-ROS-Nodes both with the method described here as well as with catkin_make_isolated.

How did you solve the issue with the stdlib.h error? Does anybody have any more suggestions?

Thanks

@hanyang.zhuang: if you have any direction you can point me, if you have any idea where this stdlib error might root from, I appreciate any advice! Cross-Compilation with ROS and Driveworks Sample framework is seriously driving me crazy…

Thanks in advance!

Hi cschro,

The problem is due to this “#include_next” marco, however, I have no idea why this happens. My solution is to modify the standard libs which you can find in the output information,
“/home/christian/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cstdlib”.

Then replace “#include_next” by “#include”. You can modify cstdlib first, then compile again. Then you can modify the next one based on the output information until no more errors.

Hope this may help!

Hi, thank you @hanyang.zhuang for the instructions. I was able to follow them and succesfully cross-compiled a combination of ROS publisher and the Hello World sample. I then continued by trying to compile the Camera GMSL sample since I need ROS nodes to read from GMSL-cameras.
Doing this, I ran into the following error:

/home/user/catkin_ws_target/devel/lib/libglfw-src.a(vulkan.c.o): In function `_glfwInitVulkan':
/home/user/catkin_ws_target/src/nvidia_camera_test/3rdparty/src/glfw/3.2-screen/src/vulkan.c:50: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/user/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libdl.a(dlopen.o): In function `dlopen':
(.text+0x10): undefined reference to `__dlopen'
/home/user/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libdl.a(dlclose.o): In function `dlclose':
(.text+0x0): undefined reference to `__dlclose'
/home/user/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/lib/aarch64-linux-gnu/libdl.a(dlsym.o): In function `dlsym':
(.text+0x10): undefined reference to `__dlsym'
collect2: error: ld returned 1 exit status

I tracked down the error to the compilation of 3rd party library glfw and this part of ./3rdparty/src/glfw/CMakeLists.txt:

if(VIBRANTE_V5Q)
    message(STATUS "Building GLFW for Screen (static)")
    glfw_build_for_winsys("glfw-screen" "SCREEN" DEPLIBS)

    add_library(${PROJECT_NAME} STATIC $<TARGET_OBJECTS:glfw-screen>)
    target_link_libraries(${PROJECT_NAME} ${DEPLIBS})
elseif(VIBRANTE_V5L AND NOT ${CMAKE_PROJECT_NAME} STREQUAL DriveworksSDK-Samples)
    message(STATUS "Building GLFW for X11 (shared)")

    glfw_build_for_winsys("glfw-x11" "X11" DEPLIBS)
    add_library(${PROJECT_NAME} SHARED $<TARGET_OBJECTS:glfw-x11>)
    target_link_libraries(${PROJECT_NAME} ${DEPLIBS})
    set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME glfw)

    if(DW_ENABLE_WAYLAND)
        message(STATUS "Building GLFW for Wayland (shared)")

        glfw_build_for_winsys("glfw-wayland" "WAYLAND" DEPLIBS)
        add_library(${PROJECT_NAME}-wayland SHARED $<TARGET_OBJECTS:glfw-wayland>)
        target_link_libraries(${PROJECT_NAME}-wayland ${DEPLIBS})
        set_target_properties(${PROJECT_NAME}-wayland PROPERTIES
                                                      OUTPUT_NAME glfw-wayland)
        # Add dependency to the main target
        add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-wayland)
    endif()
else()
    message(STATUS "Building GLFW for X11 (static)")
    glfw_build_for_winsys("glfw-x11" "X11" DEPLIBS)

    add_library(${PROJECT_NAME} STATIC $<TARGET_OBJECTS:glfw-x11>)
    target_link_libraries(${PROJECT_NAME} ${DEPLIBS})
endif()

Note that this is the same part that caused the following error for the Hello World sample, which hanyang.zuang solved by keeping the project name as DriveworksSDK-Samples.

make[2]: *** No rule to make target '/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml', 
    needed by '3rdparty/src/glfw/wayland-pointer-constraints-unstable-v1-client-protocol.h'.  Stop.

Depending on the project name, the compiler will execute either the elseif part or the else part of the snippet above. When keeping the name as DriveworksSDK-Samples, the else part is executed, which STATICALLY builds GLFW for X11. This works fine for the Hello World sample because it doesn’t make use of glfw. However, for other samples like Camera GMSL, it produces an error since dlopen shouldn’t be called from statically linked libraries.
So far, I mainly tried three workarounds:

  1. Adding dl to the target_link_libraries (line 31), which does not make a difference
  2. Changing STATIC to SHARED in add_library (line 30), which results in a lot of “undefined reference to [SOME_GLFW_FUNCTION]” errors in framework/Window.cpp as well as undefined references to __dlopen, __dlsym and __dlclose in /home/user/catkin_ws_target/devel/lib/libglfw-src.so.
  3. Using a different project name than DriveworksSDK-Samples, which initially produces the “No rule to make target ‘/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml’” error from above. I worked around this by modifying ./3rdparty/src/glfw/3.2-screen/src/CMakeLists.txt and replacing ${WAYLAND_PROTOCOLS_PKGDATADIR} in lines 37 and 41 by the absolute path to …/targetfs_a/home/nvidia/drive-t186ref-linux/samples/wayland/weston/wayland-protocols/. Unfortunately, I then received the same errors as described in 2).

At this point, I am not sure how to proceed and would gladly appreciate any help.

@hanyang.zhuang Thank you for describing these steps, the process looks promising but I’m running into issues installing ROS Melodic on the target.

You mention that “the apt install command may not work well” – I think this is what I’m experiencing.

While following the ROS installation instructions, I get this error message after attempting to install ros-melodic-desktop-full:

nvidia@tegra-ubuntu:~$ sudo apt-get install ros-melodic-desktop-full
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ros-melodic-desktop-full : Depends: ros-melodic-desktop but it is not going to be installed
                            Depends: ros-melodic-perception but it is not going to be installed
                            Depends: ros-melodic-simulators but it is not going to be installed
                            Depends: ros-melodic-urdf-sim-tutorial but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Has anyone else seen this issue? I’ve run sudo apt-get update, etc., I can’t resolve this error. Thanks.

For what it’s worth, I was able to resolve this issue on my target by editing /etc/apt/sources.list – for some reason it was empty.

I added these lines, based on this page (found by web search): https://github.com/openstack/kolla/blob/master/docker/base/sources.list.ubuntu.aarch64

deb http://ports.ubuntu.com/ bionic main universe
deb http://ports.ubuntu.com/ bionic-updates main universe
deb http://ports.ubuntu.com/ bionic-security main universe

Then I ran these commands, based on a ROS Kinetic installation tutorial from old NVIDIA docs:

sudo apt-get install software-properties-common

sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted

Then I was able to start the installation of ros-melodic-desktop-full.

Maybe this will help someone else in the same situation.