I have a file with the extension .F, which I want to compile to use with my Matlab code. To do that I`m trying to use mex tool. "mex -setup FORTRAN -v" returns.
mex -setup FORTRAN -v
Verbose mode is on.
... Looking for compiler 'Intel Visual Fortran Composer XE 2011 with Microsoft SDK 7.1' ...
... Looking for environment variable 'IFORT_COMPILER12' ...No.
Did not find installed compiler 'Intel Visual Fortran Composer XE 2011 with Microsoft SDK 7.1'.
... Looking for compiler 'Intel Visual Fortran Composer XE 2011 with Microsoft Visual Studio 2008' ...
... Looking for environment variable 'IFORT_COMPILER12' ...No.
Did not find installed compiler 'Intel Visual Fortran Composer XE 2011 with Microsoft Visual Studio 2008'.
... Looking for compiler 'Intel Visual Fortran Composer XE 2011 with Microsoft Visual Studio 2010' ...
... Looking for environment variable 'IFORT_COMPILER12' ...No.
Did not find installed compiler 'Intel Visual Fortran Composer XE 2011 with Microsoft Visual Studio 2010'.
... Looking for compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2008' ...
... Looking for environment variable 'IFORT_COMPILER14' ...No.
... Looking for environment variable 'IFORT_COMPILER13' ...No.
Did not find installed compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2008'.
... Looking for compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2010' ...
... Looking for environment variable 'IFORT_COMPILER14' ...No.
... Looking for environment variable 'IFORT_COMPILER13' ...No.
Did not find installed compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2010'.
... Looking for compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2012' ...
... Looking for environment variable 'IFORT_COMPILER14' ...No.
... Looking for environment variable 'IFORT_COMPILER13' ...No.
Did not find installed compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2012'.
Error using mex
No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2014b/win64.html.
It seems to me that the problem is I don't have any default compiler. So I downloaded MGW with gfortran compiler and now I want to set it up as a tool for mex to compile. Surfing through internet I haven't found any instructions how to do so. I would be glad to advice how to do that or for any alternative way.
Some extra info for people who can think of alternatives. I got file with the extension .F and I have compiled binary with extension mexa64, which stands for Linux binary. But what I need to get is mexw64, which is the version for 64-bit Windows.
Additionally this is the output of getCompilerConfigurations, which shows that there is a C compiler and no Fortran compiler
mex.getCompilerConfigurations('C')
ans =
CompilerConfiguration with properties:
Name: 'Microsoft Visual C++ 2012 (C)'
Manufacturer: 'Microsoft'
Language: 'C'
Version: '11.0'
Location: 'D:\apps\visualstudio2012'
ShortName: 'MSVC110'
Priority: 'A'
Details: [1x1 mex.CompilerConfigurationDetails]
LinkerName: 'link'
LinkerVersion: ''
MexOpt: 'C:\Users\Ian\AppData\Roaming\MathWorks\MATLAB\R2014b\mex_C_win64.xml'
mex.getCompilerConfigurations('Fortran')
ans =
0x1 CompilerConfiguration array with properties:
Name
Manufacturer
Language
Version
Location
ShortName
Priority
Details
LinkerName
LinkerVersion
MexOpt