how to mex free fortran 90 format with the last matlab release
9 次查看(过去 30 天)
显示 更早的评论
Hi every on.
It seems that by default fixed format is expected even with the file extension f90 or F90.
How to change the setting /fixed which is probably within a config file. There is no more mexopts.bat file!?
I am running R2023a release using the last intel fortran compiler. No problem with fortran 77 files and their mex gateway.
I have probably missed something but it is very strange that fortran 90 95 ... were not recognized by default.
Within mathworks doc I have not found any exemple with a such fortran code (only the same f77 code like timestwo yprime since several tens of years)
Best regards
Alain
0 个评论
采纳的回答
dpb
2023-10-1
编辑:dpb
2023-10-1
" ... but it is very strange that fortran 90 95 ... were not recognized by default."
Oh, indeed! Add your complaint to official Mathworks support about the abominable Fortran support that is some 40+ years out of date!!! :(
To fix that problem, find the .xml file for the particular compiler release you have installed. They will be under the root MATLAB install directory under /bin/win64/mexopts.
Then remove the stupid "/fixed" switch.
There will be a line like the following in the file...that's where the problem lies -- why Mathworks can't get into at least this century is beyond ken.
COMPFLAGS="/nologo /fpp /Qprec /fixed /MD /fp:source /assume:bscc $INCLUDE $COMPDEFINES"
There's also an issue with default naming -- be sure to use the lowercase 'f' in the file names so the fortran preprocessor will run to expand the macros TMW uses for type definitions (which also still are the nonStandard and archaic REAL*N form)
10 个评论
dpb
2023-10-5
Agreed, that's how the -setup option works with the xml files -- my problem is I have a newer version of the Intel compiler than that which the present version of MATLAB supports and I haven't been able to manage to create a new one that works to find that version...and I don't want to switch horses in midstream of some other work on upgrading MATLAB just now and so far I've not been able to figure out how to get to the earlier Intel compiler download.
更多回答(0 个)
另请参阅
类别
在 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!