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