alfonso@alfonso:~/Documents/opencv/opencv-3.1.0/release$ sudo cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DWITH_OPENGL=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DWITH_IPP=ON -DINSTALL_CREATE_DISTRIB=ON -D OPENCV_EXTRA_MODULES_PATH=/home/alfonso/Documents/opencv/opencv_contrib/modules -DBUILD_opencv_ts=0 ..
-- Detected version of GNU GCC: 48 (408)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so
-- checking for module 'gstreamer-base-1.0'
-- package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
-- package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
-- package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
-- package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
-- package 'gstreamer-pbutils-1.0' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavresample'
-- package 'libavresample' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - found
-- checking for module 'libgphoto2'
-- package 'libgphoto2' not found
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/alfonso/Documents/opencv/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx
-- CUDA detected: 7.5
-- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30
-- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.3", minimum required is "3.4")
-- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found suitable exact version "3.4.3")
-- Found apache ant 1.9.3: /usr/bin/ant
-- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
-- Found VTK ver. 6.0.0 (usefile: /usr/lib/cmake/vtk-6.0/UseVTK.cmake)
-- Caffe: NO
-- Protobuf: YES
-- Glog: NO
-- HDF5: YES
-- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
-- Tesseract: NO
-- Processing WORLD modules...
-- module opencv_cudev...
CMake Error at modules/cudev/CMakeLists.txt:21 (add_subdirectory):
add_subdirectory given source "test" which is not an existing directory.
Call Stack (most recent call first):
modules/world/CMakeLists.txt:13 (include)
modules/world/CMakeLists.txt:25 (include_one_module)
-- module opencv_core...
-- module opencv_cudaarithm...
-- module opencv_flann...
-- module opencv_imgproc...
-- module opencv_ml...
-- module opencv_video...
-- module opencv_viz...
-- module opencv_cudabgsegm...
-- module opencv_cudafilters...
-- module opencv_cudaimgproc...
-- module opencv_cudawarping...
-- module opencv_imgcodecs...
-- module opencv_photo...
-- module opencv_shape...
-- module opencv_videoio...
-- module opencv_cudacodec...
-- module opencv_highgui...
-- module opencv_objdetect...
-- module opencv_features2d...
-- module opencv_calib3d...
-- module opencv_cudafeatures2d...
-- module opencv_cudalegacy...
-- module opencv_cudaobjdetect...
-- module opencv_cudaoptflow...
-- module opencv_cudastereo...
-- module opencv_stitching...
-- module opencv_superres...
-- module opencv_videostab...
-- Processing WORLD modules... DONE
-- Processing module opencv_xfeatures2d...
-- Processing module opencv_ximgproc...
-- Processing module opencv_xobjdetect...
-- Processing module opencv_xphoto...
-- Processing module opencv_aruco...
-- Processing module opencv_bgsegm...
-- Processing module opencv_bioinspired...
-- Processing module opencv_ccalib...
-- Processing module opencv_cvv...
-- Processing module opencv_dnn...
-- Build libprotobuf from sources:
-- The protocol buffer compiler not found
-- Processing module opencv_dpm...
-- Processing module opencv_face...
-- Processing module opencv_fuzzy...
-- Processing module opencv_hdf...
-- HDF5: YES
CMake Warning (dev) at /home/alfonso/Documents/opencv/opencv_contrib/modules/hdf/CMakeLists.txt:20 (target_link_libraries):
Policy CMP0023 is not set: Plain and keyword target_link_libraries
signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
The keyword signature for target_link_libraries has already been used with
the target "opencv_hdf". All uses of target_link_libraries with a target
should be either all-keyword or all-plain.
The uses of the keyword signature are here:
* /home/alfonso/Documents/opencv/opencv-3.1.0/cmake/OpenCVUtils.cmake:731 (target_link_libraries)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Processing module opencv_line_descriptor...
-- Processing module opencv_optflow...
-- Processing module opencv_plot...
-- Processing module opencv_reg...
-- Processing module opencv_rgbd...
-- Processing module opencv_saliency...
-- Processing module opencv_stereo...
-- Processing module opencv_structured_light...
-- Processing module opencv_surface_matching...
-- Processing module opencv_text...
-- Tesseract: NO
-- Processing module opencv_datasets...
-- Processing module opencv_tracking...
--
-- General configuration for OpenCV 3.1.0 =====================================
-- Version control: unknown
--
-- Platform:
-- Host: Linux 3.19.0-51-generic x86_64
-- CMake: 2.8.12.2
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: RELEASE
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++ (ver 4.8.4)
-- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: YES
-- Extra dependencies: /usr/lib/x86_64-linux-gnu/libhdf5.so /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so dl m pthread rt /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so tbb cudart nppc nppi npps cublas cufft -L/usr/local/cuda/lib64
-- 3rdparty dependencies:
--
-- OpenCV modules:
-- To be built: cudev core cudaarithm flann imgproc ml video viz cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio cudacodec highgui objdetect features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab world xfeatures2d ximgproc xobjdetect xphoto aruco bgsegm bioinspired ccalib cvv dnn dpm face fuzzy hdf line_descriptor optflow plot reg rgbd saliency stereo structured_light surface_matching text datasets tracking
-- Disabled: ts contrib_world
-- Disabled by dependency: -
-- Unavailable: java python2 matlab sfm
--
-- GUI:
-- QT 5.x: YES (ver 5.2.1)
-- QT OpenGL support: YES (Qt5::OpenGL 5.2.1)
-- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so)
-- VTK support: YES (ver 6.0.0)
--
-- Media I/O:
-- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
-- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
-- WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x0202)
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.50)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.3)
-- JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
-- OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 1.6.1)
-- GDAL: /usr/lib/libgdal.so
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.2.1)
-- FFMPEG: YES
-- codec: YES (ver 57.28.103)
-- format: YES (ver 57.28.101)
-- util: YES (ver 55.19.100)
-- swscale: YES (ver 4.0.100)
-- resample: NO
-- gentoo-style: YES
-- GStreamer:
-- base: YES (ver 0.10.36)
-- video: YES (ver 0.10.36)
-- app: YES (ver 0.10.36)
-- riff: YES (ver 0.10.36)
-- pbutils: YES (ver 0.10.36)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- OpenNI2: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l1 (ver 0.8.8) / libv4l2 (ver 0.8.8)
-- XIMEA: NO
-- Xine: YES (ver 1.1.21)
-- gPhoto2: NO
--
-- Parallel framework: TBB (ver 4.2 interface 7000)
--
-- Other third-party libraries:
-- Use IPP: 9.0.1 [9.0.1]
-- at: /home/alfonso/Documents/opencv/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx
-- Use IPP Async: NO
-- Use VA: NO
-- Use Intel VA-API/OpenCL: NO
-- Use Eigen: YES (ver 3.2.0)
-- Use Cuda: YES (ver 7.5)
-- Use OpenCL: YES
-- Use custom HAL: NO
--
-- NVIDIA CUDA
-- Use CUFFT: YES
-- Use CUBLAS: YES
-- USE NVCUVID: NO
-- NVIDIA GPU arch: 20 21 30 35
-- NVIDIA PTX archs: 30
-- Use fast math: YES
--
-- OpenCL:
-- Version: dynamic
-- Include path: /home/alfonso/Documents/opencv/opencv-3.1.0/3rdparty/include/opencl/1.2
-- Use AMDFFT: NO
-- Use AMDBLAS: NO
--
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.6)
--
-- Python 3:
-- Interpreter: /usr/bin/python3.4 (ver 3.4.3)
--
-- Python (for build): /usr/bin/python2.7
--
-- Java:
-- ant: /usr/bin/ant (ver 1.9.3)
-- JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include
-- Java wrappers: NO
-- Java tests: NO
--
-- Matlab: Matlab not found or implicitly disabled
--
-- Documentation:
-- Doxygen: /usr/bin/doxygen (ver 1.8.6)
-- PlantUML: NO
--
-- Tests and samples:
-- Tests: NO
-- Performance tests: NO
-- C/C++ Examples: YES
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /home/alfonso/Documents/opencv/opencv-3.1.0/release
-- -----------------------------------------------------------------
--
-- Configuring incomplete, errors occurred!
1) You should install "-dev" packages to have ".h" files
2) Remove -DINSTALL_CREATE_DISTRIB=ON (or disable tests or disable CUDA) and rerun CMake from clean build directory.
Thanks,
But I already have the latest libv4l-dev and libv4l-0 installed.
I also followed: " Remove -DINSTALL_CREATE_DISTRIB=ON (or disable tests or
disable CUDA) and rerun CMake from clean build directory.".
After disabling the tests, cmake managed to create a build file, but build
errors always crop at (somewhere at 10% - 12%) -- The CMakeError log always
says that no /sys/videoio.h is found and halts installation
Would appreciate some help,
Pancho
On Tue, Mar 15, 2016 at 3:09 AM, Alexander Alekhin <[email protected]
wrote:
1) You should install "-dev" packages to have ".h" files
2) Remove -DINSTALL_CREATE_DISTRIB=ON (or disable tests or disable CUDA)
and rerun CMake from clean build directory.—
Reply to this email directly or view it on GitHub
https://github.com/Itseez/opencv/issues/6262#issuecomment-196477662.
CMakeError.log contains checks only. These failures reports mean nothing critical.
You should check OpenCV summary log. As you provided something is found:
V4L/V4L2: Using libv4l1 (ver 0.8.8) / libv4l2 (ver 0.8.8)
BTW, Video4Linux via wrapper libv4l is less supported and disabled by default
Also we build successfully on Ubuntu 14.04 with V4L (v2) support:
http://pullrequest.opencv.org/buildbot/builders/master_noOCL_noICV-lin64/builds/648
To debug build errors use make VERBOSE=1 -j1 after cmake.
BTW, Video4Linux via wrapper libv4l is less supported and disabled by default
actually following your link it is still enabled by default in 3.1. I was also under the impression that it is disabled by default in 3.1 though..
@paroj You are right, it is for master only and future releases! Link is fixed now.
@alfonsolink @paroj I have the same problem...
It fixed the error?
@alalek How can we work around this? I'm using Fedora 24 and can't figure out where to get those header files.
Same problem here. Following the documentation instructions and still got this error.
Update: Reading up the conversation, the -D WITH_LIBV4L=OFF worked.
Ubuntu 14.04, same problem, i followed this
http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/
and blocked in step 9 , videoio.h not found.
I download opencv_contrib, cmake, it works. no error.
Same problem here (Installing OpenCV 3.1.0-dev under Ubuntu 16.04). After I set WITH_V4L = OFF but still keep WITH_LIBV4L = ON, the configuring skipped the searching of 'sys/videoio.h', and the compilation worked.
Hi, did you resolve the issue with sys/videoio.h ?
Also having this issue. Please post how to solve this.
@j2tobias @ch3njust1n during configuration, remove the packages that use 'sys/videoio.h'; this just evades the issue, but it works well; hopefully it can be solved in the coming version.
to get any v4l support, you must compile with WITH_V4L = ON. as libv4l is deprecated also set WITH_LIBV4L = OFF.
The check for sys/videoio.h is just there for BSD and should not fail the cmake configure step. If it fails, you might have a different (related) error.
For whatever reasons, the below comments work for 3.0.0, but not 3.1.0 or 3.2.0:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D WITH_LIBV4L=ON \
-D WITH_V4L=OFF \
-D BUILD_EXAMPLES=ON ..
That is true Johnny, for no reason at all, it does not work for 3.2 but for 3.0 and 3.1
Again, "sys/videoio.h not found" is not an error - it is just a check result. So this it is not a problem at all.
You can check your gcc and g++ version. It should work for at least 4.9 version.
You can upgrade/install new version of gcc and g++ using this commands
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
Hope this help you solve the compilation error.
As a workaround, "-D INSTALL_C_EXAMPLES=OFF" works for me on Ubuntu 14.04 LTS on OpenCV3.1.0. Hope this helps.
http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/ Step 3 mentioned this:
"Update (3 January 2016): In order to build OpenCV 3.1.0 , you need to set -D INSTALL_C_EXAMPLES=OFF (rather than ON ) in the cmake command. There is a bug in the OpenCV v3.1.0 CMake build script that can cause errors if you leave this switch on. Once you set this switch to off, CMake should run without a problem."
sudo cmake -D CMAKE_BUILD_TYPE=Release -D INSTALL_C_EXAMPLES=OFF -D INSTALL_CREATE_DISTRIB=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.1.0/modules/ -D CMAKE_INSTALL_PREFIX=/usr/local ..
Above is my cmake command.Over here it still fails on:
#include <linux/videodev.h>
and
#include <sys/videoio.h>
Those are the only 2 reasons stated in the CMakeError.log, and i did disable the examples and WITH_V4L.
GCC and g++ versions are at 4.9.2. It is on a raspberry pi 3, though.
FIXED: Now it compiles flawlessy
Tried this tutorial:
https://medium.com/@debugvn/installing-opencv-3-3-0-on-ubuntu-16-04-lts-7db376f93961
It was just an error in my CMake command line:
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules
instead of:
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules
ORIGINAL MESSAGE:
Trying to install OpenCV 3.3.0 with Python 3.4 bindings from source on Linux Mint 17.1 following this tutorial:
http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/
Same CMake problem as everybody else here:
fatal error: sys/videoio.h: File o directory non esistente (= file not found)
I also see another (possibly irrelevant) error in CMakeError.log:
I have latest libv4l-dev and libv4l-0 installed.
I installed both gcc and g++ 4.9.4
I tried every suggested CMake switches combination (-D WITH_LIBV4L=ON/OFF, -D WITH_V4L=OFF/ON, -D INSTALL_C_EXAMPLES=OFF/ON).
No way to get a makefile...
Any suggestion?
Cross OpenCV 3.4 compiling to Debian arm64, made my toolchain using the ct-ng preset:
[osboxes:/work] $ /opt/x-tools/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-c++ --version
aarch64-unknown-linux-gnueabi-c++ (crosstool-NG crosstool-ng-1.23.0) 4.9.4
I tried with and without this.
I use the following command: RUN cmake -DBUILD_opencv_legacy=OFF -DOPENCV_EXTRA_MODULES_PATH=/extra_modules_opencv/opencv_contrib-3.4.0/modules/ -DWITH_LIBV4L=OFF -DINSTALL_C_EXAMPLES=OFF -WITH_FFMPEG=ON -DWITH_GTK=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_MAKE_PROGRAM=make -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DFORCE_VTK=ON -DWITH_V4L=ON -DWITH_QT=OFF -DWITH_OPENGL=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DBUILD_DOCS=OFF -DWITH_FFMPEG=ON -DENABLE_NEON=ON -DBUILD_opencv_cudabgsegm=OFF -DBUILD_opencv_superres=OFF -DBUILD_opencv_cudalegacy=OFF -DBUILD_opencv_cudafilters=OFF -DBUILD_opencv_cudastereo=OFF -DBUILD_opencv_cudafeatures2d=OFF -DBUILD_opencv_shape=OFF -DBUILD_opencv_ml=OFF -DBUILD_opencv_stitching=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_photo=OFF -DBUILD_opencv_cudaoptflow=OFF -DBUILD_opencv_ts=OFF -DBUILD_opencv_calib3d=OFF -DBUILD_opencv_videostab=OFF -DBUILD_opencv_cudacodec=OFF -DBUILD_opencv_core=ON -DBUILD_opencv_cudaimgproc=OFF -DBUILD_opencv_dnn=OFF -DBUILD_opencv_objdetect=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_cudev=OFF -DBUILD_opencv_video=OFF -DBUILD_opencv_cudawarping=OFF -DBUILD_opencv_cudaarithm=OFF -DBUILD_opencv_features2d=OFF -DBUILD_opencv_cudaobjdetect=OFF -DBUILD_opencv_flann=OFF -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE ..
It fails on:
[ 95%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o
cd /opencv/opencv-3.4.0/build/modules/videoio && /usr/bin/ccache /opt/x-tools/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-c++ --sysroot=/opt/x-tools/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opencv/opencv-3.4.0/build -I/opencv/opencv-3.4.0/modules/videoio/include -I/opencv/opencv-3.4.0/modules/videoio/src -I/opencv/opencv-3.4.0/build/modules/videoio -I/opencv/opencv-3.4.0/modules/core/include -I/opencv/opencv-3.4.0/modules/imgproc/include -I/opencv/opencv-3.4.0/modules/imgcodecs/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations -O3 -DNDEBUG -DNDEBUG -fPIC -o CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o -c /opencv/opencv-3.4.0/modules/videoio/src/cap_dc1394_v2.cpp
/opencv/opencv-3.4.0/modules/videoio/src/cap_dc1394_v2.cpp:58:27: fatal error: dc1394/dc1394.h: No such file or directory
#include <dc1394/dc1394.h>
^
I totally have this file:
osboxes@osboxes:~/git/eyesight-core-ua/UA2.0$ ./linux-arm64 -a "-v/.ccache:/.ccache" bash
[osboxes:/work] $ find / | grep "dc1394/dc1394.h"
find: `/root': Permission denied
find: `/etc/ssl/private': Permission denied
find: `/var/cache/ldconfig': Permission denied
/usr/include/dc1394/dc1394.h
find: `/proc/tty/driver': Permission denied
You can not reuse host file for cross-compilation builds.
You should disable DC1394 support via CMake.
Build / usage questions should go to Users OpenCV Q/A forum: http://answers.opencv.org
Actually it's not a host file:
[osboxes:/work] 12s $ dpkg-query -L libdc1394-22-dev:arm64
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libdc1394-22-dev
/usr/share/doc/libdc1394-22-dev/NEWS.gz
/usr/share/doc/libdc1394-22-dev/changelog.Debian.gz
/usr/share/doc/libdc1394-22-dev/changelog.gz
/usr/share/doc/libdc1394-22-dev/copyright
/usr/share/doc/libdc1394-22-dev/README.Debian
/usr/share/doc/libdc1394-22-dev/AUTHORS
/usr/share/doc/libdc1394-22-dev/README
/usr/include
/usr/include/dc1394
/usr/include/dc1394/video.h
/usr/include/dc1394/vendor
/usr/include/dc1394/vendor/basler_sff.h
/usr/include/dc1394/vendor/basler.h
/usr/include/dc1394/vendor/pixelink.h
/usr/include/dc1394/vendor/avt.h
/usr/include/dc1394/utils.h
/usr/include/dc1394/types.h
/usr/include/dc1394/register.h
/usr/include/dc1394/log.h
/usr/include/dc1394/linux
/usr/include/dc1394/linux/control.h
/usr/include/dc1394/linux/capture.h
/usr/include/dc1394/iso.h
/usr/include/dc1394/format7.h
/usr/include/dc1394/dc1394.h
/usr/include/dc1394/conversions.h
/usr/include/dc1394/control.h
/usr/include/dc1394/capture.h
/usr/include/dc1394/camera.h
/usr/lib
/usr/lib/aarch64-linux-gnu
/usr/lib/aarch64-linux-gnu/libdc1394.a
/usr/lib/aarch64-linux-gnu/pkgconfig
/usr/lib/aarch64-linux-gnu/pkgconfig/libdc1394-2.pc
/usr/lib/pkgconfig
/usr/lib/aarch64-linux-gnu/libdc1394.so
You do raise a valid point though, shouldn't the .h be located in a different folder?
I already have a thread here. No one is answering it. I was hoping to update it once I have an answer.
Also, why would I want to disable DC1394?
EDIT:
Holy moly, I just realized I was posting on the wrong issue. This thread is about videoio.h and not DC1394. Sorry.
Do you have FireWire ports on your target ARM device?
If no, then it is better to disable this support (cmake -DWITH_DC1394=OFF ...).
This file layout doesn't look good to me. Also your cross-compiler is not configured to fetch files from /usr/include. Forcing this path for compiler via -I or -isystem parameters (via CMAKE_CXX_FLAGS) would probably break something else.
Do you think the lack of dc1394.h in a proper path is a bug in debian's package? Do you have a solution? I'll try to just copy it to a proper location and see if that works...
I've managed to compile and link OpenCV 3.4 to Linux arm64 with some hackjobs which I'll share with the community once I tackle this one last problem, which is DC1394.
My code does NOT reference DC1394 directly, it only makes calls to OpenCV. As far as I'm aware, OpenCV's Video Capture class which is used in my project requires -DWITH_DC1394=ON to work. I've compiled OpenCV to other platforms with DC1394 enabled, and it will ask for the DC1394 shared objects when I make calls for it.
I've compiled arm64 code that is linked with OpenCV, and my cv::VideoCapture will not work.
dpkg-query -L libdc1394-22-dev:arm64
IMHO, mentioned package is not for using for cross-compiling on x86 hosts.
This package is for using on machines with native aarch64 CPUs.
So I'm fudged? :disappointed:
I've finally managed to compile OpenCV with video capabilities using soft links for the header files. I don't know why it can't find them on its own, either I'm missing something integral in my toolchain, my environmental variables, something's wrong with Debian's arm64 pkg-config, or OpenCV's CMake has an arm64 specific bug.
Like I said, my solution was manually soft linking required files and folders from /usr/include to my cross compiler's sysroot's /include path (in my very specific case, /opt/x-tools/aarch64-unknown-linux-gnueabi/include/.
search "error:" in error log, I found FP16 error, -D ENABLE_NEON=OFF works for me.
I'm try cmake in pi 3,but failed .
Most helpful comment
FIXED: Now it compiles flawlessy
Tried this tutorial:
https://medium.com/@debugvn/installing-opencv-3-3-0-on-ubuntu-16-04-lts-7db376f93961
It was just an error in my CMake command line:
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules
instead of:
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules
ORIGINAL MESSAGE:
Trying to install OpenCV 3.3.0 with Python 3.4 bindings from source on Linux Mint 17.1 following this tutorial:
http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/
Same CMake problem as everybody else here:
fatal error: sys/videoio.h: File o directory non esistente (= file not found)
I also see another (possibly irrelevant) error in CMakeError.log:
error "C++11 is not supported"
I have latest libv4l-dev and libv4l-0 installed.
I installed both gcc and g++ 4.9.4
I tried every suggested CMake switches combination (-D WITH_LIBV4L=ON/OFF, -D WITH_V4L=OFF/ON, -D INSTALL_C_EXAMPLES=OFF/ON).
No way to get a makefile...
Any suggestion?