Fortran compiler for M2 (Silicon) Apple processor

123 ビュー (過去 30 日間)
Johannes Raspe
Johannes Raspe 2023 年 9 月 18 日
コメント済み: Luca 2023 年 11 月 28 日
Hi all,
I am struggling to set up a Fortran compiler in MATLAB on my MacBook with Apple M2 (Silicon) processor. Specifically, I want to install and run the package from https://github.com/JoepVanlier/mexNL2SOL which requires a Fortran compiler. I installed the gfortran compiler using
homebrew gcc
though I am unsure whether this one is compatible with MATLAB as listed on https://de.mathworks.com/support/requirements/supported-compilers-mac.html. Other entries in the forums like https://de.mathworks.com/matlabcentral/answers/1926670-fortran-compiler-for-r2022b?s_tid=prof_contriblnk did also not help me as they do not work on my machine. Running
>> mex -install FORTRAN
Error using mex
Supported compiler not detected. For options, visit
https://www.mathworks.com/support/compilers.
causes a similar error message as described in the linked forum discussion.
Can anybody help me to set this up properly? In contrast, a C compiler is recognized by MATLAB with Xcode14.
Thank you for your input!

回答 (1 件)

Mike Croucher
Mike Croucher 2023 年 9 月 18 日
編集済み: Mike Croucher 2023 年 9 月 18 日
The supported Fortran Compiler for Apple Silicon in R2023b is the NAG Fortran Compiler. gfortran is not supported I'm afraid. This is described at Compatible Mac Compilers - MATLAB & Simulink (mathworks.com)
A trial of the NAG Fortran compiler can be obtained from Getting Started with the NAG® Fortran Compiler | nag
  12 件のコメント
Alexandre RUBESAM
Alexandre RUBESAM 2023 年 11 月 28 日
Hi Luca, yes it’s valid only for 30 days. Could I ask what you’re trying to compile in the off-chance that we have the same issue?
Luca
Luca 2023 年 11 月 28 日
Thanks for the answer @Alexandre RUBESAM. I'm interested in compiling AGMG (an aggregation-based algebraic multigrid method to solve linear systems). Here more details: https://agmg.eu/.
I have an academic licence.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by