Trouble building opencv 3.2.0 on raspbian(pi3)

asked 2017-03-21 09:09:12 -0600

Lindsey98 gravatar image

updated 2017-03-21 10:52:33 -0600

Hey guys! I'm facing some trouble installing 3.2.0 on my pi3. I'm new to linux. I followed the steps here: pklab(dot)net/?id=392&lang=EN

but the build would always return errors no matter what I tried. I checked my version of gcc as the problem seemed to be C++ related(? not sure). I've tried googling the errors in different ways but I'm unable to find a solution.

pastebin(cmake error log): pastebin(dot)com/FP1MA1Ji

Edit:Here's the entire build as seen on the kernel:

pi@raspberrypi:~/opencv/opencv-3.2.0/build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \
> -D     CMAKE_INSTALL_PREFIX=/usr/local \
> -D BUILD_WITH_DEBUG_INFO=OFF \
> -D BUILD_DOCS=OFF \
> -D BUILD_EXAMPLES=OFF \
> -D BUILD_TESTS=OFF \
> -D BUILD_opencv_ts=OFF \
> -D BUILD_PERF_TESTS=OFF \
> -D INSTALL_C_EXAMPLES=OFF \
> -D INSTALL_PYTHON_EXAMPLES=ON \
> -D OPENCV_EXTRA_MODULES_PATH=opencv/opencv_contrib-3.2.0/modules \
> -D ENABLE_NEON=ON \
> -D WITH_LIBV4L=ON \
>         ../
-- The CXX compiler identification is GNU 4.9.2
-- The C compiler identification is GNU 4.9.2
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works 
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Detected version of GNU GCC: 49 (409)
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing Test HAVE_C_W - Success
-- Performing Test HAVE_CXX_WALL
-- Performing Test HAVE_CXX_WALL - Success
-- Performing Test HAVE_C_WALL
-- Performing Test HAVE_C_WALL - Success
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_C_WERROR_RETURN_TYPE
-- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_CXX_WERROR_ADDRESS
-- Performing Test HAVE_CXX_WERROR_ADDRESS - Success
-- Performing Test HAVE_C_WERROR_ADDRESS
-- Performing Test HAVE_C_WERROR_ADDRESS - Success
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_CXX_WFORMAT
-- Performing Test HAVE_CXX_WFORMAT - Success
-- Performing Test HAVE_C_WFORMAT
-- Performing Test HAVE_C_WFORMAT - Success
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WMISSING_DECLARATIONS
-- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
-- Performing Test HAVE_C_WMISSING_PROTOTYPES
-- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success 
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WUNDEF
-- Performing Test HAVE_CXX_WUNDEF - Success
-- Performing Test HAVE_C_WUNDEF
-- Performing Test HAVE_C_WUNDEF - Success
-- Performing Test HAVE_CXX_WINIT_SELF
-- Performing Test HAVE_CXX_WINIT_SELF - Success
-- Performing Test HAVE_C_WINIT_SELF
-- Performing Test HAVE_C_WINIT_SELF - Success
-- Performing Test HAVE_CXX_WPOINTER_ARITH
-- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
-- Performing Test HAVE_C_WPOINTER_ARITH
-- Performing Test HAVE_C_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_WSHADOW
-- Performing Test HAVE_CXX_WSHADOW - Success
-- Performing Test HAVE_C_WSHADOW
-- Performing Test HAVE_C_WSHADOW - Success
-- Performing Test HAVE_CXX_WSIGN_PROMO
-- Performing Test HAVE_CXX_WSIGN_PROMO - Success
-- Performing Test HAVE_C_WSIGN_PROMO
-- Performing Test HAVE_C_WSIGN_PROMO - Failed
-- Performing Test HAVE_CXX_WNO_NARROWING
-- Performing Test HAVE_CXX_WNO_NARROWING - Success
-- Performing Test HAVE_C_WNO_NARROWING
-- Performing Test HAVE_C_WNO_NARROWING - Success
-- Performing Test ...
(more)
edit retag flag offensive close merge delete

Comments

you can ask to blog author@pklab

LBerger gravatar imageLBerger ( 2017-03-21 09:26:02 -0600 )edit

i cannot see any actual errors here, are you sure, this is the complete output ?

berak gravatar imageberak ( 2017-03-21 09:45:13 -0600 )edit
1

@berak I have edited the post to include the whole build log as seen on my kernel

and also, I have copied the cmake error log to a pastebin: pastebin(dot)com/FP1MA1Ji

Lindsey98 gravatar imageLindsey98 ( 2017-03-21 10:48:07 -0600 )edit

one error is here

No extra modules found in folder:
/home/pi/opencv/opencv-3.2.0/build/opencv/opencv_contrib-3.2.0/modules

Please provide path to 'opencv_contrib/modules' folder.
Call Stack (most recent call first):
 modules/CMakeLists.txt:7 (ocv_glob_modules)

is path correct?

LBerger gravatar imageLBerger ( 2017-03-21 10:49:37 -0600 )edit

@LBerger In the cmake command I entered the following path, -D OPENCV_EXTRA_MODULES_PATH=opencv/opencv_contrib-3.2.0/modules

That path is correct both opencv-3.2.0 and opencv_contrib-3.2.0 are inside directory "opencv"

Lindsey98 gravatar imageLindsey98 ( 2017-03-21 10:56:52 -0600 )edit

Can you try without opencv_contrib first?

LBerger gravatar imageLBerger ( 2017-03-21 11:00:39 -0600 )edit

@Lindsay98 the correct path to contrib would be:

OPENCV_EXTRA_MODULES_PATH=/home/pi/opencv/opencv_contrib-3.2.0/modules
berak gravatar imageberak ( 2017-03-21 11:04:30 -0600 )edit

Ok I've checked the tutorial and it looks correct. BTW you should use right path for contrib modules absolute or relative path. Maybe you mistype the / at the beginning or you can try with relative path such as -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.2.0/modules. Thank you to @LBerger

pklab gravatar imagepklab ( 2017-03-21 11:30:27 -0600 )edit

@LBerger Tried it without the contrib and it worked!!

Tried it with both @berak 's OPENCV_EXTRA_MODULES_PATH=/home/pi/opencv/opencv_contrib-3.2.0/modules and @pklab 's updated path and it doesn't work

So i guess, it's the contrib path.. any ideas? tried renaming the contrib directory to opencv_contrib, it still doesn't work.. I should have tried it without the contrib at the beginning when I started debugging. Rookie mistake.

Thank you guys so much @LBerger , @pklab and @berak

Lindsey98 gravatar imageLindsey98 ( 2017-03-21 11:40:29 -0600 )edit

100%, the path is still wrong. last attempt: cd into your opencv_contrib/modules folder, and try a pwd

(i'm almost sure, that this will lead to some 'omg, previous assumptions were all wrong' moment)

berak gravatar imageberak ( 2017-03-21 11:49:26 -0600 )edit