Darren,<div><br></div><div>I did create the R instance in main(), and pass the reference to another function. I do have 1000 CPUs calling that function, but as they don't create new R reference, how come there are so many warning messages?   </div>
<div><br></div><div>After reading your message in another thread of yours, I realize that the troublesome part might be that the R reference is passed to a function that many other CPUs call. what should I do to fix it? if I let each cpu creates its own instance of R, will that end up with more warning messages?  <br>
<br><br><div class="gmail_quote">On Sat, Feb 11, 2012 at 8:34 PM, Darren Cook <span dir="ltr"><<a href="mailto:darren@dcook.org">darren@dcook.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> I am calling a R function through Rcpp and RInside in my c++ program<br>
> in Linux. There are a lot of warning messages saying "no graphics<br>
</div>> system to unregister" ...Is there anyone who knows the reason and how<br>
<div class="im">> to avoid the printing of such warning messages?<br>
<br>
</div>Generally, once you track down the line causing the problem,<br>
suppressWarnings() (an R function) might help. Or<br>
suppressPackageStartupMessages() or suppressMessages() may help.<br>
<br>
For the cause, are you running on a machine with no GUI or X server?<br>
<br>
However, a google suggests this is a message related to shutting down R,<br>
and implies your script has corrupted something. There appears to be no<br>
fix as they, like Dirk, insisted on a reproducible example.<br>
<br>
I'm wondering why you would be starting up and shutting down R so many<br>
times in your script. Do you create one RInside instance, either as a<br>
global, or in main() and then pass it around by reference? Or are you<br>
create RInside instances inside other functions, or inside loop bodies?<br>
If the latter, can you refactor to do the former so you only have one<br>
instance?<br>
<br>
HTH,<br>
Darren<br>
<br>
<br>
--<br>
Darren Cook, Software Researcher/Developer<br>
<br>
<a href="http://dcook.org/work/" target="_blank">http://dcook.org/work/</a> (About me and my work)<br>
<a href="http://dcook.org/blogs.html" target="_blank">http://dcook.org/blogs.html</a> (My blogs and articles)<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Haiying Pang<br>
</div>