rreichel
rreichel

Reputation: 823

internal compiler error: Segmentation fault On Raspberry Pi

While trying to build OpenCV 3.3.0 on a Raspberry Pi I keep getting compiler level segmentation faults. I am following the guide here on building the optimized OpenCV Library.

The cmake step works perfectly fine however, when I attempt to run make -j4 a number of segmentation faults come from the compiler.

Upvotes: 6

Views: 5843

Answers (2)

Alexander
Alexander

Reputation: 1502

Hi I ran into a similar problem with the xtensor library on Xavier NX. The version of gcc was 7.5.0 . After I switched to gcc version 8.4.0 the internal compiler error went away.

Here is the tutorial to switch between multiple gcc versions:

https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa

Best

Upvotes: 1

rreichel
rreichel

Reputation: 823

The solution to this ended up being something related to the usage of multiple jobs. I still am not 100% sure what the cause was, however upon running the make command with the -j2 flag instead of the -j4 flag it compiled perfectly fine, albeit much slower. I think this may have been coming from memory allocation bugs that arise when running on a machine with sparse resources.

#Fixed command:
make -j2

Edit: Modified the text to more accurately describe what the -j flag does.

Upvotes: 2

Related Questions