matlab mex cannot find vcomp.lib when openmp is used - c++

I am trying to mex a c++ source file containing openmp usages. In the mex command, i have added COMPFLAGS="/openmp $COMPFLAGS" but it says cannot find vcomp.lib. My matlab mex have been setup to use the compiler of Windows SDK 7.1 located in C:\Program Files. I checked the lib files inside this SDK and didn't find vcomp.lib. Anyone knows how can I install openmp to Windows SDK 7.1? Thanks a lot!

Based on this thread, it seems openmp is not shipped with Windows SDK. It is only shipped with Visual Studion Professional or Ultimate.
This matlab central site proposed a method to enable the matlab mex to use the Visual Studio 2013 compiler instead of the Windows SDK compiler. OpenMP is shipped with Visual Studio 2013 Professional and I can now compile code with OpenMp Enabled!

Related

How to install a new C/C++ library and make it visible in Visual Studio 2017

Hello everybody I'm porting a C/C++ Unix application to Windows. My problem is that I need to download the various Unix native libraries into their windows version and then I have to use them. Doew anyone know what's the procedure to follow to make Visual Studio 2017 recognize the new downloaded libraries? For example, if I had to download the windows version of GnuTLS from this site: https://www.gnutls.org/download.html how should I do to make the library header files visible and usable from visual studio? What's the procedure to follow?

Could I use Intel C++ Compiler without Installing Visual Studio [on Windows]

I need intel compiler for my work on My windows [Win7 Prof, 64bit]. I am planning to download the trial version for the same i.e. IntelĀ® Parallel Studio XE.
Could I install this without installing Visual Studio ? I wish to use this on command line only i.e. icl.exe through Cygwin.
Any help is appreciated.
Yes you can.
Per the documentation, you have support for:
Command Line (What you're looking for)
Visual Studio
Eclipse
XCode

MATLAB R2013b does not support Visual Studio 2013?

I have recently installed VS 2013. I have a .cpp project which I want to compile into mex with MATLAB 2013b. As soon as I enter:
mex -setup
in MATLAB and then I select "y" for "Would you like mex to locate installed compilers?", I receive the message that: "No supported SDK or compiler was found on this computer."
How can I get around this problem?
Visual Studio 2013 is not supported by MATLAB R2013b. See this link for more details: http://www.mathworks.com/support/compilers/R2013b/. The latest compiler and environment that R2013b can support for Windows is Visual Studio 2012. Your options are to either downgrade your version of Visual Studio to one that is compatible on that list I referred you to, or upgrade your version of MATLAB to at least R2014a or higher.

How can I compile the vlfeat and mexopencv libraries in MATLAB using the Visual c++ compiler?

I am working on a computer vision project, and I need to use the vlfeat and mexopencv libraries,
I am working with MATLAB R2008a and I cannot change the MATLAB compiler to compile and setup the libraries.
I have installed Microsoft Visual C++ Express, but I don't know how to compile the libraries using the Visual C++ compiler in MATLAB.
The reason why you can't find the compiler is because you are using MATLAB R2008a. The C++ compiler you have downloaded is probably too new for MATLAB to use. My guess is that you are using Express 2013. See the following link on what compilers R2008a can support for MEX here:
http://www.mathworks.com/support/compilers/release2008a/
Specifically, for the Express edition of the Visual C++ compiler, it can only support up to Version 8.0. You are most likely using an Express edition that is newer than 8.0. As such, the only way for you to use the Visual C++ compiler with R2008a is if you download the 8.0 Express edition and install it.
You can find that compiler here: http://go.microsoft.com/fwlink/?LinkId=51410&clcid=0x409
Once you install the Visual C++ compiler, you also need to install the SDK. You can find that here:
http://www.microsoft.com/en-ca/download/details.aspx?id=6510
After you do this, you need to define the MSSdk environment variable. To do this,
go to Control Panel -> System then Advanced and Environment Variables. After, create a new variable with the name MSSdk and the value being the path of where you installed the SDK. For example: C:\Program Files\Microsoft Platform SDK for Windows Server 2003.
Good luck!

Using Visual Studio 2013's C compiler for MATLAB

I added Visual Studio 2013 as the default C compiler for MATLAB using the mex -setup command. I added Visual Studio 2013 using a download I found on the internet with the following instructions.
The files
* msvc120engmatopts.bat
* msvc120opts.bat
* msvc120opts.stp
should be copied to C:\Program Files\MATLAB\R2013a\bin\win64\mexopts .
The files
* msvc120compp.bat
* msvc120compp.stp
should be copied to C:\Program Files\MATLAB\R2013a\bin\win64\mbuildopts .
My version of MATLAB is R2011b, so I replaced the path appropriately.
Here's me using it to run a C function to verify if the compiler has been linked.
Log File
I found out about this method from this answer.
However, when I use a MATLAB function within a Simulink Model, I get the following error message just like I did before I linked the VS2013 compiler to MATLAB.
Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
Use 'mex -setup' to select a supported C-compiler.
Okay, so the only thing that works for my version of MATLAB "R2011b" is Microsoft SDK 7.1 since the other compilers are too old for Windows 7 64 bit. MinGW-64 bit is unsupported. Although it works on MATLAB it is not recognized by Stateflow.
So I just downloaded the .iso file from here.
If you face any difficulty while installing the SDK, then try this.