Ask Your Question
3

Cmake + openCV2.4.5 (GIT repository - 2.4 branch) + Windows 7 x64 building steps and problems solved (zip with dll's available)

asked 2013-05-16 08:07:37 -0500

updated 2013-05-31 08:51:22 -0500

So basically I am following the guide to compile openCV myself.

I have installed all necessary libraries like TBB and CUDA in order to compile openCV with support for these, since this is exactly why I am going through the tutorial.

Next I have fired up CMAKE added the source code folder and the binaries destination folder, then hitted the configure button. This is when the problems come alive:

  1. Like this topic, my C & CXX compiler cannot be defined.
  2. It doesn't seem to find the correct cmake settings to start the configuration progress.

It seems to me that my CMAKE doesn't succeed in retrieving all correct parameters from the CMakeLists.txt file and that my compilers aren't that easy to find. A reason for this could be that I am not using the standard locations to store my Visual Studio installation.

Tried applying it both on the latest stable version 2.4.5 as on the github trunk. No success with either of them.


WILL POST AS SOLUTION OF COMBINED UPDATES!

edit retag flag offensive close merge delete

Comments

As a remark to continuing the CMAKE-gui process, keep filling in the red regions, then hitting configure again, untill all required data is filled in.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-16 09:10:01 -0500 )edit

Made a first successful build of the master branch will adapt the solution. Hope it works for others also.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-30 09:13:40 -0500 )edit

2 answers

Sort by » oldest newest most voted
3

answered 2013-05-30 09:27:21 -0500

updated 2013-05-31 08:55:04 -0500

STEP 1 : MAKE SURE YOUR CMAKE KNOWS YOUR COMPILER LOCATION

DO NOT FORGET TO STARTUP CMAKE WITH ADMIN SUPPORT/RIGHTS, ELSE THE TOOL CANNOT RETRIEVE ALL NEEDED DETAILS

Configure your folders for source and output first and do not to forget to select both the grouping and advanced option. Testing learned me that it is better to use the source code master from the GIT repository, by retrieving it with GIT like in this guide. It has all latest fixes compared to the prebuilt installation packs.

There are two options - Use the master branch, however this is for development, so code could be unstable. - Use the 2.4 stable branch, which you can specify in your TortoiseGIT configuration window.

image description

When hitting configure for the first time, select Visual Studio 10 WIN64, but manually select your compilers, NOT automatically. Then go to your Visual Studio installation folder and look for VC/bin/cl.exe. Add this for both C and C++ compiler. It takes me further down the CMAKE process now, giving me the ability to configure all add-on libraries.

Hit configure and fill in the desired target system and compilers! Be sure to manually set the compilers for compilation.

image description

image description

STEP 2 : SET ALL CONFIGURATIONS

My tip is to build only what you actually need. If you do not need documentation, then do not select the with option. Attached here is the configuration I used, resulting in a succesful manually build.

Hitting the above configurations helps to get to a configuration that can be adapted, like seen here. Go over each option and fill in all the options that you require:

image description

Be prepared to get returned multiple red lines after a new configuration hit. It will keep asking for more parameters if you for example select the TBB optionality.

When all red lines are removed, hit the generate button which will creare the solution, which is building on my system now. Will report back if it was successful.

My configuration : CLICK HERE

STEP 3 : GENERATE CODE AND MOVE TO VISUAL STUDIO

Let CMAKE generate a solution file, open it in Visual Studio and start building. First for debug, then for release, if both are needed.

Some tips while building:

  • If it says it needs to reload files, accept. VS2010 returns and error that the building needs to be stopped. However just click away the error, building still continues fluently.
  • Keep in mind that adding CUDA and TBB support will increase building time a lot.
  • Be patient and it will work out fine.

Finally your destination folder will have a lib and bin folder containing all files needed for programming.

GOOD LUCK! Feel free to ask questions.


FOR PEOPLE INTERESTED IN THE DLL AND LIB FILES FOR DEBUG AND RELEASE, THEY CAN BE DOWNLOADED FROM HERE:

http://www.filedropper.com/opencv245tbb4cuda5

However, they will only work with the following setup

  • Visual Studio 2010
  • Windows 7 Professional x64 bit
  • OpenCV 2.4.5
  • TBB 4.1
  • CUDA 5.0

A lot of extra ... (more)

edit flag offensive delete link more

