Segmentation Fault - C++ Compiler Fault Jetson Nano 4 GB

Hello , i’m working with Jetson Nano 4GB in my project. I’ve downloaded ubuntu 18.04 and done all the setup configurations correctly. I’m using ira_laser_tools and rf20_laser_odometry Ros packages but when i cmake i get this fault code.
In file included from /home/ubuntu/Tof_ws/src/ira_laser_tools/src/laserscan_multi_merger.cpp:13:
/opt/ros/melodic/include/pcl_ros/point_cloud.h:303:27: UYARI: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’
303 | constexpr static bool pcl_uses_boost = true;
| ^~~~~~
In file included from /home/ubuntu/Tof_ws/src/ira_laser_tools/src/laserscan_virtualizer.cpp:12:
/opt/ros/melodic/include/pcl_ros/point_cloud.h:303:27: UYARI: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’
303 | constexpr static bool pcl_uses_boost = true;
| ^~~~~~
c++: derleyici iç hatası: Segmentation fault signal terminated program cc1plus
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
ira_laser_tools/CMakeFiles/laserscan_virtualizer.dir/build.make:62: recipe for target ‘ira_laser_tools/CMakeFiles/laserscan_virtualizer.dir/src/laserscan_virtualizer.cpp.o’ failed
make[2]: * [ira_laser_tools/CMakeFiles/laserscan_virtualizer.dir/src/laserscan_virtualizer.cpp.o] Error 4
CMakeFiles/Makefile2:3209: recipe for target ‘ira_laser_tools/CMakeFiles/laserscan_virtualizer.dir/all’ failed
make[1]: * [ira_laser_tools/CMakeFiles/laserscan_virtualizer.dir/all] Error 2
make[1]: * Waiting for unfinished jobs…
c++: derleyici iç hatası: Segmentation fault signal terminated program cc1plus
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
ira_laser_tools/CMakeFiles/laserscan_multi_merger.dir/build.make:62: recipe for target ‘ira_laser_tools/CMakeFiles/laserscan_multi_merger.dir/src/laserscan_multi_merger.cpp.o’ failed
make[2]: * [ira_laser_tools/CMakeFiles/laserscan_multi_merger.dir/src/laserscan_multi_merger.cpp.o] Error 4
CMakeFiles/Makefile2:3172: recipe for target ‘ira_laser_tools/CMakeFiles/laserscan_multi_merger.dir/all’ failed
make[1]: * [ira_laser_tools/CMakeFiles/laserscan_multi_merger.dir/all] Error 2
Makefile:140: recipe for target ‘all’ failed
make: * [all] Error 2
Invoking “make -j4 -l4” failed

I don’t know if I can help, but what version compiler? For example, on an R32.4 NX I see “g++ --version” replies as “g++ (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0”. I can’t see what your actual compile line is, but “c++” is normally just a symbolic link to “g++”. This won’t support the “c++14” standard because the version is too old.

Before speaking more on versions, I want to point out that multiple versions can exist at the same time. Whichever version is “default” will respond to just the “g++” or “c++” command, but specific versions are also available. On my Ubuntu 18.04 host PC, if I type “g++”, and then use tab completion by hitting the tab a couple of times, it shows I have these:

  • g++
  • g++-6
  • g++-7

It turns out the “7” version can be called by running either command “g++” or “g++-7”. The “g++-6” is for older legacy builds. If you run a search on versions of “g++” available, like this, you’ll see a lot of hits for both g++ and related software:
apt search g++

To see version 8 of g++ ("g++-8"), and search for it in a pager, try this command:
apt search g++ | less -p 'g\+\+-8'

Different versions are visible, but the one which shows up as just “g++-8” will be the one which is native to the operating system’s architecture. Or you can install one for running on the current architecture, but which cross compiles to another architecture. Assuming you are building directly on the Jetson you could in theory just install version 8 via “sudo apt-get install g++-8”. If you were to run the same command on a desktop PC (amd64 architecture), then you’d get the “amd64” version.

Compiler software can take a lot of space, so be careful about disk space when adding a new compiler, but you can add g++ version 8 (without changing defaults and without removing old software) simply by:

sudo apt update
sudo apt-get install g++-8

When done the response from “g++ --version” should still show version 7.5.0, but now command “g++-8” will become available, and the command “g++-8 --version” should respond with something like “8.4.0”. I did this on the host PC, and I also installed some doc man pages (also takes extra space…I wouldn’t install the docs on the Jetson due to disk space on my SD card not being enough), but this will indicate that the “--std=...” option now includes these:

  • c17
  • c18
  • c++14
  • c++17
  • gnu++14
  • gnu++17

The g++-8 should handle the requested “gnu++14” (and then some). It is quite possible that other related content will still be required, e.g., some library might also be an optional install.

You would need to change the call of g++ in your cmake file to call “g++-8”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.