Skip to content
Prev 2331 / 10988 Next

[Rcpp-devel] R CMD BATCH - segfault (was: Create and access several instances of a C++ class from R)

On Mon, May 23, 2011 at 3:00 AM,
<rcpp-devel-request at r-forge.wu-wien.ac.at> wrote:
If I understand correctly, when Douglas says "save the worksheet" he's
referring to save.image(), which by default is the equivalent of what
happens with quit(save="yes"), which is also equivalent to running R
in BATCH mode without the --no-save argument.

So, Douglas's comment is that saving the entire workspace can be
unsafe no matter how much cleaning up you do.  I *think* a safe
alternate to save.image() is to use a save() command to save specific,
***R/SEXP-only*** objects that are the results of your computation.

I realize this doesn't entirely answer your question about rebuilding
your C++ objects between sessions, e.g. between quit(save='no').  But,
if you can do all of your computations is one session, you should be
able to save the (R/SEXP only) results to an .RData file ala:
save(list.of.results.with.no.reference.to.modules, file='BATCH-results.RData)

hope that clarifies things a bit,
-Christian