[R] (low level) profiling of code

Liaw, Andy andy_liaw at merck.com
Mon Jun 7 19:24:38 CEST 2004


Dear R-help,

Can some one tell me how to profile compiled code dynamically loaded into R?
Here's what I tried on our dual Opteron running SUSE Linux Enterprise Server
8 (GCC 3.3):

Start with R-patched dated 2004-06-07: 

(I also had MAIN_CFLAGS="-pg" in config.site.)

R is now configured for x86_64-unknown-linux-gnu

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                gcc  -O2 -g -pg -march=k8 -msse2 -m64
  C++ compiler:              g++  -O2 -g -pg -march=k8 -msse2 -m64
  Fortran compiler:          g77  -O2 -g -pg -march=k8 -msse2 -m64

  Interfaces supported:      X11, tcltk
  External libraries:        readline
  Additional capabilities:   PNG, JPEG
  Options enabled:           R profiling

  Recommended packages:      no

I then tried running 

  /path/to/R-patched/bin/R CMD BATCH -q -slave myscript.R

where inside myscript.R is call to R functions that calls .C().  However,
this does not produce the gmon.out file.  Can anyone tell me what I'm
missing?  Any help much appreciated!

Best,
Andy

Andy Liaw, PhD
Biometrics Research      PO Box 2000, RY33-300     
Merck Research Labs           Rahway, NJ 07065
andy_liaw (at) merck.com        732-594-0820




More information about the R-help mailing list