MEX cannot find Fortran Compiler on macOS Monterey with MATLAB R2022a

11 views (last 30 days)
My mac is running MacOS 12.2.1, and I have Xcode 13.1, gfortran 10.2 installed. However, when I tried
>> mex('-v', '-setup', 'Fortran')
I got the following messages:
********
>> Verbose mode is on.
... Looking for compiler 'Intel Fortran Composer XE' ...
... Looking for environment variable 'ONEAPI_ROOT' ...No.
... Looking for environment variable 'ONEAPI_ROOT' ...No.
... Looking for environment variable 'IFORT_COMPILER21' ...No.
... 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'.
********
It seems MATLAB was looking for ifort rather than gfortran.
To Install Intel® Fortran Compiler Classic for Mac OS*, I downloaded the installer from https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#fortran
Then I tried to install ifort, however, it didn't work out. After the installation, typing ifort in my terminal command line still showed
$ command not found: ifort
and mex still didn't work.
I'm getting very negative about all these things now, would anybody help me with this?

Answers (0)

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!