2.4.x
CUDA_nppi_LIBRARY CUDA 7.5 -> 8.0 (was removed)
-D WITH_CUDA=OFF ..
c++ 6 fatal error: stdlib.h: No such file or directory
export CC=path_of_gcc/gcc-version
export CXX=path_of_g++/g++-version
cmake path_of_project_contain_CMakeList.txt
make
OR
#Current version is 6, but we need to compile using another version (installed for sure)
$CC="gcc-4.9" CXX="g++-4.9" cmake /CMakeLists.txt
OR$cmake -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=/usr/bin/g++ CMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DBUILD_FAT_JAVA_LIB=ON -DINSTALL_TO_MANGLED_PATHS=ON -DINSTALL_CREATE_DISTRIB=ON -DINSTALL_TESTS=ON -DENABLE_FAST_MATH=ON -DWITH_IMAGEIO=ON -DBUILD_SHARED_LIBS=OFF -DWITH_GSTREAMER=ON -DWITH_OPENMP=OFF -DWITH_CUDA=OFF -DBUILD_opencv_gpu=OFF ..
3.4.x
Unknown CMake command "ocv_append_source_files_cxx_compiler_options".
This happened when the opencv_contrib version is no compatible with your current version.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ ..
$make
$sudo make install
$sudo ldconfig
After installation, if doesn't compile, check the files opencv.conf and opencv.pc:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#/etc/ld.so.conf.d/opencv.conf
/usr/local/lib
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#/usr/local/lib/pkgconfig/opencv.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 2.4.13.6
Libs: -L${exec_prefix}/lib -lopencv_contrib -lopencv_legacy -lopencv_stitching -lopencv_nonfree -lopencv_superres -lopencv_ocl -lopencv_objdetect -lopencv_ml -lopencv_ts -lopencv_videostab -lopencv_video -lopencv_photo -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_imgproc -lopencv_flann -lopencv_core -L/usr/lib/x86_64-linux-gnu -lIlmThread -lHalf -lIex -lIlmImf -lImath -ljasper -ltiff -lpng -ljpeg -lavutil -lswscale -lswresample -lavcodec -lz -llzma -lxcb-shape -lxcb-render -lxcb-xfixes -lxcb-shm -lxcb -lavformat -lv4l2 -lv4l1 -ldc1394 -lGL -lGLU -latomic -ltbb -lrt -lpthread -lm -ldl -lstdc++
Cflags: -I${includedir_old} -I${includedir_new}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resources:
[1] opencv github (choice right branch)
https://github.com/opencv/opencv
[1] opencv_contrib is just from 3.0 ..
https://github.com/opencv/opencv_contrib/releases
[2] Steps for install ()
http://karytech.blogspot.com/2012/05/opencv-24-on-ubuntu-1204.html
[3] Script for install under ubuntu16
https://gist.github.com/fortunto2/20a9696c7fc23ef18f8cfc50e371fe5f
[4] Some variables
http://daveaubin.com/index.php/how-to-build-and-install-opencv-2-4-9-on-raspberry-pi/