ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
It turned out,the issue is relate to the version of gcc, g++ currently in use.
ubuntu build for Jetson nano comes with gcc v7.5 and it seems like ros2 colcon build requires gcc version at least 9.4.
In jetson nano symlink gcc is located in /usr/local/cuda-10.0/bin aiming at /usr/bin/g++-7
To solve this issue, I first installed gcc-9, g++-9
$ sudo apt install g++-9 gcc-9
Then removed gcc, g++ in /usr/local/cuda-10.0/bin
$ sudo rm /usr/local/cuda-10.0/bin/gcc
$ sudo rm /usr/local/cuda-10.0/bin/g++
And created symlink to /usr/bin/gcc-9, /usr/bin/g++-9 as below
$ sudo ln -s /usr/bin/gcc-9 /usr/local/cuda-10.0/bin/gcc
$ sudo ln -s /usr/bin/g++-9 /usr/local/cuda-10.0/bin/g++
After this check currently using gcc, g++ by
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)