[Rd] Profiling C functions called from R.

Pavel N. Krivitsky pavel at stat.washington.edu
Wed Mar 2 08:08:03 CET 2005


Hi,

Thank you for the reply. I think I've figured out the problem. In case
someone else might find this useful, the vanishing profile file turns
out to be the result of a semi-documented quirk (not in R). When using

LD_PROFILE=/$PATH_TO_LIB/$LIB_NAME.so R

the resulting $LIB_NAME.so.profile will be created
in /var/tmp/$PATH_TO_LIB/

_only_if_ /var/tmp/$PATH_TO_LIB/ already exists. If it doesn't, it'll
give an error message (that got buried in other output in my case) and
no profile will be created. If LD_PROFILE_OUTPUT is used to control
where the profile file goes:

export LD_PROFILE=/$PATH_TO_LIB/$LIB_NAME.so
export LD_PROFILE_OUPUT=/$PUT_PROFILE_HERE/
R
unset LD_PROFILE
unset LD_PROFILE_OUTPUT

then $LIB_NAME.so.profile will be created
in /$PUT_PROFILE_HERE/$PATH_TO_LIB/ again, only if the directory already
exists.

                             Thanks,
                             Pavel Krivitsky



More information about the R-devel mailing list