Comments

1

Thanks for that! I just successfully compiled OpenCV 2.4.9 master branch with VS2012 :)

Ben gravatar imageBen ( 2013-05-30 10:32:50 -0500 )edit
1

That is great actually! For me 1 problem left, gpu functionality did not build correctly. Lets find out why.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-31 02:14:04 -0500 )edit

Thanks for the guide! I have some problem to built the library (tomorrow I will try to follow your advices). However I have exactly the same your setup. Could you post a new link to download your DDL and LIB files? I cannot download from filedropper. It should be very useful! Thanks!

jokla gravatar imagejokla ( 2013-07-01 17:51:09 -0500 )edit
1

Basically this is not really an advice. Copying dll's and lib's is basically requesting troubles, since each system is different. I have done the build yesterday again, without problems, in visual studio, keep refreshing projects when asked, click away errors and rebuild until all succeed.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-02 01:53:07 -0500 )edit

Thanks for your answer. It seems everything ok in cmake but I have errors when I try to compile. Without CUDA it works. So maybe I set the CUDA path in a wrong way. The only thing that I have to set in CUDA is: CUDA_SDK_ROOT_DIR-NOTFOUND

I set this one with C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/; It is correct? Could you send me your configuration file ? Thank you a lot.

EDIT: I mean the file CMakeCache.txt

jokla gravatar imagejokla ( 2013-07-02 02:05:48 -0500 )edit

You should also configure the architecture of your GPU card and make sure everything is configured correctly. My configuration file looks like this.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-02 02:28:38 -0500 )edit

I was using default native compilers. However now I realize this might be causing me problems when trying to link to these DLL's. So thank for the tip.

On another issue did you get the following warning? ICV: downloading URL is not specified, skip downloading

Any ideas on how to solve it?

Y Simson gravatar imageY Simson ( 2014-05-07 07:28:54 -0500 )edit
1

Well I cannot help you there. The dlls where made before the ICV functionality was introduced. I have no idea how to fix that problem :) But since it is a warning it is possible this is part of some extra functionality and not the core OpenCV code.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-05-07 08:38:20 -0500 )edit

By the way how do find out what is the latest STABLE version? Is version 3.00 stable?

Y Simson gravatar imageY Simson ( 2014-05-07 17:37:18 -0500 )edit
1

Nope, it is actually pretty simple. 2.4 is the stable branch. At the official download page you can see that there is the release 2.4.9 which is the latest official stable release. However, since the release the github repository has accepted some new merges and fixes, so in theory the latest stable release is the 2.4 branch of the repository, but it is not guaranteed 100%, more like 98%. The 3.0 branch will be the next big update, changing some principles in the openCV programming. The dev branch is for experiments!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-05-08 01:58:14 -0500 )edit
2

answered 2013-05-16 08:44:35 -0500

Vladislav Vinogradov gravatar image

updated 2013-05-17 03:27:45 -0500

It seems like CMake didn't find Visual Studio.

Which version do you have? Professional or Express?

As I remember, Express edition doesn't support x64 compilation out-of-box.

UPDATE 1:

As I see you install Visual Studio not to a default path (c:\Program Files...). For that case you should manually specify Visual Studio installation folder. But if you install Visual Studio to a default setup folder CMake will find it automatically.

edit flag offensive delete link more

Comments

2

I got a step further, seems I selected wrong compilers, will post solutions in original topic and adjust question a bit :) It seems that you need to select the 32bit compiler settings first to go to the next step. Thanks however for the help!

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-16 08:51:55 -0500 )edit
2

Found that out indeed :) Thanx for the add-on. Now trying to reduce the amount of architectures for GPU that need to be build, because it takes me too long, then just to see that it doesnt work. Seems my card can support compute capability 2.1, so will compile only for that architecture.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-17 03:37:19 -0500 )edit

I found that using: c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe

was the solution for compiling code suitable for x64 architecture. Though it is named AMD it works for both AMD and Intel processors. It is merely named AMD64 since AMD got there first

Y Simson gravatar imageY Simson ( 2014-05-07 17:39:51 -0500 )edit

That is exactly what I am doing also now ;)

StevenPuttemans gravatar imageStevenPuttemans ( 2014-05-08 01:58:51 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-05-16 08:07:37 -0500

Seen: 15,626 times

Last updated: May 31 '13