[R] Profiling a C/C++ library from R

Martin Morgan mtmorgan at fredhutch.org
Wed Dec 3 00:02:24 CET 2014


On 12/02/2014 01:43 PM, Charles Novaes de Santana wrote:
> Dear all,
>
> I am running a c++ library (a .so file) from a R code. I am using the
> function dyn.load("lib.so") to load the library. Do you know a way to
> profile my C library from R? Or should I compile my C library as an
> executable and profile it using the typical C-profilers?
>
> Thanks in advance for any help!

Hi Charles

Section 3.4 of RShowDoc("R-exts") discusses some options; I've had luck with 
operf & friends. Remember to compile without optimizations and with debugging 
information -ggdb -O0.

(I think this is appropriate for the R-devel mailing list 
http://www.r-project.org/posting-guide.html#which_list)

Martin Morgan

>
> Best,
>
> Charles
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the R-help mailing list