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

1 次查看(过去 30 天)
"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.

回答(1 个)

Guillaume
Guillaume 2018-6-18
编辑:Guillaume 2018-6-18
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 个评论
Fabian Krusa
Fabian Krusa 2020-10-13
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 2020-10-28
编辑:bryan linehan 2020-10-28
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Fortran with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by