The future of FORTRAN mex?

3 次查看(过去 30 天)
Robert
Robert 2020-12-28
评论: Robert 2021-1-27
With Apple M1 now out, and hopefully future MATLAB releases will have native support. The next question is FORTRAN mex comiler support. Up to this point for both Windows and Mac, it was Intel only (though you could jump through hoops to get gfortran mex on the Mac). So MathWorks, coders want to know, what is next? How should we prepare? NAG has a native FORTRAN M1 version out, and there is some "betas" for gfotran for M1. I doubt Intel will put out a compiler for Apple M1. Should we start porting FORTRAN mex code to C?
  1 个评论
dpb
dpb 2020-12-28
"Should we start porting FORTRAN mex code to C?"
Probably. TMW seems to have basically abandoned Fortran 10 years ago.
Combined with their incredibly arcane and absurd installation where they won't just give you the directions for compile/link steps,but try to force an "approved" compiler, I gave up entirely.
There's no excuse for such a nightmare; I had a legacy system to try to maintain, but they broke compatibility and then wouldn't let a .mex file load if the link wasn't with the specific version libraries even though there were no changes. Frustrating wasn't the word for the feelings I had...and support stock answer is "unsupported".
Then, too, trying to get them to tell you what may be in the future is futile as well.
Wish had better news...

请先登录,再进行评论。

回答(1 个)

Chris Rorden
Chris Rorden 2021-1-3
编辑:Chris Rorden 2021-1-5
An experimental build of the open source gFortran compiler is available for the M1
In my testing, it performs very well
A challenge for moving mathematical operations between architectures is how they handle not-a-number values. However, this will impact any compiler, Fortran or C. This is a reason that tools like R have been slow to convert:
The Fortran code in Matlab is robust and proven. Switching to C would not provide any performance benefit. The benefit of Fortran is well established, proven routines. The advantage of C is that it is more familiar to most contemporary programmers, which might help maintaining and extending code. However, conducting both a switch in architectures and a switch in languages at the same time seems to be a perilous choice. A better approach is to maintain the proven Fortran code for the new architecture, to help identify architecture specific issues.
  1 个评论
Robert
Robert 2021-1-27
I understand we will have Fortran for AppleSilicon, the question is will MATLAB support Fortran mex on m1. A heads up from Mathworks for time to prepare would be nice. For this reason I decided to upgrade my 2016 with the 2020 Intel 13" macbook pro with 32GB instead of the M1 and will wait and see.

请先登录,再进行评论。

类别

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