The future of FORTRAN mex?
1 次查看(过去 30 天)
显示 更早的评论
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
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
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fortran with MATLAB 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!