mex -setup seems complete while during compilation i get error "no compiler installed" - matlab

I am using Matlab 2012a on a W7 64-bit machine. Don't quite remember now, it was half a year ago when I installed stuff, so now I can only guess the sequence based on installation dates.
Right now I've got Matlab, Matlab compiler runtime, MS Windows SDK 7.1 and .NET Framework 4 and many other perhaps unnecessary programs (I found e.g. MS Visual C++ 2008 standard compilers).
Recently I tried the procedure stated here , to no effect. I haven't reinstalled anything yet.
I may attach list of programs with installation dates, if necessary.
The problem is as follows - even though I've completed mex -setup (and it seems it succeeded, it shows the correct path to SDK 7.1 and accepts it), during compiling a model in simulink I get an error "an installed compiler was not detected". I'd like to know what should I do now.

Lots of people have this problem on Windows 7, and while Mathworks has published a solution, I spent several days trying and re-trying it to no avail.
As a work around, re-install Matlab as 32-bit. It comes with a built-in compiler, and Mex seems to work out of the box. Less than ideal but it works.

Related

MATLAB loadlibrary error: Undefined symbol: _intel_fast_memmove

I am trying to load a 3rd-party library (.so file) into MATLAB under RHEL.
I am getting an error: undefined:symbol: _intel_fast_memmove.
From Symbol lookup error: _FileName_: undefined symbol: _intel_fast_memmove it seems like I need to add a sub-directory of /opt/intel to my LD_LIBRARY_PATH environment variable, but I don't have an /opt/intel directory.
UPDATE:
MATLAB said that the problem came when trying to load libifcoremt.so.5. I have since installed Intel's Redistributable Libraries and all that did was call Intel's version of libifcoremt.so.5 but still looked for _intel_fast_memmove (but still didn't find it). So now I'm thinking that there must be some other "definitions" file somewhere that I'm missing.
It took me a few days, but I was able to figure out what was going on.
In the end, there were two problems:
I was missing some libraries -- not the ones that I mention in my question, but Intel's Redistributable Libraries.
Even with all of the libraries on my computer, MATLAB was still using an older version of the some of the .os files.
I failed to mention in my question that while the 3rd-party library is fairly recent, I was calling it from MATLAB 2012B because I needed to integrate it with a software package that doesn't work correctly with later MATLAB versions. My apologies for that omission -- it turns out to be a critical piece of the puzzle.
While diagnosing this issue, I learned that MATLAB has it's own copy of the Intel libraries in the <MATLAB>/sys/os/glnxa64 sub-directory and that it creates an internal version of LD_LIBRARY_PATH that points to its internal version before the LD_LIBRARY_PATH that it imports from the Linux OS. Since the version of MATLAB I'm using is 6 years old, so is it's Intel library, which doesn't contain some symbols defined in the new library, such as intel_fast_memmove.
To get the integrated system up and running, I instituted a workaround to rename the sys/os/glnxa64 before calling the 3rd-party library so that MATLAB found the newer Intel library instead of the MATLAB 2012B version. And then named it back when done (without that directory, MATLAB won't start).
Note: I first tried editing the value of LD_LIBRARY_PATH inside MATLAB 2012B to prefer the new Intel library, but found that even though the external variable value changed, loadlibrary still used the original value that placed MATLAB's library first on the path.

No supported SDK compiler found on this computer/LIBSVM

I try to install LIBSVM on a Windows 10 PC. Everytime I try to run the make file I get the following error:
No supported SDK or compiler was found on this computer.
For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013b/win64.html
I have tried to install all supported compilers and non of them worked and I stil get the error message back. Also when I type mex -setup it says:"No supported SDK or compiler was found on this computer. "
I have read this question and several others: https://de.mathworks.com/matlabcentral/answers/100144-why-does-mex-not-find-the-microsoft-windows-sdk-7-1-installed-on-64-bit-windows-in-matlab-7-14-r201 and also tried to isntall the respective batch but as I said I am using Windows 10 not 7 and it gives me the respective error message. Moreover I have installed not only the compiler but also the .NET Framework 4. I have also installed the dependency walker and it does not show me any missing packages.
As you can possibly see from the question I am not an expert but I am searching for hours now and I get back the same error message again and again.Are there any suggestions how I could make LIBSVM work?
Thanks
Carlos
Cannot install Windows SDK 7.1 on Windows 10
That did the trick--in case anyone ever stumbles upon the same problem.

mexopencv needs to re-compile every I restart Matlab

I've recently installed mexopencv for MATLAB on my Windows 7 machine. I'm using MATLAB 2015a 32-bit (on a 64-bit machine). I followed the recommended installation steps (from a number of sources - I had compiler issues to start with) and eventually got it working. The final step in the process is running the following command in MATLAB:
mexopencv.make
This is fine and I've been using it happily ever since. However, whenever I restart MATLAB and run my code which uses mexopencv functions, I get the following:
Error using cv.undistort
Invalid MEX-file 'C:\mexopencv-master\+cv\undistort.mexw32':
C:\mexopencv-master\+cv\undistort.mexw32 is not a valid Win32
application.
After some investigation it seems the only way I can get around this is to run the following every time I restart MATLAB:
mexopencv.make('clean',true)
mexopencv.make
So this is essentially re-compiling the mex files every time I start MATLAB. This takes a good couple of minutes and is a real pain!
Is there some way to get around having to do this each time?
I was facing the same problem (needed to rebuild mexopencv every time). Some people said they solved this problem by setting system PATH but not in my case. Mine was solved by copying all opencv dlls to the same directory those compiled mex files are.

Error: Invalid MEX file, the specified module could not be found

I have compiled Mex file successfully on my laptop. But when I am running it, it says Invalid mex file 'c:\newfolder\filename.mexw32' The specified module could not be found.
System specification:
OS: windows 7
MATLAB 2010a
Microsoft Visual Studio 2008.
The same mex file is compiled and run successfully on my PC under XP SP3.
This MathWorks support link suggests two possible reasons to your problem:
You do not have all of the necessary libraries that the MEX-function is dependent upon.
You are running a MEX-file on a different version of MATLAB than it was compiled on.
Either way, to locate the source of this error it says that you need to list all dependent library files and verify their existence in the system you're trying to run the MEX file on, and also recommends the Dependecy Walker as the tool to to do that.
Do you you the mex file on another system than the one it is created on?
If so, then you need to install the Microsoft Visual C++ Redistributable on that machine.
I had this problem also when upgrading from Matlab2010a/VS2008 to Matlab2013a/VS2010.
All my environment variables were sent correctly.
A reboot fixed problems with OpenCV dlls not being found, I assume that it was still trying to link to the OpenCV dlls for VS2008 (even though I had changed the path). However still my mex file could not find libmex.dll.
When I installed Matlab2013a, I did not uninstall the old version (in case I wanted to go back).
However that was the cause of my problem.
Once I uninstalled the old version of Matlab and rebooted again, the problem was gone.
I had a similar problem. I was only linking against 1 'lib' so I simply copied that lib into the same folder as the mexw64 and it worked.
I have not poked around for the correct place to tell MATLAB to add the lib's real location to whatever path it's looking at.

Loading Libtiff in MATLAB R2012a

I´m trying to load libtiff 3.9.5 in MATLAB R2012a and the situation is: Matlab says I need a Compiler and Perl. I installed Visual Studio 2010 and perl 5.14.2. mex -setup says Compiler is ok but nothing about Perl. Running loadlibrary I got lots of errors ( input character not valid and unkown variable among them). I found that Matlab looks for shrlib.dll in Windows Systems so I get a libtiff.dll in the Internet, use it and nothing changes. Next I get Big TIFF libtiff 4.1 which has a libtiff.lib and no changes again. As I am new in Matlab I just can´t think of what to do anymore. So I ask if somebody will help me. Many thanks in advance and best regards.
P.S. I put libtiff folder in R2012a directory a made it Current Folder.