From andre_mikulec at hotmail.com  Mon Sep 15 23:25:49 2014
From: andre_mikulec at hotmail.com (Andre Mikulec)
Date: Mon, 15 Sep 2014 17:25:49 -0400
Subject: [Rd] Debug an R  windows (Fortran) DLL within R with gdb?
Message-ID: <BLU174-W2834A37215473FEE12D3F39CC80@phx.gbl>


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


 		 	   		  


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