[Rd] Debug an R windows (Fortran) DLL within R with gdb?

Andre Mikulec andre_mikulec at hotmail.com
Mon Sep 15 23:25:49 CEST 2014


Hi, 
I have a Fortran 77 subroutine (dll).

On windows XP, how  would I 'debug it(Fortran) within R' using gdb?

This is how I made it.
----------------------

R CMD SHLIB main.f

gfortran -m32     -O3  -mtune=core2 -c main.f -o main.o

gcc -m32 -shared -s -static-libgcc -o main.dll tmp.def main.o -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -lgfortran -LF:/ProgramFiles/R/R-3.1.1/bin/i386 -lR


Here is the contents of the file  main.f
-----------------------------------------

      SUBROUTINE NGCD(NA, NB, NGCDO) 
        IA = NA
        IB = NB
    1   IF (IB.NE.0) THEN
          ITEMP = IA
          IA = IB
          IB = MOD(ITEMP, IB)
          GOTO 1
        END IF
        NGCDO = IA  
        RETURN
      END

Thank you,
Andre Mikulec
Andre_Mikulec at Hotmail.com


 		 	   		  


More information about the R-devel mailing list