MATLAB Answers

MEX can't find Intel Parallel Studio XE for Fortran 2017

12 views (last 30 days)
José Victor Boaretto Guissoni
Edited: bryan linehan on 28 Oct 2020
"Error using mex
No supported compiler or SDK was found."
I have installed Matlab 2017a, Intel Parallel Studio XE Composer Edition for Fortran macOS 2017, both are trial versions, and Xcode 8.3.3, running on macOS 10.12.6. I also have installed Matlab 2016a.
When I type "mex -setup -v FORTRAN" I get the following:
"Verbose mode is on.
Looking for compiler 'Intel Fortran Composer XE' ...
Looking for environment variable 'IFORT_COMPILER17' ...No.
Looking for environment variable 'IFORT_COMPILER16' ...No.
Looking for environment variable 'IFORT_COMPILER15' ...No.
Looking for environment variable 'IFORT_COMPILER14' ...No.
Looking for environment variable 'IFORT_COMPILER13' ...No.
Executing command 'which ifort' ...No.
Did not find installed compiler 'Intel Fortran Composer XE'.
I have already reinstalled Intel Parallel Studio XE Composer Edition for Fortran macOS 2017 and it didn't work. When I compile prime.c it works.
mex yprime.c
Building with 'Xcode with Clang'.
MEX completed successfully.
But when I try to compile yprimef.F yprimefg.F I got the error already reported above.

  0 Comments

Sign in to comment.

Answers (1)

Guillaume
Guillaume on 18 Jun 2018
Edited: Guillaume on 18 Jun 2018
solution
setenv('IFORT_COMPILER17','/opt/intel/compilers_and_libraries_2017.5.220/mac/');
mex -setup -v FORTRAN
change the setenv to your IFORT COMPILER version and path
Guillaume

  2 Comments

Fabian Krusa
Fabian Krusa on 13 Oct 2020
I did exactly as you recommend, but only get:
setenv('IFORT_COMPILER20','/opt/intel/compilers_and_libraries_2020.2.258/mac/')
>> mex -setup Fortran -v
Verbose mode is on.
... Looking for compiler 'Intel Fortran Composer XE' ...
... Looking for environment variable 'IFORT_COMPILER20' ...Yes ('/opt/intel/compilers_and_libraries_2020.2.258/mac/').
... Looking for folder '/opt/intel/compilers_and_libraries_2020.2.258/mac/bin/intel64' ...Yes.
... Looking for environment variable 'IFORT_COMPILER20' ...Yes ('/opt/intel/compilers_and_libraries_2020.2.258/mac/').
... Looking for folder '/opt/intel/compilers_and_libraries_2020.2.258/mac/compiler/lib' ...Yes.
... Executing command 'ifort --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -1' .../var/folders/6j/dnn6sst94fj247qv461ry8bc0000gn/T/mex_161298097367978_986: line 2: ifort: command not found
No.
Did not find installed compiler 'Intel Fortran Composer XE'.
Any advice?
bryan linehan
bryan linehan on 28 Oct 2020
I was able to get mex fortran to run on OSX 10.15.6 after running into this error.
In addition to the instructions above, I opened /Applications/MATLAB_R2020b.app/bin/maci64/mexopts/intel_fortran.xml and replaced line 107
<cmdReturns name="ifort --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]' | head -1" />
with
<cmdReturns name="/usr/local/bin/ifort --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]' | head -1" />
Note that I had run
mex.getCompilerConfigurations
prior to correcting the xml file. This was suggested in https://www.mathworks.com/matlabcentral/answers/512901-mex-xcodebuild-error-sdk-macosx10-15-4-cannot-be-located#answer_426086 . I am unsure whether both actions were needed, but everything seems to be working now. I am not sure what was causing
% Executing command 'ifort --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]' | head -1'
to fail.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!