mex -setup -v FORTRAN, Failure using R2014a with Win7, MSVS2013 sp1 and Intel Fotran Composer 2013 SP1

3 views (last 30 days)
mex -setup -v worked just fine to set up C++, but failed to setup Fortran. From the output, it looks like matlab is not properly supporting the latest compilers from 2013, but would have worked if MSVS was 2012. Is there a way I can easily fix the problem by making a link, adding a path or copying a file?
Here is the output:
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' ...Yes ('C:\Program Files (x86)\Intel\Composer XE 2013 SP1\').
... Looking for file 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1\Bin\intel64\ifort.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1' InstallationFolder ...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' ...Yes ('C:\Program Files (x86)\Intel\Composer XE 2013 SP1\').
... Looking for file 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1\Bin\intel64\ifort.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1' ...Yes.
... Looking for environment variable 'VS100COMNTOOLS' ...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' ...Yes ('C:\Program Files (x86)\Intel\Composer XE 2013 SP1\').
... Looking for file 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1\Bin\intel64\ifort.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...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/R2014a/win64.
  1 Comment
Nathan
Nathan on 8 Aug 2014
I tried a little hack to get by.... took the 2012 configuration file and edited it by adjusting the version of msvs from 11 to 12 and renamed the file to mex_F_win64.xml and mex_FORTRAN_win64.xml.
<?xml version="1.0" encoding="UTF-8" ?>
<config
Name="Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2013"
ShortName="INTELF13MSVS2013"
Manufacturer="Intel"
Version="13.0"
Language="FORTRAN"
Priority="B"
Location="$FORTRANROOT" >
<Details
CompilerExecutable="$COMPILER"
CompilerDefines="$COMPDEFINES"
CompilerFlags="$COMPFLAGS"
OptimizationFlags="$OPTIMFLAGS"
DebugFlags="$DEBUGFLAGS"
IncludeFlags="$INCLUDE"
LinkerExecutable="$LINKER"
LinkerFlags="$LINKFLAGS"
LinkerLibraries="$LINKLIBS"
LinkerDebugFlags="$LINKDEBUGFLAGS"
LinkerOptimizationFlags="$LINKOPTIMFLAGS"
CommandLineShell="$FORTRANROOT\bin\ifortvars.bat "
CommandLineShellArg="intel64"
CompilerDefineFormatter="/D%s"
LinkerLibrarySwitchFormatter="lib%s.lib;%s.lib"
LinkerPathFormatter="/LIBPATH:%s"
LibrarySearchPath="$$LIB;$$LIBPATH;$$PATH;$$INCLUDE;$MATLABROOT\extern\lib\$ARCH\microsoft"
/>
<!-- Switch guide: http://msdn.microsoft.com/en-us/library/fwkeyyhe(v=vs.71).aspx -->
<vars
CMDLINE100="$COMPILER /c $COMPFLAGS $OPTIM $SRC /Fo$OBJ"
CMDLINE200="$LINKER $LINKFLAGS $LINKTYPE $LINKOPTIM $LINKEXPORT $OBJS $LINKLIBS /out:$EXE"
CMDLINE250="mt -outputresource:$EXE;2 -manifest $MANIFEST"
CMDLINE300="del $OBJ $EXP $LIB $MANIFEST $ILK"
COMPILER="ifort"
COMPFLAGS="/nologo /fpp /Qprec /fixed /MD /fp:source /assume:bscc $INCLUDE $COMPDEFINES"
COMPDEFINES="/DMATLAB_MEX_FILE"
OPTIMFLAGS="/O2 /DNDEBUG"
INCLUDE="-I"$MATLABROOT\extern\include""
DEBUGFLAGS="/Z7"
LINKER="link"
LINKFLAGS=" /nologo /manifest /INCREMENTAL:NO"
LINKTYPE="/DLL"
LINKEXPORT=" /EXPORT:MEXFUNCTION"
LINKLIBS="/LIBPATH:"$MATLABROOT\extern\lib\$ARCH\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
LINKDEBUGFLAGS="/debug /PDB:"$TEMPNAME$LDEXT.pdb""
LINKOPTIMFLAGS=""
OBJEXT=".obj"
LDEXT=".mexw64"
SETENV="set COMPILER=$COMPILER
set COMPFLAGS=/c $COMPFLAGS $COMPDEFINES $MATLABMEX
set OPTIMFLAGS=$OPTIMFLAGS
set DEBUGFLAGS=$DEBUGFLAGS
set LINKER=$LINKER
set LINKFLAGS=$LINKFLAGS /export:%ENTRYPOINT% $LINKTYPE $LINKLIBS $LINKEXPORT
set LINKDEBUGFLAGS=/debug /PDB:"%OUTDIR%%MEX_NAME%$LDEXT.pdb"
set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%""
/>
<client>
<engine
CMDLINE250="mt -outputresource:$EXE;1 -manifest $MANIFEST"
LINKLIBS="$LINKLIBS libeng.lib"
LINKEXPORT="/subsystem:console"
LDEXT=".exe"
LINKTYPE=""
MATLABMEX=""
/>
</client>
<locationFinder>
<FORTRANROOT>
<and>
<or>
<envVarExists name="IFORT_COMPILER14" />
<envVarExists name="IFORT_COMPILER13" />
</or>
<fileExists name="$$/Bin/intel64/ifort.exe" />
<dirExists name="$$/../.." />
</and>
</FORTRANROOT>
<VCROOT>
<and>
<or>
<hklmExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="12.0" />
<hkcuExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="12.0" />
<hklmExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="12.0" />
<hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="12.0" />
</or>
<fileExists name="$$/VC/bin/amd64/cl.exe" />
<dirExists name="$$/../.." />
</and>
</VCROOT>
<SDKROOT>
<or>
<hklmExists path="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0" name="InstallationFolder" />
<hkcuExists path="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0" name="InstallationFolder" />
<hklmExists path="SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0" name="InstallationFolder" />
<hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0" name="InstallationFolder" />
</or>
</SDKROOT>
</locationFinder>
<env
PATH="$FORTRANROOT\bin\intel64;$VCROOT\bin\amd64;$VCROOT\bin\VCPackages;$VCROOT\..\Common7\IDE;$VCROOT\..\Common7\Tools;$SDKROOT\bin\x64;$SDKROOT\bin;"
INCLUDE="$FORTRANROOT\include;$FORTRANROOT\compiler\include;$VCROOT\INCLUDE;$SDKROOT\include\shared;$SDKROOT\include\um;$SDKROOT\include\winrt;$MATLABROOT\extern\include;"
LIB="$FORTRANROOT\lib\intel64;$FORTRANROOT\compiler\lib\intel64;$VCROOT\Lib\amd64;$SDKROOT\Lib\X64;$SDKROOT\lib\win8\um\x64;$MATLABROOT\lib\$ARCH;"
LIBPATH="$VCROOT\Lib\amd64;$FORTRANROOT\compiler\Lib\Intel64;$SDKROOT\LIB\x64;$VCROOT\\LIB\amd64;$VCROOT\ATLMFC\LIB\amd64;$MATLABROOT\extern\lib\win64;"
/>
</config>
Unfortunately, this didn't work when tested against the matlab example. I must have used the wrong naming convention or placed the file in the wrong location. (I placed it in the same folder as the mex_C_win64.xml was placed.)
>> mex -v -largeArrayDims fulltosparse.F loadsparse.F
Verbose mode is on.
No MEX options file identified; looking for an implicit selection.

Sign in to comment.

Accepted Answer

Ken Atwell
Ken Atwell on 11 Aug 2014
As you've discovered, your particular combination of Intel Fortran and Visual Studio is not supported in 14a ( Details ).
You are on the right track if you want to hack something together. None of this is documented or supported, I can offer a few hints:
  1. Don't meddle with the files in your preferences folder ('prefdir'). Instead, put the XML file you are experimenting with in your current working folder ('pwd'). Give it a name like 'custom.xml'; you can instruct MEX to use this file with 'mex -f custom.xml other arguments'.
  2. You are effectively going to want to update custom.xml file such that it preserves the Intel-specific settings, but swaps in the VS2013 settings. This is often, but not always, a largely mechanical process. The file matlabroot\bin\win64\mexopts\msvcpp2013.xml should give you a strong sense of the edits you'll want to make in custom.xml
Hope this helps.
  1 Comment
Nathan
Nathan on 11 Aug 2014
Edited: Nathan on 11 Aug 2014
Ken,
Thanks for getting back with that hint on how to better pretend to be a matlab programer..... =)
I was able to go a different more robust route after some advice from a collegue. Since MSVS 2013 licence comes with the rights to install 2012, I simply installed msvs2012 entered the correct product key from my MSDN account and BANG! problem solved with a mathworks supported method of mex -setup. Others will just need to keep in mind that this would not work if a win 8 machine is involved as msvs 2012 is not supported on win8.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!