ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ros2 foxy install jetson nano fails qt_gui_cpp

asked 2022-04-30 12:36:38 -0600

kyubot gravatar image

updated 2022-05-01 02:26:43 -0600

I apt installed ros2 on ubuntu 20.04 and worked just fine however I need to install opencv 4.2.0 which caused removing all ros2 installation.

So I need to build install ros2 as described in the document here https://docs.ros.org/en/foxy/Installa...

I followed every step in the process and when trying to colcon build, the process stuck at qt_gui_core as below

$ colcon build --symlink-install

Starting >>> ament_pyflakes
--- stderr: qt_gui_cpp                                                                
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipcmodule.o] Error 1
make[2]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:61: src/qt_gui_cpp_sip/libqt_gui_cpp_sip.so] Error 2
make[1]: *** [CMakeFiles/Makefile2:237: src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< qt_gui_cpp [18.1s, exited with code 2]
Aborted  <<< ament_pyflakes [14.5s]                                                              
Aborted  <<< rosidl_typesupport_fastrtps_cpp [1min 42s]                                           
Aborted  <<< rviz_rendering [4min 25s]                                              

Summary: 120 packages finished [6min 38s]
  1 package failed: qt_gui_cpp
  3 packages aborted: ament_pyflakes rosidl_typesupport_fastrtps_cpp rviz_rendering
  2 packages had stderr output: qt_gui_cpp rviz_rendering
  187 packages not processed

When tried to build just qt_gui_cpp

$ colcon build --symlink-install --packages-select qt_gui_cpp
Starting >>> qt_gui_cpp
--- stderr: qt_gui_cpp                             
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipcmodule.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipQList0101qt_gui_cppPluginDescriptor.o] Error 1
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipQList0101qt_gui_cppPluginProvider.o] Error 1
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipQMap0100QString0100QString.o] Error 1
make[2]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:61: src/qt_gui_cpp_sip/libqt_gui_cpp_sip.so] Error 2
make[1]: *** [CMakeFiles/Makefile2:237: src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< qt_gui_cpp [0.97s, exited with code 2]

Summary: 0 packages finished [5.74s]
  1 package failed: qt_gui_cpp
  1 package had stderr output: qt_gui_cpp

I double checked the process with my own laptop running Ubuntu 20.04
Also followed same instruction and all build ok.
There was some warnings while building qt_gui_cpp as below

--- stderr: qt_gui_cpp                                                                   
qt.shiboken: (typesystem) Unable to locate Clang's built-in include directory (neither by checking the environment variables LLVM_INSTALL_DIR, CLANG_INSTALL_DIR  nor running llvm-config). This may lead to parse errors.
(typesystem) clang_parseTranslationUnit2(0x0, cmd[25]=-fPIC -Wno-constant-logical-operand -std=c++14 -I/home/khyou/ros2_foxy/src/ros-visualization/qt_gui_core/qt_gui_cpp/include -I/home/khyou/ros2_foxy/install/pluginlib/include -I/home/khyou/ros2_foxy/install/class_loader/include -I/home/khyou/ros2_foxy/install/rcpputils/include -I/home/khyou/ros2_foxy/install/rcutils/include -I/home/khyou/ros2_foxy/install/ament_index_cpp/include -I/opt/ros/foxy/include -I/usr/include -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-05-09 07:15:31 -0600

kyubot gravatar image

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)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-04-30 12:36:38 -0600

Seen: 663 times

Last updated: May 09 '22