Failed to make OpenCV on Rasp Pi 3

asked 2018-10-17 06:10:40 -0600

I'm new to this so don't know what to do

RaspberrY Pi 3 Model B / Raspbian Stretch / OpenCV 3.3.0

When I am compiling OpenCV , it is stopping after some time.

Scanning dependencies of target carotene_objs
Scanning dependencies of target IlmImf
Scanning dependencies of target libwebp
Scanning dependencies of target libprotobuf
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/absdiff.cpp.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/alpha_dec.c.o
[ 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
[ 0%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/arena.cc.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/buffer_dec.c.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/accumulate.cpp.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/frame_dec.c.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/add.cpp.o
[ 0%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/arenastring.cc.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/add_weighted.cpp.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/idec_dec.c.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/bitwise.cpp.o
[ 0%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/extension_set.cc.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/io_dec.c.o
[ 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Iex/IexBaseExc.cpp.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/blur.cpp.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/quant_dec.c.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/tree_dec.c.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/canny.cpp.o
[ 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Iex/IexThrowErrnoExc.cpp.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/channel_extract.cpp.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/vp8_dec.c.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/channels_combine.cpp.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/cmp.cpp.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/vp8l_dec.c.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/colorconvert.cpp.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/common.cpp.o
[ 0%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/webp_dec.c.o
[ 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmThread/IlmThread.cpp.o
[ 0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/convert.cpp.o
[ 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmThread/IlmThreadMutex.cpp.o
[ 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmThread/IlmThreadMutexPosix ...
(more)
edit retag flag offensive close merge delete

Comments

  • 3.3.0 is outdated. why waste time with that ?
  • your gcc version ? (it does not seem to like the code)
  • you could try to disable some problematic modules like: cmake -DWITH_OPENEXR=OFF or -DBUILD_opencv_dnn=OFF
berak gravatar imageberak ( 2018-10-17 06:23:10 -0600 )edit
  1. Actually I was using this guide : link text And I can't find another version on github(Maybe I'm searching the wrong way)
  2. I'm using CMake and it says cmake is already the newest version (3.7.2-1).
  3. I'm running into error with this : `CMake Error: The source directory "/home/pi/opencv-3.3.0/build/WITH_OPENEXR=OFF" does not exist. This is what I commanded :

    cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D WITH_OPENEXR=OFF
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
    -D BUILD_EXAMPLES=ON ..
    

Please correct me where I'm wrong

theCorvoX3N gravatar imagetheCorvoX3N ( 2018-10-17 08:40:25 -0600 )edit

\missing after -D WITH_OPENEXR=OFF

(so it thinks, the cmdline is "over", and that this is the src location)

but i asked for gcc --version

berak gravatar imageberak ( 2018-10-17 08:45:15 -0600 )edit

gcc - 6.3.0 and I added \ and now its making, let's see how it turns out now

theCorvoX3N gravatar imagetheCorvoX3N ( 2018-10-17 08:50:44 -0600 )edit

it will still choke on the dnn related error :\

berak gravatar imageberak ( 2018-10-17 08:53:17 -0600 )edit

So I should -D BUILD_opencv_dnn=OFF also

theCorvoX3N gravatar imagetheCorvoX3N ( 2018-10-17 08:57:57 -0600 )edit

probably.

but keep a copy of the previous build log , so you can still try to analyze, why those "internal compiler errors" happened !

berak gravatar imageberak ( 2018-10-17 08:59:35 -0600 )edit

and really, try with more recent code !

berak gravatar imageberak ( 2018-10-17 09:00:10 -0600 )edit

Now, it fails like this:

[  8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/utils/huffman_utils.c.o

/home/pi/opencv-3.3.0/3rdparty/libwebp/utils/huffman_utils.c: In function ‘BuildHuffmanTable’: /home/pi/opencv-3.3.0/3rdparty/libwebp/utils/huffman_utils.c:197:1: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See <file: usr="" share="" doc="" gcc-6="" readme.bugs=""> for instructions. 3rdparty/libwebp/CMakeFiles/libwebp.dir/build.make:2582: recipe for target '3rdparty/libwebp/CMakeFiles/libwebp.dir/utils/huffman_utils.c.o' failed make[2]: * [3rdparty/libwebp/CMakeFiles/libwebp.dir/utils/huffman_utils.c.o] Error 1 make[2]: * Waiting for unfinished jobs....

theCorvoX3N gravatar imagetheCorvoX3N ( 2018-10-17 09:17:23 -0600 )edit

well, that compiled before, right ?

looks like your gcc install is broken, now (and it fails in random places).

but, just to make sure: do you have enough memory / swap / disk space ?

(sorry, i can only guess, now)

berak gravatar imageberak ( 2018-10-17 09:21:32 -0600 )edit