I used the OpenCV-2.4.10.
Unpack it and go to the directory. Then, create a working directory for build.
Next, prepare all necesarry libraries by apt-get.
Please find the reference 1. Before apt-get install, you may remove "libopencv*" from your system (to avoid unnecesarry conflictions).
Now we are ready to try building the OpenCV.
We start from making the Makefiles by cmake. In cmake, you need to be careful on the option arguments because we rely on Anaconda package.
Finally the command below yielded the successful installatoin:
cmake -D BUILD_EXAMPLES=ON -D CMAKE_BUILD_TYPE=RELEASE \
-D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_1394=OFF \
-D WITH_IPP=ON -D WITH_TBB=ON -D WITH_V4L=OFF \
-D PYTHON_LIBRARY=(anaconda dir path)/lib/libpython2.7.so \
-D PYTHON_INCLUDE=(anaconda dir path)/include/python2.7 \
-D PYTHON_PACKAGES_PATH=(anaconda dir path)/lib/python2.7/site-packages \
-D BUILD_TIFF=ON \
-D CMAKE_C_COMPILER=/usr/bin/gcc \
-D CMAKE_CXX_COMPILER=/usr/bin/g++ ../
make and make install
If you are good, then make. This will take a while. After that, make install with sudo.
sudo make install
If there are some errors during make, you need to fix it one by one. Typically I encountered with missing lib****, which we can solve instantly by apt-get.
If no errors, congratulation! You passed the first test. :-)
Second, you would write a simple code that uses cv2 functions. Some of OpenCV functions may not be builded appropriately even if the installation finished without apparent errors && the cv2 module is loadable.
In my system I frequently encountered with problems on video (movie) processing functions :-(
Be sure to keep the original libm.so.6 (that of anadonca) as a different file!
No errors? Have fun with OpenCV!! ;-)