Building OpenCV3.0.0 from source

asked 2015-03-11 09:54:52 -0500

updated 2015-03-11 23:41:32 -0500

I am trying to get the non-free module of OpenCV3.0.0 working on Python 2.7. In doing the Cmake configure process (with the GUI), I get the following dialog that leads to a hard fail if I include the module in Cmake and compile it in Visual Studio.

Module opencv_datasets disabled because opencv_face dependency can't be resolved!
Assume that non-module dependency is available: WRAP (for module opencv_optflow)
Assume that non-module dependency is available: python (for module opencv_optflow)
Assume that non-module dependency is available: WRAP (for module opencv_optflow)
Assume that non-module dependency is available: python (for module opencv_optflow)

There are several modules that throw the same dialog (not just optflow).  I have been able to get around the errors by turning them off in cmake, but am interested in getting the optflow module working.

The whole cmake output is below (I don't know how to format it nicely):

Checking for Windows Platform SDK
Checking for Visual Studio 2012
Could NOT find Jasper (missing:  JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
found IPP (ICV version): 8.2.1 [8.2.1]
at: C:/opencv/sources/3rdparty/ippicv/unpack/ippicv_win
Could NOT find PythonInterp: Found unsuitable version "2.7.8", but required is at least "3.4" (found C:/Anaconda/python.exe)
Could NOT find PythonInterp: Found unsuitable version "2.7.8", but required is at least "3.2" (found C:/Anaconda/python.exe)
Found Sphinx 1.2.3: C:/Anaconda/Scripts/sphinx-build.exe
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
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.2.0 (usefile: C:/VTK-6.2.0/CMake/UseVTK.cmake)
Tesseract:   NO
Module opencv_datasets disabled because opencv_face dependency can't be resolved!
Assume that non-module dependency is available: WRAP (for module opencv_optflow)
Assume that non-module dependency is available: python (for module opencv_optflow)
Assume that non-module dependency is available: WRAP (for module opencv_optflow)
Assume that non-module dependency is available: python (for module opencv_optflow)

General configuration for OpenCV 3.0.0-beta =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       2.8.11.2
    CMake generator:             Visual Studio 12
    CMake build tool:            C:/PROGRA~2/MSBuild/12.0/Bin/MSBuild.exe
    MSVC:                        1800

  C/C++:
    Built as dynamic libs?:      NO
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe  (ver 18.0.31101.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /MT /O2 /Ob2 /D NDEBUG 
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /MT /O2 /Ob2 /D NDEBUG 
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE ...
(more)
edit retag flag offensive close merge delete

Comments

your output does not look like a 'hard fail' .

it will build wrappers for python2.7

berak gravatar imageberak ( 2015-03-11 10:22:50 -0500 )edit
4

It only causes a hard fail if I include the module in my Cmake Config. Thank you Barak, for all the time and effort you put into answering everyone's questions.

dan_goodrick gravatar imagedan_goodrick ( 2015-03-11 23:42:23 -0500 )edit
1

@dan_goodrick, thats the clue of being moderator ^_^

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-12 04:51:42 -0500 )edit

hi.. sorry to "hijack" your thread. My question is related to the dependency problem. In the case that I want to include such module, how to satisfy the dependency? In particular, how to obtain WRAP library? (I could not find any description about the WRAP library) In LINUX, I got error like this:

/usr/bin/ld: cannot find -lWRAP

chendra gravatar imagechendra ( 2015-04-03 02:01:39 -0500 )edit

Are you trying to built statically?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-03 02:16:40 -0500 )edit

@StevenPuttemans, I am not sure, but I did not set any option for BUILD_SHARED_LIBS. I used the following configuration command:

$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DMATLAB_ROOT_DIR=/usr/local/MATLAB/R2014b -DPYTHON_LIBRARY=/usr/local/lib/libpython2.7.so -DOPENCV_EXTRA_MODULES_PATH=/home/mycentos/toolbox/opencv_contrib-master/modules ../

Then when executing make, I got the error message "cannot find -lWRAP".

chendra gravatar imagechendra ( 2015-04-03 02:35:49 -0500 )edit

I have the same problem. Has anyone solved this issue?

efernandezmoral gravatar imageefernandezmoral ( 2015-05-05 07:00:29 -0500 )edit