Error in installing caffe in Ubuntu 14.04 LTS - opencv

Having already required dependencies for caffe installation:
in cmake step, when I use:
cmake ..
I get this error:
-- Python:
-- Interpreter : /home/majid/anaconda/bin/python2.7 (ver..2.7.9)
-- Libraries : /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6)
-- NumPy : /home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include (ver 1.9.2)
which in Libraries it has detected wrong path instead of /home/majid/anaconda/lib/libpython2.7.so
I tried to force to use the correct path by:
cmake -D PYTHON_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so ..
but after:
make all -j $(nproc)
I am getting a couple of time this warning:
At end of source: warning: routine is both "inline" and "noinline"
in the end it stops by this error:
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.8: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/cpp_classification/classification] Error 1
make[1]: *** [examples/CMakeFiles/classification.dir/all] Error 2
make: *** [all] Error 2
while when installing opencv I used this cmake:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/majid/opencv -D PYTHON_EXECUTABLE=/home/majid/anaconda/bin/python2.7 -D PYTHON_INCLUDE_DIR=/home/majid/anaconda/include/python2.7 -D PYTHON_INCLUDE_DIRS=/home/majid/anaconda/include/python2.7 -D PYTHON_INCLUDE_DIR2=/home/majid/anaconda/include/python2.7 -D PYTHON_LIBRARIES=/home/majid/anaconda/lib/libpython2.7.so -D PYTHON_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so -D PYTHON_PACKAGES_PATH=/home/majid/anaconda/lib/python2.7/site-packages -D BUILD_EXAMPLES=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D PYTHON2_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so -D PYTHON_NUMPY_INCLUDE_DIRS=/home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy -D BUILD_opencv_python3=OFF -D BUILD_opencv_python2=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_TBB=ON -D WITH_V4L=ON -D BUILD-TIFF=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON -D WITH_GTK=ON -D MATLAB_INCLUDE_DIRS=/home/majid/MATLAB/extern/include -D MATLAB_LIBRARY_DIRS=/home/majid/MATLAB/bin -D MATLAB_MEX_SCRIPT=/home/majid/MATLAB/bin -D MATLAB_ROOT_DIR=/home/majid/MATLAB ..
in which it is: LIBTIFF=ON.
after making opencv I set the packages' path by:
export LD_LIBRARY_PATH=/home/majid/opencv/lib
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/majid/opencv/lib/pkgconfig
export PKG_CONFIG_PATH
and also:
sudo /bin/bash -c 'echo "/home/majid/opencv/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
I don't know why I am having this problem from x86-64-linux-gnu while I have the same libopencv-highgui.so in the /home/majid/opencv/lib
I really appreciate it if someone could help me out in this matter.
the result of forced cmake:
cmake -D PYTHON_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so ..
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- system
-- thread
-- Found gflags (include: /usr/local/include, library: /usr/local/lib/libgflags.a)
-- Found glog (include: /usr/local/include, library: /usr/local/lib/libglog.so)
-- Found PROTOBUF Compiler: /usr/local/bin/protoc
-- Found lmdb (include: /usr/local/include, library: /usr/local/lib/liblmdb.so)
-- Found LevelDB (include: /usr/local/include, library: /usr/local/lib/libleveldb.so)
-- Found Snappy (include: /usr/include, library: /usr/lib/libsnappy.so)
-- CUDA detected: 7.0
-- Found cuDNN (include: /usr/local/cuda-7.0/include, library: /usr/local/cuda-7.0/lib64/libcudnn.so)
-- Added CUDA NVCC flags for: sm_21
-- Cuda + Boost 1.55: Applying noinline work around
-- OpenCV found (/usr/share/OpenCV)
-- Found Atlas (include: /usr/include, library: /usr/lib/libatlas.so)
-- Found PythonLibs: /home/majid/anaconda/lib/libpython2.7.so (found suitable version "2.7.6", minimum required is "2.7")
-- NumPy ver. 1.9.2 found (include: /home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include)
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- python
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/
--
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : <TODO> (Caffe doesn't declare its version in headers)
-- Git : rc2-344-g7e5608f-dirty
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compared-Wno-uninitialized
-- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
--
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : ON
-- BUILD_matlab : OFF
-- BUILD_docs : ON
-- CPU_ONLY : OFF
--
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.55)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 3.0.0)
-- lmdb : Yes (ver. 0.9.14)
-- Snappy : Yes (ver. 1.1.0)
-- LevelDB : Yes (ver. 1.17)
-- OpenCV : Yes (ver. 2.4.8)
-- CUDA : Yes (ver. 7.0)
--
-- NVIDIA CUDA:
-- Target GPU(s) : Auto
-- GPU arch(s) : sm_21
-- cuDNN : Yes
--
-- Python:
-- Interpreter : /home/majid/anaconda/bin/python2.7 (ver. 2.7.9)
-- Libraries : /home/majid/anaconda/lib/libpython2.7.so (ver 2.7.6)
-- NumPy : /home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include (ver 1.9.2)
--
-- Documentaion:
-- Doxygen : /usr/bin/doxygen (1.8.6)
-- config_file : /home/majid/caffe/.Doxyfile
--
-- Install:
-- Install path : /home/majid/caffe/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/majid/caffe/build

