mex -setup cannot find ifort on Mac
Show older comments
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 Comment
dpb
on 27 Dec 2021
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?
Accepted Answer
More Answers (1)
Anshika Chourasia
on 31 Dec 2021
0 votes
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.
Categories
Find more on Fortran with MATLAB 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!