CDA Request: Debug Level-2 Fortran S-function
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 16 Jul. 2015
Beantwortet: MathWorks Support Team
am 16 Jul. 2015
I have a Level-2 FORTRAN S-Function that I would like to debug with Visual Studio. How can I do this?
Akzeptierte Antwort
MathWorks Support Team
am 16 Jul. 2015
Because a Level-2 FORTRAN S-Function contains both FORTRAN and C code, it is necessary to first MEX the FORTRAN source code into object files with debugging symbols, and then link the resulting objects with the runtime libraries for the FORTRAN compiler.
For example, given a FORTRAN source file foo.F and C source file bar.c, one could use the following MATLAB code to create the MEX file with debugging symbols:
mex -g -c foo.F
mex -g -L\[... path to runtime libraries ...]\ foo.obj bar.c
Once the debug MEX file has been created, you can start Visual Studio, set breakpoints in the source files where desired, attach MSVC to the current MATLAB process, and debug as you would for a C S-Function.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Fortran with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!