Re: debugging fortran mex code



Greg Kaplan wrote:
hi -
my fortran program compiles to mex and then runs ok in matlab but now
i need to debug the actual fortran routine. because all of the input
is coming from values generated in matlab, i need to do it during run
time in matlab.
the tiny amount of info in the online documentation doesnt seem to be
working. how can i debug my fortran program by running the calling
program in matlab?

There may be more elegant methods to accomplish this but I just always use WRITE(*,*)"x=",x statements to inspect my variables in Fortran code. Works for following the program flow also.

also, how do i know if the %val(pointer) command is working for my
version of fortran. im just assuming that it is, but the
documentation doesnt tell me how to find out?

I faced this problem also a while ago. In my case I simply could not make %val to work so I figured it is not supported by compiler.

markus
.



Relevant Pages

  • debugging fortran mex code
    ... my fortran program compiles to mex and then runs ok in matlab but now ... i need to debug the actual fortran routine. ... the tiny amount of info in the online documentation doesnt seem to be ...
    (comp.soft-sys.matlab)
  • Re: help about ARPACK solver
    ... Fortran uses single precision variables by default. ... Fortran program, that is *single* precision. ... I still dont know what kind of criteria Matlab adopts to form ...
    (sci.math.num-analysis)
  • Re: mex in matlab from fortran
    ... I am having a fortran program which reads ... I tried to call the fortran from matlab using ... subroutine mexFunction ...
    (comp.soft-sys.matlab)
  • Re: How can I operate a fortran program with a matlab script
    ... I would like to write a matlab function that will change a value in the input text file, then run the .exe fortran program, and finally read in the output file. ... Calling a compiled Fortran-Mex does the signaling inerently: it is finished, ...
    (comp.soft-sys.matlab)
  • Re: How I can run Fortran in the matlab
    ... A Fortran 90 compiler should compile all Fortran 77 code. ... Are you thinking of translating your Fortran program into Matlab code? ... That's guaranteed to be far more difficult than getting it to compile with a Fortran 90 compiler. ...
    (comp.soft-sys.matlab)