Related

fbthrift: No generator named 'cpp2' could be found after (seemingly) successful build

I'm trying to install crnn which requires fblualib on Ubuntu 18.04 LTS. While building TH++, an error occured (Complete build print attached below):
[ 10%] Building CXX object CMakeFiles/thpp.dir/Storage.cpp.o
In file included from /home/huiji/Downloads/thpp-master/thpp/Storage.cpp:11:0:
/home/huiji/Downloads/thpp-master/thpp/../thpp/Storage.h:22:10: fatal error: thpp/if/gen-cpp2/Tensor_types.h: no such file or directory
#include **<thpp/if/gen-cpp2/Tensor_types.h>**
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If I build thpp without using fbthrift and folly by running THPP_NOFB=1 ./build.sh in the thpp directory, the build would be successful (I have thpp files in torch/install/include and torch/install/lib). However, if I move on and build fblualib, an almost identical error occurs:
[ 20%] Building CXX object CMakeFiles/fblualib.dir/LuaUtils.cpp.o
In file included from
/home/huiji/torch/install/include/thpp/Tensor.h:20:0,
from /home/huiji/Downloads/fblualib-master/fblualib/../fblualib/LuaUtils.h:19,
from /home/huiji/Downloads/fblualib- master/fblualib/LuaUtils.cpp:11:
/home/huiji/torch/install/include/thpp/Storage.h:22:10: fatal error:
thpp/if/gen-cpp2/Tensor_types.h: no such file or directory
#include <thpp/if/gen-cpp2/Tensor_types.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I figure that there may be something wrong with my fbthrift. Then I tried the following commands under directory "thpp/if/". It seems that my fbthrift can't generate a cpp2-format file, but can generate a cpp/py file, awhile my python thrift_compiler can only generate an errored cpp2-format file.
$ thrift --gen cpp2 Tensor.thrift
[WARNING:/home/huiji/Downloads/thpp-master/thpp/if/Tensor.thrift:1] No generator named 'cpp2' could be found!
[WARNING:generation:1] Unable to get a generator for "cpp2".
# Nothing was generated in /thpp/if
$ thrift --gen cpp Tensor.thrift && ls gen-cpp
[WARNING:/home/huiji/Downloads/thpp-master/thpp/if/Tensor.thrift:3] No generator named 'cpp2' could be found!
Tensor_constants.cpp Tensor_constants.h Tensor_types.cpp Tensor_types.h
$ thrift --gen py Tensor.thrift && ls -R gen-py
[WARNING:/home/huiji/Downloads/thpp-master/thpp/if/Tensor.thrift:3] No generator named 'cpp2' could be found!
gen-py:
__init__.py Tensor
gen-py/Tensor:
constants.py __init__.py ttypes.py
$ python -m thrift_compiler.main --gen cpp2 Tensor.thrift && ls gen-cpp2
Tensor_fatal_all.h Tensor_fatal.h Tensor_fatal_types.h
Tensor_fatal_constant.h Tensor_fatal_service.h Tensor_fatal_union.h
Tensor_fatal_enum.h Tensor_fatal_struct.h
# A "gen-cpp2" directory was created, but in it there was no "Tensor_types.h"!
$ python -m thrift_compiler.main --gen cpp Tensor.thrift
('Argument Error:', ArgumentError('Language cpp not defined.',))
$ python -m thrift_compiler.main --gen py Tensor.thrift
('Argument Error:', ArgumentError('Language py not defined.',))
By the way, my fbthrift install seemed successful except the python package thrift_compiler was not installed correctly. I've followed GitHubGS's suggestion. That seem to have worked (I can now import thrift_compiler in python, below is what I did) but as you can see, it is not really working.
1.modify /thrift/compiler/CMakefile.txt by inserting these lines
set(CMAKE_CXX_FLAGS "-fPIC")
set(CMAKE_C_FLAGS "-fPIC")
2.rebuild/reinstall fbthrift(must step)
3.run your command under /fbthrift/thrift/compiler/py
g++ -I /usr/include/python2.7 -I ../../.. -std=c++14 -fpic -shared -o frontend.so compiler.cc -lboost_python -lpython2.7 -L/build/lib -lcompiler_base -lcompiler_ast -lboost_system -lboost_filesystem -lssl -lcrypto
sudo cp frontend.so /usr/local/lib/python2.7/dist-packages/thrift_py-0.9.0-py2.7.egg/thrift_compiler
Any ideas/suggestions would be greatly appreciated.
=================
Complete message of thpp build:
huiji#NoBoDy:~/Downloads/thpp-master/thpp$ ./build.sh
If you don&apos;t have folly or thrift installed, try doing
THPP_NOFB=1 ./build.sh
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/bin/g++
-- Check for working CXX compiler: /usr/local/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /home/huiji/torch/install
-- Found Folly: /usr/local/include
-- Found Thrift: /usr/local/include
-- Performing Test HAS_NO_AS_NEEDED
-- Performing Test HAS_NO_AS_NEEDED - Success
-- Found Glog: /usr/include
-- Found PythonInterp: /usr/bin/python (found version "2.7.15")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/huiji/Downloads/thpp-master/thpp/build
[ 5%] Generating thpp/if/gen-cpp2/Tensor_data.h, thpp/if/gen-cpp2/Tensor_types.h, thpp/if/gen-cpp2/Tensor_types.tcc, thpp/if/gen-cpp2/Tensor_constants.h, thpp/if/gen-cpp2/Tensor_data.cpp, thpp/if/gen-cpp2/Tensor_types.cpp, thpp/if/gen-cpp2/Tensor_constants.cpp
Scanning dependencies of target thpp
[ 10%] Building CXX object CMakeFiles/thpp.dir/Storage.cpp.o
In file included from /home/huiji/Downloads/thpp-master/thpp/Storage.cpp:11:0:
/home/huiji/Downloads/thpp-master/thpp/../thpp/Storage.h:22:10: fatal error: thpp/if/gen-cpp2/Tensor_types.h: no such file or directory
#include <thpp/if/gen-cpp2/Tensor_types.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/thpp.dir/build.make:84: recipe for target &apos;CMakeFiles/thpp.dir/Storage.cpp.o&apos; failed
make[2]: *** [CMakeFiles/thpp.dir/Storage.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target &apos;CMakeFiles/thpp.dir/all&apos; failed
make[1]: *** [CMakeFiles/thpp.dir/all] Error 2
Makefile:140: recipe for target &apos;all&apos; failed
make: *** [all] Error 2
Complete message of fblualib build:
huiji#NoBoDy:~/Downloads/fblualib-master/fblualib$ ./build.sh
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/bin/g++
-- Check for working CXX compiler: /usr/local/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Folly: /usr/local/include
-- Found Glog: /usr/include
-- Found Torch7 in /home/huiji/torch/install
-- Found Folly: /home/huiji/torch/install/include
-- Configuring done
WARNING: Target "fblualib" requests linking to directory "/home/huiji/torch/install/lib". Targets may link only to libraries. CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/huiji/Downloads/fblualib-master/fblualib/build
Scanning dependencies of target fblualib
[ 20%] Building CXX object CMakeFiles/fblualib.dir/LuaUtils.cpp.o
In file included from /home/huiji/torch/install/include/thpp/Tensor.h:20:0,
from /home/huiji/Downloads/fblualib-master/fblualib/../fblualib/LuaUtils.h:19,
from /home/huiji/Downloads/fblualib-master/fblualib/LuaUtils.cpp:11:
/home/huiji/torch/install/include/thpp/Storage.h:22:10: fatal error: thpp/if/gen-cpp2/Tensor_types.h: no such file or directory
#include <thpp/if/gen-cpp2/Tensor_types.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/fblualib.dir/build.make:62: recipe for target &apos;CMakeFiles/fblualib.dir/LuaUtils.cpp.o&apos; failed
make[2]: *** [CMakeFiles/fblualib.dir/LuaUtils.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target &apos;CMakeFiles/fblualib.dir/all&apos; failed
make[1]: *** [CMakeFiles/fblualib.dir/all] Error 2
Makefile:129: recipe for target &apos;all&apos; failed
make: *** [all] Error 2
Use thrift1 and mstch_cpp2 instead. It works for me!
See https://github.com/facebook/fbthrift/issues/271 and $THRIFT_INCLUDE is /usr/local/include/thrift/ in my system.
As one of the above answer mentioned, after building fbthrift successfully, you get bin/thrift1 binary in your build folder. You can then use the output thrift1 with generator mstch_cpp2.
./build/bin/thrift1 --gen mstch_cpp2 --templates ./thrift/compiler/generate/templates --out /tmp/ ./thrift/example/if/chatroom.thrift
Ref https://github.com/facebook/fbthrift/issues/303

caffe install on ubuntu fail on libtiff not found

I was follow the official install guide CMake Build part met the following error.
/usr/bin/ld: warning: libtiff.so.5, needed by /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9, not found (try using -rpath or -rpath-link)
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFIsTiled#LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFWriteScanline#LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libsoxr.so.0: undefined reference to `GOMP_parallel#GOMP_4.0'
tried ldd told in this post
ldd libopencv.so
ldd: ./libopencv.so: No such file or directory
libtiff-dev and libopencv-dev is installed
sudo apt-get install libtiff-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libtiff5-dev' instead of 'libtiff-dev'
libtiff5-dev is already the newest version (4.0.6-1ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 134 not upgraded.
sudo apt-get install libopencv-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libopencv-dev is already the newest version (2.4.9.1+dfsg-1.5ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 134 not upgraded.
-- OpenCV found (/usr/share/OpenCV)
-- Found Atlas (include: /usr/include library: /usr/lib/libatlas.so lapack: /usr /lib/liblapack.so
-- NumPy ver. 1.12.1 found (include: /root/anaconda2/lib/python2.7/site-packages /numpy/core/include)
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- python
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
--
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : 1.0.0
-- Git : 1.0-14-g4efdf7e
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno- unini tialized
-- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
--
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : ON
-- BUILD_matlab : OFF
-- BUILD_docs : ON
-- CPU_ONLY : OFF
-- USE_OPENCV : ON
-- USE_LEVELDB : ON
-- USE_LMDB : ON
-- USE_NCCL : OFF
-- ALLOW_LMDB_NOLOCK : OFF
--
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.58)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 2.6.1)
-- lmdb : Yes (ver. 0.9.17)
-- LevelDB : Yes (ver. 1.18)
-- Snappy : Yes (ver. 1.1.3)
-- OpenCV : Yes (ver. 2.4.9.1)
-- CUDA : Yes (ver. 8.0)
cmake config info show opencv in /usr/share/ do I need to remove them?
I tried to make from opencv source code,but remove the source code later.
It's also said CPU-ONLY OFF but I want to use CPU-ONLY and I uncomment CPU_ONLY :=1 in Makefile.config Is that right?
tried make clean and make all in source path met follow error
warning: libtiff.so.5, needed by /usr/lib/gcc/x86_64-linux-gnu/5/.. /../../x86_64-linux-gnu/libopencv_highgui.so, not found (try using -rpath or -rp ath-link)
.build_release/tools/upgrade_solver_proto_text.o: In function `main':
upgrade_solver_proto_text.cpp:(.text.startup+0x214): undefined reference to `std ::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M _create(unsigned long&, unsigned long)'
.build_release/tools/upgrade_solver_proto_text.o: In function `boost::system::sy stem_error::what() const':
find an answertalk about fix libtiff problem.
locate libtiff.so
/root/anaconda2/pkgs/libtiff-4.0.6-3/lib/libtiff.so
/root/anaconda2/pkgs/libtiff-4.0.6-3/lib/libtiff.so.5
/root/anaconda2/pkgs/libtiff-4.0.6-3/lib/libtiff.so.5.2.4
/usr/lib/x86_64-linux-gnu/libtiff.so
ldd libopencv_highgui.so.2.4.9 | grep libtiff
libtiff.so.5 => not found
I have tried to install opencv from source code,so maybe the x86_ path is from the source code lib?How do I fix it?just remove them?

OpenCV 3.0 Trouble with Installation

I need OpenCV3.0 since it supports some new functions which I need.
I used the following code for installation (I had successfully installed OpenCV 2.4.9 using this code. But for OpenCV 3.0, while doing the cmake section, some error pops up due to mismatch of MD5 checksum)
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
echo "Installing OpenCV" $version
unzip OpenCV-3.0.zip #i manually installed opencv3.0 zipfile for linux from https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip
cd opencv-3.0.0-alpha
mkdir build
cd build
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 ..
make -j2
sudo checkinstall
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
echo "OpenCV 3.0 ready to be used"
When I execute the cmake command, I encounter errors. The output is shown below:
clive#clive-Aspire-4755:~/OpenCV/opencv-3.0.0-alpha/build$ cmake -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 ..
-- The CXX compiler identification is GNU
-- The C compiler identification is GNU
-- 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
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detected version of GNU GCC: 46 (406)
-- 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 - Failed
-- Performing Test HAVE_C_WNO_NARROWING
-- Performing Test HAVE_C_WNO_NARROWING - Failed
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_CXX_WNO_LONG_LONG
-- Performing Test HAVE_CXX_WNO_LONG_LONG - Success
-- Performing Test HAVE_C_WNO_LONG_LONG
-- Performing Test HAVE_C_WNO_LONG_LONG - Success
-- Performing Test HAVE_CXX_PTHREAD
-- Performing Test HAVE_CXX_PTHREAD - Success
-- Performing Test HAVE_C_PTHREAD
-- Performing Test HAVE_C_PTHREAD - Success
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_CXX_MSSE
-- Performing Test HAVE_CXX_MSSE - Success
-- Performing Test HAVE_C_MSSE
-- Performing Test HAVE_C_MSSE - Success
-- Performing Test HAVE_CXX_MSSE2
-- Performing Test HAVE_CXX_MSSE2 - Success
-- Performing Test HAVE_C_MSSE2
-- Performing Test HAVE_C_MSSE2 - Success
-- Performing Test HAVE_CXX_MSSE3
-- Performing Test HAVE_CXX_MSSE3 - Success
-- Performing Test HAVE_C_MSSE3
-- Performing Test HAVE_C_MSSE3 - Success
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_C_FFUNCTION_SECTIONS
-- Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Failed
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.3.4", required is "1.2.3")
-- Found TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success
-- Performing Test HAVE_C_WNO_SHADOW
-- Performing Test HAVE_C_WNO_SHADOW - Success
-- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED
-- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Failed
-- Found Jasper: /usr/lib/x86_64-linux-gnu/libjasper.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.3.4")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so
-- Looking for /usr/include/libpng/png.h
-- Looking for /usr/include/libpng/png.h - found
-- Found OpenEXR: /usr/lib/libIlmImf.so
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
Could not find module FindQt5Core.cmake or a configuration file for package
Qt5Core.
Adjust CMAKE_MODULE_PATH to find FindQt5Core.cmake or set Qt5Core_DIR to
the directory containing a CMake configuration file for Qt5Core. The file
will have one of the following names:
Qt5CoreConfig.cmake
qt5core-config.cmake
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
Could not find module FindQt5Gui.cmake or a configuration file for package
Qt5Gui.
Adjust CMAKE_MODULE_PATH to find FindQt5Gui.cmake or set Qt5Gui_DIR to the
directory containing a CMake configuration file for Qt5Gui. The file will
have one of the following names:
Qt5GuiConfig.cmake
qt5gui-config.cmake
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
Could not find module FindQt5Widgets.cmake or a configuration file for
package Qt5Widgets.
Adjust CMAKE_MODULE_PATH to find FindQt5Widgets.cmake or set Qt5Widgets_DIR
to the directory containing a CMake configuration file for Qt5Widgets. The
file will have one of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):
Could not find module FindQt5Test.cmake or a configuration file for package
Qt5Test.
Adjust CMAKE_MODULE_PATH to find FindQt5Test.cmake or set Qt5Test_DIR to
the directory containing a CMake configuration file for Qt5Test. The file
will have one of the following names:
Qt5TestConfig.cmake
qt5test-config.cmake
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package):
Could not find module FindQt5Concurrent.cmake or a configuration file for
package Qt5Concurrent.
Adjust CMAKE_MODULE_PATH to find FindQt5Concurrent.cmake or set
Qt5Concurrent_DIR to the directory containing a CMake configuration file
for Qt5Concurrent. The file will have one of the following names:
Qt5ConcurrentConfig.cmake
qt5concurrent-config.cmake
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake (found version "4.8.1")
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.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
-- checking for module 'gstreamer-base-0.10'
-- found gstreamer-base-0.10, version 0.10.36
-- checking for module 'gstreamer-video-0.10'
-- found gstreamer-video-0.10, version 0.10.36
-- checking for module 'gstreamer-app-0.10'
-- found gstreamer-app-0.10, version 0.10.36
-- checking for module 'gstreamer-riff-0.10'
-- found gstreamer-riff-0.10, version 0.10.36
-- checking for module 'gstreamer-pbutils-0.10'
-- found gstreamer-pbutils-0.10, version 0.10.36
-- checking for module 'libdc1394-2'
-- found libdc1394-2, version 2.2.0
-- checking for module 'libv4l1'
-- found libv4l1, version 0.8.6
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not 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 'libavcodec'
-- found libavcodec, version 53.35.0
-- checking for module 'libavformat'
-- found libavformat, version 53.21.1
-- checking for module 'libavutil'
-- found libavutil, version 51.22.2
-- checking for module 'libswscale'
-- found libswscale, version 2.1.0
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'tbb'
-- found tbb, version 3.0+r018
CMake Warning at 3rdparty/ippicv/downloader.cmake:54 (message):
ICV: Local copy of ICV package has invalid MD5 hash:
9a7fea9124cb057264446ab1c7f5841d (expected:
d80cb24f3a565113a9d6dc56344142f6)
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:212 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:449 (include)
-- ICV: Downloading ippicv_linux_20140513.tgz...
CMake Error at 3rdparty/ippicv/downloader.cmake:71 (file):
file DOWNLOAD MD5 mismatch
for file: [/home/clive/OpenCV/opencv-3.0.0-alpha/3rdparty/ippicv/downloads/linux-d80cb24f3a565113a9d6dc56344142f6/ippicv_linux_20140513.tgz]
expected MD5 sum: [d80cb24f3a565113a9d6dc56344142f6]
actual MD5 sum: [ad7124f0fc04a24f6c725d2dbbc436db]
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:212 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:449 (include)
CMake Error at 3rdparty/ippicv/downloader.cmake:75 (message):
ICV: Failed to download ICV package: ippicv_linux_20140513.tgz.
Status=28;"Timeout was reached"
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:212 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:449 (include)
-- Configuring incomplete, errors occurred!
Why are the checksums different? Is it because OpenCV3.0 needs another version of ippicv? I understand that the error comes while downloading ippicv_linux_20140513.tgz (in the 3rd party, ippicv folder).
Can someone help me out here? Any help would be appreciated!
PS. I want to use OpenCV3.0 with Python. OpenCV2.4.9 was working well until I tried to remove it. I actually deleted every file with the name "opencv" from my system. I didn't know how to uninstall it the proper way.
Just follow the following procedure for Ubuntu 14.04
STEP 1 :-
To install the dependencies required for OpenCV, just run the following command:
sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip
STEP 2 :-
Download the latest version of OpenCV
wget https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip
unzip opencv-3.0.0-alpha.zip
STEP 3:-
Install Open CV
cd opencv-3.0.0-alpha
mkdir build
cd build
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 WITH_QT=ON -D WITH_OPENGL=ON ..
Note : If you get the hash mismatch error, then download the file ippicv_linux_20140513.tgz manually from sourceforge
After downloading the file extract the contents to the ippicv folder in the opencv-3.0.0-alpha folder.
Now add the option -D WITH_IPP=OFF to the before cmake command.
Then execute the following commands :
make -j $(nproc)
sudo make install
STEP 4:-
Finishing installation
Now some final touches :
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
After the complete process execute
sudo apt-get update
and then reboot your system.
Now you have a working installation of OpenCV.
Source : http://rodrigoberriel.com/
Simply download the problematic file yourself from here:
http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv/
Then place that file in the folder where it would have been downloaded to:
<your opencv build>/3rdparty/ippicv/downloads/<your os and version>
notice that the "your os and version" folder name indicates the file you need to download from sourceforge.
To install OpenCV 3.2.0 on Ubuntu 16.04:
Required Packages:
$ sudo apt-get install build-essential
$ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
Download OpenCV:
$ sudo apt-get install wget
$ wget -O opencv-3.2.0.tar.gz https://github.com/opencv/opencv/archive/3.2.0.tar.gz
$ wget -O ippicv_linux_20151201.tgz https://raw.githubusercontent.com/opencv/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippicv_linux_20151201.tgz
Install OpenCV:
$ sudo apt-get install tar
$ tar xf opencv-3.2.0.tar.gz
$ mkdir -p opencv-3.2.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e
$ cp ippicv_linux_20151201.tgz opencv-3.2.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e/ippicv_linux_20151201.tgz
$ cd opencv-3.2.0
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make -j7
$ sudo make install
References:
http://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
http://www.linuxfromscratch.org/blfs/view/cvs/general/opencv.html
Follow the steps...
First Remove openjdk
sudo apt-get autoremove openjdk-*-jre
and install new jdk with following commands
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Now installing the OpenCV
1. install basic development environment
sudo apt-get install build-essential cmake pkg-config
2.install opencv dependencies. ubuntu 13.04 ships with opencv, which is close enough to pull in most of the needed dependencies.
sudo apt-get build-dep libopencv-dev
3.additional dependencies for java support
sudo apt-get install default-jdk ant
4. compile opencv
tar xzvf opencv-2.4.6.1.tar.gz
cd opencv-2.4.6.1
mkdir build; cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON ..make
sudo make install
There you go....
This worked for me with OpenCV 3.1 on Ubuntu 14.04.
I guess there is a dependency problem with ippicv. You need to turn WITH_IPP and INSTALL_CREATE_DISTRIB on. Rebuild it and update the links.
cmake -DWITH_IPP=ON -DINSTALL_CREATE_DISTRIB=ON . && make -j $(nproc) && make install
try again with :
cmake \
-DOPENCV_ICV_URL="http://downloads.sourceforge.net/project/opencvlibrary/3rdparty/ippicv"
From :
Opencv installation error ubuntu 14.04

OpenCV configure with TBB for ARM (Ubuntu, 3.0.63)

I'm trying to compile OpenCV libs with TBB support for odroid U2 (with Quad core ARM Cortex-A9 MPCore). I have no problem with compile current OpenCV (from github) without TBB. And also I have no problem with compiling TBB libs fron sources - tbb41_20130116oss_src.tgz and I have successfully builded TBB libs:
root#odroid:~/src/tbb41_20130116oss/build/linux_armv7l_gcc_cc4.6_libc2.15_kernel3.0.63_release# ls
arena.d concurrent_queue.o frontend.d libtbbmalloc.so.2 proxy.d scheduler.o task_v2.d tbb_thread.d
arena.o concurrent_queue_v2.d frontend.o libtbbmalloc_proxy.so proxy.o semaphore.d task_v2.o tbb_thread.o
backend.d concurrent_queue_v2.o governor.d libtbbmalloc_proxy.so.2 queuing_mutex.d semaphore.o tbb.def tbbmalloc.d
backend.o concurrent_vector.d governor.o market.d queuing_mutex.o spin_mutex.d tbb_function_replacement.d tbbmalloc.def
backref.d concurrent_vector.o itt_notify.d market.o queuing_rw_mutex.d spin_mutex.o tbb_function_replacement.o tbbmalloc.o
backref.o concurrent_vector_v2.d itt_notify.o mutex.d queuing_rw_mutex.o spin_rw_mutex.d tbb_main.d tbbmallocproxy.def
cache_aligned_allocator.d concurrent_vector_v2.o itt_notify_malloc.d mutex.o reader_writer_lock.d spin_rw_mutex.o tbb_main.o tbbvars.csh
cache_aligned_allocator.o condition_variable.d itt_notify_malloc.o observer_proxy.d reader_writer_lock.o spin_rw_mutex_v2.d tbb_misc.d tbbvars.sh
concurrent_hash_map.d condition_variable.o large_objects.d observer_proxy.o recursive_mutex.d spin_rw_mutex_v2.o tbb_misc.o version_string.ver
concurrent_hash_map.o critical_section.d large_objects.o pipeline.d recursive_mutex.o task.d tbb_misc_ex.d
concurrent_monitor.d critical_section.o libtbb.so pipeline.o rml_tbb.d task.o tbb_misc_ex.o
concurrent_monitor.o dynamic_link.d libtbb.so.2 private_server.d rml_tbb.o task_group_context.d tbb_statistics.d
concurrent_queue.d dynamic_link.o libtbbmalloc.so private_server.o scheduler.d task_group_context.o tbb_statistics.o
root#odroid:~/src/tbb41_20130116oss/build/linux_armv7l_gcc_cc4.6_libc2.15_kernel3.0.63_release#
I can compile my own programm with g++ using this TBB libs, but I can't configure OpenCV to see this TBB libs:
root#odroid:~/src/work/opencv/release# cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
-- Detected version of GNU GCC: 46 (406)
-- Found OpenEXR: /usr/lib/libIlmImf.so
-- checking for module 'gstreamer-app-0.10'
-- package 'gstreamer-app-0.10' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'tbb'
-- package 'tbb' not found
[...]
could you explain how I can do this? Thank you!
Try building opencv with the included TBB build (BUILD_TBB=true), works for me on odroid-x2:
cmake -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local/opencv-2.4-ec15d6f383e0aae -DBUILD_TBB:BOOL="1" -DWITH_TBB:BOOL="1" ..
make -j 4
If you do a make install, be sure to copy ./lib/libtbb.so to somewhere where it can be found, otherwise opencv just leaves it there.

Compiling OpenCV Source Code for 64 bit (Mac)

I'm having some problems while trying to compile 64 bit OpenCV libraries. This is what I've done so far:
Got the source code using svn
In the opencv I have mkdir build then cd build
cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=x86_64 -D CMAKE_C_FLAGS=-m64 -D CMAKE_CXX_FLAGS=-m64 ..
This then leaves me with the output (below), which worries me because a number of packages are not found. I have tried disabling the WITH_CUDA flag as suggest in this post Building EmguCV on OSX Snow Leopard but it doesn't seem to help.
-- Extracting svn version, please wait...
-- SVNVERSION: svn:9029
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- checking for module 'libavcodec'
-- package 'libavcodec' not found
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named sphinx
--
-- General configuration for OpenCV 2.4.9 =====================================
-- Version control: svn:9029
--
-- Platform:
-- Host: Darwin 11.4.0 i386
-- CMake: 2.8.8
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++
-- C++ flags (Release): -m64 -O3 -DNDEBUG
-- C++ flags (Debug): -m64 -g
-- C Compiler: /usr/bin/gcc
-- C flags (Release): -m64 -O3 -DNDEBUG
-- C flags (Debug): -m64 -g
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: NO
--
-- OpenCV modules:
-- To be built: core imgproc flann highgui features2d calib3d ml video objdetect contrib nonfree legacy gpu photo python stitching ts videostab
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: androidcamera java
--
-- GUI:
-- QT 4.x: NO
-- Cocoa: YES
-- OpenGL support: NO
--
-- Media I/O:
-- ZLib: build (ver 1.2.6)
-- JPEG: build (ver 62)
-- PNG: build (ver 1.5.9)
-- TIFF: build (ver 42 - 4.0.1)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: NO
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: NO
-- FFMPEG: NO
-- codec: NO
-- format: NO
-- util: NO
-- swscale: NO
-- gentoo-style: NO
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- QuickTime: NO
-- QTKit: YES
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use TBB: NO
-- Use Cuda: NO
-- Use Eigen: NO
-- Use Clp: NO
--
-- Python:
-- Interpreter: /usr/bin/python (ver 2.7.1)
-- Libraries: /usr/lib/libpython2.7.dylib (ver 2.7.1)
-- numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.5.1)
-- packages path: lib/python2.7/site-packages
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: /usr/texbin/pdflatex
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- Examples: NO
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build
If I then try make -j8 I get something that starts off like this and goes on fo a while:
[ 0%] [ 0%] [ 0%] [ 1%] [ 1%] [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/compress.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/crc32.c.o
Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngerror.c.o
Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/png.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/deflate.c.o
[ 1%] [ 1%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_cm.c.o
Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcapimin.c.o
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngerror.c:19:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:45:20: error: stdlib.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:127,
from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngerror.c:19:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:442:26: error: setjmp.h: No such file or directory
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:450:24: error: time.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.c:14:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:45:20: error: stdlib.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:127,
from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.c:14:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:442:26: error: setjmp.h: No such file or directory
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:450:24: error: time.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/zlib/zlib.h:34,
from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/zlib/compress.c:9:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build/3rdparty/zlib/zconf.h:403:48: error: sys/types.h: No such file or directory
INSTRUCTIONS
Download the zip from https://github.com/Itseez/opencv
When you unzip it you should be left with a folder called 'opencv-master', cd into it.
mkdir build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
make
sudo make install

Resources