Bindings to access openCV from MATLAB do not generate
WAS ORIGINALLY: "MATLAB bindings will not be generated". Reason to edit the question header text: I changed the question header text after having learned that I have to better distinguish between all the different available bindings.
The MATLAB "Not working" state persists.
The CMake-GUI configuration phase meanwhile terminates error message free for me.
Find below the original question, still serving as a blog on what I did and what I encountered so far:
Hello, I can't get the MATLAB bindings generated and search for your help. CMake throws the message:
Matlab:
mex: C:/Program Files/MATLAB/R2014b/bin/mex.bat
Compiler/generator: Not working (bindings will not be generated)
I am running Win 7 Pro 64 bit, the current versions (all downloaded yesterday (11th Feb 2015)) of openCV 3.0 Beta, Python 3.4.2 and CMake 3.1.2, and have installed and running MATLAB R2014b 64 bit and the Windows SDK7.1 for providing the compilers. I have not Visual Studio installed, because I do not find a free-of-cost "Express" version on the MS site anymore. The new "Community" version is not listed as a MATLAB compatible choice on THE MATHWORKS site. So I prefer to stay with the SDK, which anyway contains all compilers and tools of the VS, and seems to mainly differ only in excluding to provide the Visual Studio IDE and some very advanced software development tools.
I confirmed that I can in MATLAB compile MEX files with the SDK provided compiler.
I start from the SDK Command Prompt (this is needed to avoid that SDK path variables and SDK registry keys are missing when CMake connects to the compiler) the CMake-GUI, and configure the Visual Studio 10 2010 Win64 compiler, with the option set to use default native compilers. In the SDK Command Prompt I also tried to first use the SetEnv command to already there set the target as /Release X64 Win 7 . Well, so far I can't overcome the message mentioned above, and after 2 days of exhausting searches in the internet I kindly ask for your help: Any idea what I shall try next? Thanks!
EDIT I: I meanwhile found out that in the openCV 3.0 Beta distribution the CMakeLists.txt or openCVFindMatlab.cmake files might not be complete: The following is an excerpt from the CMakeLists.txt file, around line 1064:
status(" Matlab:")
status(" mex:" MATLAB_MEX_SCRIPT THEN "${MATLAB_MEX_SCRIPT}" ELSE NO)
if (MATLAB_FOUND)
status(" Compiler/generator:" MEX_WORKS THEN "Working" ELSE "Not working (bindings will not be generated)")
endif()
The variable MEX_WORKS only becomes mentioned in the above cited CMakeLists.txt line 1064, and of course then has to produce, as not existent, the message "Not working". While in the file OpenCVFindMatlab.cmake it can be found in lines 160, 161, 167, and 169 that MATLAB_MEX_SCRIPT becomes generated, no code (I searched for the string "MEX_WORKS" in all files in the source directory) could be found concerning MEX_WORKS. Am I wrong ? Any help is appreciated!
EDIT II: I ...
related to this issue ?
I guess that it is not related to that problem, I at least haven´t encountered that particular error message by now. The bad message which I received can already be found in the log file written by CMake during the configuration phase. I then did not start to actually "generate", because it is already clear that the outcome would not be what I want. Maybe I will run into that problem later, then. Well, I now first would like to step forward in the configuration phase and will see what comes up next afterwards. Anyway, thanks for you hint!
After some very long search I finally found, that the openCV bindings for MATLAB are just not part of the ready to download openCV 3.0 Beta distribution, but have to be found in an opencv_contrib branch here: http://github.com/Itseez/opencv_contr... . Sorry for having bothered you.
And yes, now I hit into the same issue as @berak .
well, in the long run, @hiltonbristow will have to come around and fix it.
if you're bold, and got some basic python skills, you could try on your own: https://github.com/Itseez/opencv_cont...
basically try to comment lines 32, 37-41, 59,60,61
(you won't get any docs this way, but even if the rst-parser still existed, it would not be able to extract any inline docs anymore, since they were all converted to doxygen tags)
((and no, have not tried exactly this (no matlab here))
@berak The developers are most likely already aware about it, as it is mentioned here . Also, trying to build openCV with the bindings to use it from MATLAB this morning didn't throw that error to me anymore, instead I am now facing a new one. I have to guess that the new error occures even before hitting the issue which you made me aware about, because the topic of your issue is not marked to have been worked on, at the github page. I updated my question above according to my new problem, and put the most up-to-date information to the bottom of that post.
well, for gen_matlab.py / the rsr_parser deps, you could try out, if commenting above mentionend lines would help, maybe even do a pullreq. to help the next one trying this.
sorry, no idea, why the test fails with cmake. but again, it looks like it's only the test, not the main module