Compiling from source OpenCV 3.3 : Failed

asked 2017-08-06 05:53:50 -0500

ROSpioneer gravatar image

There is a new version released few days ago of OpenCV 3.3. I'm trying to compiling it but I didn't succeed.

I downloaded the OpenCV from source and I created a build folder in it and launch cmake:

cmake -D CMAKE_BUILD_TYPE=RELEASE \ 
-D CMAKE_INSTALL_PREFIX=/usr/local \ 
-D WITH_CUDA=ON \    
-D ENABLE_FAST_MATH=1 \    
-D CUDA_FAST_MATH=1 \    
-D WITH_CUBLAS=1 \    
-D INSTALL_C_EXAMPLES=OFF \    
-D INSTALL_PYTHON_EXAMPLES=ON \    
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.3/modules  \ 
-D BUILD_SHARED_LIBS=ON \    
-D WITH_GTK=ON /    
-D BUILD_EXAMPLES=ON ..

But I get -- Configuring incomplete, errors occurred!

I'm compiling with GNU 7.1.0 under Ubuntu 16.04

Here is my CMakeError file:

Build output check failed:
    Regex: 'command line option .* is valid for .* but not for C\+\+'
    Output line: 'cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++'
Compilation failed:
    source file: '/home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp/src.cxx'
    check option: ' -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations  -Wmissing-prototypes'
===== BUILD LOG =====
Change Dir: /home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_0daec/fast"
/usr/bin/make -f CMakeFiles/cmTC_0daec.dir/build.make CMakeFiles/cmTC_0daec.dir/build
make[1]: Entering directory '/home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0daec.dir/src.cxx.o
/usr/bin/c++     -O3 -DNDEBUG   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -o CMakeFiles/cmTC_0daec.dir/src.cxx.o -c /home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp/src.cxx
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
/home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp/src.cxx:1:0: warning: ignoring #pragma   [-Wunknown-pragmas]
 #pragma

Linking CXX executable cmTC_0daec
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0daec.dir/link.txt --verbose=1
/usr/bin/c++     -O3 -DNDEBUG    CMakeFiles/cmTC_0daec.dir/src.cxx.o  -o cmTC_0daec -rdynamic 
make[1]: Leaving directory '/home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp'

===== END =====

Build output check failed:
    Regex: 'command line option .* is valid for .* but not for C\+\+'
    Output line: 'cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++'
Compilation failed:
    source file: '/home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp/src.cxx'
    check option: ' -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations  -Wstrict-prototypes'
===== BUILD LOG =====
Change Dir: /home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_02949/fast"
/usr/bin/make -f CMakeFiles/cmTC_02949.dir/build.make CMakeFiles/cmTC_02949.dir/build
make[1]: Entering directory '/home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_02949.dir/src.cxx.o
/usr/bin/c++     -O3 -DNDEBUG   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wstrict-prototypes -o CMakeFiles/cmTC_02949.dir/src.cxx.o -c /home/hros/opencv-3.3.0/build/CMakeFiles/CMakeTmp/src.cxx
cc1plus: warning: command line option ‘-Wstrict-prototypes ...
(more)
edit retag flag offensive close merge delete

Comments

I also have a lot of issus by compiling OpenCV 3.3 with Cuda (9.0), did you succeed ?

aryus gravatar imagearyus ( 2017-10-09 11:02:10 -0500 )edit

@aryus, please don't make an answer, if you have a question, thanks.

berak gravatar imageberak ( 2017-10-09 11:03:32 -0500 )edit