mex -setup cannot find ifort on Mac
显示 更早的评论
I'm using matlab R2020b and I have Intel® Parallel Studio XE Composer Edition for Fortran macOS* 2019 installed.
When I run the command
mex -setup -v Fortran
I get the following
Verbose mode is on.
... Looking for compiler 'Intel Fortran Composer XE' ...
... Looking for environment variable 'IFORT_COMPILER20' ...No.
... Looking for environment variable 'IFORT_COMPILER19' ...No.
... Looking for environment variable 'IFORT_COMPILER18' ...No.
... Executing command 'which ifort' ...No.
Did not find installed compiler 'Intel Fortran Composer XE'.
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.
If I run the command "which ifort" in my terminal, I get
/usr/local/bin/ifort
I don't understand why matlab doesn't find my ifort compiler. Any help is appreciated!
1 个评论
dpb
2021-12-27
It appears it's looking for specific versions -- with one of the specific environment variables above for a match and either the version installed isn't one of those or the "Composer XE" install didn't create the environment variable it should have.
The first message makes it look like it does know the Intel Fortran is installed; just a version mismatch in that you have an unsupported version. TMW is way overly persnickity in the way the setup works based on what they support and don't...
I don't have Mac nor Intel Fortran so can't poke around and see much here, what do you get if you run the compiler with it's -version flag for comparison, and what Intel Fortran environment variables do exist?
采纳的回答
更多回答(1 个)
Anshika Chourasia
2021-12-31
0 个投票
Hi Haomin,
The issue could be that MATLAB is not able to pick the FORTRAN compiler. Setting a environment variable should fix this issue. If you are using Intel FORTRAN 2020 set the environment variable ‘IFORT_COMPILER20’ to the original installation folder of the compiler.
Also, please note that the environment variable needs to be the actual installation folder and not a symbolic link for MATLAB R2020b.
类别
在 帮助中心 和 File Exchange 中查找有关 Fortran with MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!