how to mex free fortran 90 format with the last matlab release
13 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
dpb
on 1 Oct 2023
Edited: dpb
on 1 Oct 2023
" ... 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 Comments
dpb
on 5 Oct 2023
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.
More Answers (0)
See Also
Categories
Find more on Fortran with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!