Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building OpenCV using Visual Studio 2013 OpenGL CUDA and TBB

Hello everybody and happy new year for those under gregorain calendar!

I have been trying to build OpenCV 2.4.10 on Windows 7 32bit using Visual Studio 2013 and it has been a real pain. Mostly, I think it is my lack of expertice what is making it so difficult. I have make some achivements but unfortunatelly it is not working 100%.

I would like to write a small manual not so focused on the step by step -it can be frustrating when one of those steps fails and you don't know how to reach the next one- and more focused on understanding what is happening on each step, why and what to expect when something goes wrong. I ask for your help, sure you have faced lot of them before and can explain why it is happening. I am downloading 3 to build with CMake 3.0.2 and Visual Studio 2013. I will update this thread as I take steps.

My aim is to build 2.4.10 with CUDA, TBB and OpenGL support. And make it work :)

  • Clone OpenCV 2.4.10 (I am using TortoiseGit at C:\OpenCV\src\src)
  • Download TBB Compiled (link: TBB WindowsOS)
  • Unzip TBB in C:\OpenCV\src\opt\tbb
  • Unzip OpenCV source in C:\OpenCV\src dir
  • Open CMake and target source dir C:\OpenCV\src and built dir C:\OpenCV\built
  • Configure CMake for the first time
    • Select Visual Studio 12 2013, Use default native compilers for a configuration Win32
    • Select this options:
    • Under WITH tab:
      • WITH_CUDA (already checked)
      • WITH_OPENGL
        • WITH_TBB
  • And click configure again...

Here, OPENGL libs are found (opengl32 and glu32) and first missing paths appear (TBB_INCLUDE_DIRS), those for TBB_INCLUDE_DIRS, so:

  • Point that line to C:\OpenCV\src\opt\tbb\include and click configure again.

After that configuration process, TBB tab appears in red with LIB_DIR and STDDEF_PATH labels pointed to my TBB folder.

  • Click configure again to confirm the changes.

This time, there are no tag in red, and everything seems to be fine. I check the output and GUI OpenGL support is set to Yes, and so is Use TBB (ver 4.3 interface 8002) under Other third-party libraries, so

  • Click Generate to generate the Visual Studio files

Files are generated, so

  • Open Visual Studio 2013 and open OpenCV solution at C:\OpenCV\built and wait for it to be ready

  • Select Debug and then Build Solution (Ctrl+Shift+B) and wait...

First errors happen when it tries to find the core lib, so I re-run CMake for a simple build, without OpenGL, CUDA or TBB.

So, first question is, why is this happening? Should it not build first the core libs and then go ahead with the rest of libs?

I will keep updating as answers come and as I keep on going...

Thanks a lot everybody!

D!

Building OpenCV using Visual Studio 2013 OpenGL CUDA and TBB

Hello everybody and happy new year for those under gregorain calendar!

I have been trying to build OpenCV 2.4.10 on Windows 7 32bit using Visual Studio 2013 and it has been a real pain. Mostly, I think it is my lack of expertice what is making it so difficult. I have make some achivements but unfortunatelly it is not working 100%.

I would like to write a small manual not so focused on the step by step -it can be frustrating when one of those steps fails and you don't know how to reach the next one- and more focused on understanding what is happening on each step, why and what to expect when something goes wrong. I ask for your help, sure you have faced lot of them before and can explain why it is happening. I am downloading 3 to build with CMake 3.0.2 and Visual Studio 2013. I will update this thread as I take steps.

My aim is to build 2.4.10 with CUDA, TBB and OpenGL support. And make it work :)

  • Clone OpenCV 2.4.10 (I am using TortoiseGit at C:\OpenCV\src\src)
  • Download TBB Compiled (link: TBB WindowsOS)
  • Unzip TBB in C:\OpenCV\src\opt\tbb
  • Unzip OpenCV source in C:\OpenCV\src dir
  • Open CMake and target source dir C:\OpenCV\src and built dir C:\OpenCV\built
  • Configure CMake for the first time
    • Select Visual Studio 12 2013, Use default native compilers for a configuration Win32
    • Select this options:
    • Under WITH tab:
      • WITH_CUDA (already checked)
      • WITH_OPENGL
          WITH_OPENGL
        • WITH_TBB
  • And click configure again...

Here, OPENGL libs are found (opengl32 and glu32) and first missing paths appear (TBB_INCLUDE_DIRS), those for TBB_INCLUDE_DIRS, so:

  • Point that line to C:\OpenCV\src\opt\tbb\include and click configure again.

After that configuration process, TBB tab appears in red with LIB_DIR and STDDEF_PATH labels pointed to my TBB folder.

  • Click configure again to confirm the changes.

This time, there are no tag in red, and everything seems to be fine. I check the output and GUI OpenGL support is set to Yes, and so is Use TBB (ver 4.3 interface 8002) under Other third-party libraries, so

  • Click Generate to generate the Visual Studio files

Files are generated, so

  • Open Visual Studio 2013 and open OpenCV solution at C:\OpenCV\built and wait for it to be ready

  • Select Debug and then Build Solution (Ctrl+Shift+B) and wait...

First errors happen when it tries to find the core lib, so I re-run CMake for a simple build, without OpenGL, CUDA or TBB.

So, first question is, why is this happening? Should it not build first the core libs and then go ahead with the rest of libs?

I will keep updating as answers come and as I keep on going...

Thanks a lot everybody!

D!