Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Visual Fortran for MATLAB (mex)

ambrogio_c_
Beginner
812 Views

I need a Fortran Compiler to be used with MATLAB 2016 mex utility MATLAB requires Intel Parallel Studio XE 2015 for Fortran or Intel Parallel Studio XE 2016 for Fortran or Intel Visual Fortran Composer XE 2013. Unfortunately, none of these compilers can be found on the Intel web sites. Only 2017 versions can be downloaded In the past, an option for downloading older versions was present. but now it is no lomger available. What can I do? Thanks for any hints... Ambrogio ambrogio.colombo@gmail.com

0 Kudos
4 Replies
TimP
Honored Contributor III
812 Views

I don't know of any change in the procedure described at

https://software.intel.com/en-us/articles/older-version-product

At times, certain versions of FireFox didn't work correctly at registrationcenter.intel.com.

How could yesterday's compiler updates break MATLAB?

You leave no clues about what went wrong for you.

0 Kudos
ambrogio_c_
Beginner
812 Views

I am a MATLAB R2016a user and I want to use MEX (a MATLAB utility which "wraps" a FORTRAN or C code  generating a MATLAB module). MEX requires that some FORTRAN or C compiler should be installed.
I have installed on my computer the Intel Parallel Studio XE 2017.
The following MATLAB/MEX command shows the list of the supported compilers for a given language:

mex -v -setup FORTRAN

The command generates the list reported below. The Intel Parallel Studio XE 2017 is not included in the list, and in fact the message "No supported compiler or SDK was found" is displayed.

I did not find in the Intel download page any reference to the "old compilers". I used both Chrome and Microsoft Edge.
Maybe could you provide a more specific link? I would like to download a "30 days try and buy" package in order to test the MATLAB/MEX compatibility.

Thanks.
Ambrogio

ambrogio.colombo@gmail.com


LIST OF FORTRAN COMPILERS SUPPORTED BY MATLAB R2016A

>> mex -v -setup FORTRAN
Verbose mode is on.
... Looking for compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft SDK 7.1' ...
... 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 SDK 7.1'.
... 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'.
... Looking for compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2013' ...
... 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 2013'.
... Looking for compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft SDK 7.1' ...
... Looking for environment variable 'IFORT_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft SDK 7.1'.
... Looking for compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2010' ...
... Looking for environment variable 'IFORT_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2010'.
... Looking for compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2012' ...
... Looking for environment variable 'IFORT_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2012'.
... Looking for compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2013' ...
... Looking for environment variable 'IFORT_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2013'.
... Looking for compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2015' ...
... Looking for environment variable 'IFORT_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 for Fortran with Microsoft Visual Studio 2015'.
... Looking for compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft SDK 7.1' ...
... Looking for environment variable 'IFORT_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft SDK 7.1'.
... Looking for compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2010' ...
... Looking for environment variable 'IFORT_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2010'.
... Looking for compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2012' ...
... Looking for environment variable 'IFORT_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2012'.
... Looking for compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2013' ...
... Looking for environment variable 'IFORT_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2013'.
... Looking for compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2015' ...
... Looking for environment variable 'IFORT_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 for Fortran with Microsoft Visual Studio 2015'.
Error using mex
No supported compiler or SDK was found. For options, visit
http://www.mathworks.com/support/compilers/R2016a/win64.html.
 

0 Kudos
mecej4
Honored Contributor III
812 Views

Ambrogio, if you just wish to try building some straightforward MEX files and using them from Matlab, it is unnecessary to go through all the red tape procedures using mex -setup, installing an older version of Visual Studio and Intel Fortran, etc. On the other hand, you cannot expect a Mathworks product built in 2015/2016 to support an Intel compiler product that was not yet in existence. 

In most cases, the restrictions in the Mathworks link that you gave in #3 do not apply. Here is an example of how to go about building a Mex file, and trying out this way is far less time-consuming than installing, licensing and uninstalling huge software distributions.

I have access to Matlab 2015a for Windows 64. Here is how to build the yprime example in the Matlab extern\examples\mex directory.

  1. Open an Intel Fortran compiler command window for X64 targets (from the Start menu or otherwise).
  2. Set up the environment for building mex-files:
  • set MLDIR=d:\MATH\MLR2015a (alter to suit -- Matlab installed directory)
  • set include=%include%;%mldir%\extern\include
  • set lib=%lib%;%mldir%\extern\lib\win64\microsoft
  1. Build the Mex file: 
  • ifort /fpp /LD yprimef.F yprimefg.F libmx.lib libmex.lib /link /export:MEXFUNCTION /out:yprime.mexw64
  1. Start Matlab, change to the directory containing the Mex file, and test it using the Matlab command
  • y=[1,2,3,4]; t=0; yp=yprime(t,y)

I tested the procedure that I just gave with two versions of Intel Fortran: the current one, 2017.0, and a quite old one: 9.1,  dated 2007. Both worked correctly.

(P.S. I could not figure out an easy way of getting the item numbers in my post to start from a value other than 1, since the formatter does not recognize <ol start="3"> -- please overlook this.)

0 Kudos
ambrogio_c_
Beginner
812 Views

Hi Mecej4,

thank you  for the hints. I followed your directions and everything worked!

Thank you very much indeed

Ambrogio

0 Kudos
Reply