Matlab 2015a set mingw64 as mex compiler - matlab

I have Matlab2015a 64bit running on Win7 and I want to use Mingw-w64 compiler for mex files but the command *
mex -setup
says
MEX configured to use 'Microsoft Visual C++ 2012 (C)' for C language
compilation.
I have installed Mingw-w6 compiler in
C:\mingw-w64\x86_64-4.9.2-win32-seh-rt_v4-rev4\mingw64\bin
I even had a look at this question, but I could'n solve it.
How can I switch to Mingw gcc compiler?

To see which compilers are supported by your MATLAB version and OS go to
mathworks.com/support/compilers/VERSION/index.html
where VERSION is your version. i.e.
mathworks.com/support/compilers/R2015a/index.html
If a compiler is not there, then you can not use it. In your case, its not there.

Related

Gfortran compiler optimization flags similar to ifort in Intel

I am currently using ifort (Intel Fortran compiler). However, in the AMD cluster (which has AMD processors), it seems that Intel parallel studio can not be installed. Therefore I decided to use gfortran (GNU Fortran compiler) instead of ifort. In ifort, my compiler flags were
ftn -heap-arrays -mcmodel=large -g -c
I want to know the similar optimization flags in the GNU compiler.
My GCC version is 4.4.7 in centos 6.6 and the rocks cluster version is 6.2.

How to downgrade the gcc compiler?

I have to run a code. The code includes mex files. For building that code, it required gcc version of 4.4.
Following is the description of system
Windows 10
Visual Studio 2012
Matlab 2017a
And gcc version of my system is:
$gcc --version
gcc --version
gcc (GCC) 7.4.0
I do not know how to downgrade it. I have tried so many steps, but no use.
You'll need to install it first - Please use a previous question on the subject here:
Next - choose to use it on Matlab via :
mex -setup
#mano Here's my output of the mex -setup

Mex compiler not supporting vc++ 2015 but online it says that it does

The current MEX compiler 'Microsoft Visual C++ 2015 Professional (C)' is not supported.
Use mex -setup to select a supported compiler.
Output from mex -setup
MEX configured to use 'Microsoft Visual C++ 2015 Professional' for C++ language compilation.
I am not quite sure what to do to fix this.
C and C++ compilers need to be configured separately:
>> mex -setup C
and
>> mex -setup CPP
There's even one for Fortran if you have a supported compiler (mex -setup Fortran).

How to install libsvm in matlab

I'm using windows 7 and Matlab_R2011a. I'm trying to install LibSVM in these environments. I already installed Command Line Tools and I am trying to "make" file (go to unpacked folder of LibSVM on my Desktop, go to folder matlab and run "make"). However, I receive a compilers options as 0 and 1 but I couldn't find visual studio compiler even though I installed VS 2012
Your compiler version may not be supported/compatible with MATLAB R2011a.
First check Matlab page 'Supported and Compatible Compilers – Release R2011a' and then specify the version number.
For ex,if g++ X.Y is supported, replace CXX = g++ in the Makefile with CXX = g++-X.Y

Cannot find lg2c

I'm trying to create mex for matlab from some cpp and fortran files. They all compile well and creates the .obj file. But during linking I get the error lg2c not found.
I have matlab 2007 installed in win vista. I also have mingw and gnumex installed.
The mex -setup in matlab returns 2 compilers lcc and VS 2003
I'm using G77 fortran compiler
Followed instructions in http://www.cs.ubc.ca/~pcarbo/Compile_LBFGSB_on_Windows.txt
Fortran programs compiled with g77 (as provided by GCC <= 3.4.6) need to link with libg2c. Fortran programs compiled with gfortran (as provided by GCC >= 4.0.0) need to link with libgfortran. In any case, the compiler driver (whether g77 or gfortran) ought to do that for you.
Now, the question is: is there a reference to libg2c in the Matlab-provided files. If so, you have no choice but to provide libg2c. You can find a download there.