how to mex free fortran 90 format with the last matlab release
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alain Barraud
el 1 de Oct. de 2023
Comentada: dpb
el 5 de Oct. de 2023
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 comentarios
Respuesta aceptada
dpb
el 1 de Oct. de 2023
Editada: dpb
el 1 de Oct. de 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 comentarios
dpb
el 5 de Oct. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Fortran with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!