fighting with sprof

$ export LD_PROFILE_OUTPUT=/tmp/oout
$ export LD_PROFILE=`pwd`/Amelia.so

$ mkdir -p /tmp/oout//home/pauljohn/R/x86_64-pc-linux-gnu-library/2.15/Amelia/libs/

$ env | grep LD
OLDPWD=/home/pauljohn/R/x86_64-pc-linux-gnu-library/2.15/Amelia
LD_LIBRARY_PATH=/home/pauljohn/R/x86_64-pc-linux-gnu-library/2.15/Amelia/libs
LD_PROFILE=/home/pauljohn/R/x86_64-pc-linux-gnu-library/2.15/Amelia/libs/Amelia.so
LD_PROFILE_OUTPUT=/tmp/oout

After that

$ R -f testfile.R

If there is trouble, it looks like this:

> library(Amelia)
Loading required package: foreign
Loading required package: Rcpp
Loading required package: RcppArmadillo
/tmp/oout//home/pauljohn/R/x86_64-pc-linux-gnu-library/2.15/Amelia/libs/Amelia.so.profile: cannot open file: Error 21
##
## Amelia II: Multiple Imputation

Make sure “Amelia.so.profile” does not already exist in that directory.

After that, run again, Amelia.so.profile is created, but on Debian it all ends in blotto

$ sprof ~/R/x86_64-pc-linux-gnu-library/2.15/Amelia/libs/Amelia.so /tmp/oout/home/pauljohn/R/x86_64-pc-linux-gnu-library/2.15/Amelia/libs/Amelia.so.profile
Inconsistency detected by ld.so: dl-open.c: 690: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT’ failed!

That’s supposed to be a flaw in glibc that has existed for a long time. Crum.

People say ‘switch to oprofile’ which is not available for Debian yet in newest version. Have compiled 0.9.8 and am testing.

============

Humphf. Apparently, I was here at this same point in 2009. The email list r-sig-debian in June 30, 2009, has several questions by me about the same problem. And an effort to use the Google profile tool instead.

https://stat.ethz.ch/pipermail/r-sig-debian/2009-June/000795.html

There’s a good chance I will learn a different mistake, write it down here, and completely forget about it. gloomy, that.
There

About pauljohn

Paul E. Johnson is a Professor of Political Science at the University of Kansas. He is an avid Linux User, an adequate system administrator and C programmer, and humility is one of his greatest strengths.
This entry was posted in R and tagged , . Bookmark the permalink.