<div dir="ltr">Ranaud,<div><br></div><div>RcppOctave can now be installed and used under Mac OS X Mavericks</div><div>like this:</div><div><br></div><div>$ R CMD INSTALL RcppOctave --no-test-load</div><div>$ R</div><div>> library(RcppOctave)</div>
<div>> .O$version()</div><div>...</div><div>> .Call('octave_end')</div><div>> q("no")</div><div><br></div><div>The --no-test-load option is used because the embedded Octave session</div><div>is not terminated properly at test time (during installation), and the </div>
<div>embedded Octave session needs to be explicitly terminated before </div><div>leaving the R session using the 'octave_end' entry point.</div><div><br></div><div>Some cosmetic changes will need to be made so that everything</div>
<div>happens automatically before a CRAN submission.</div><div><br></div><div>Dominick</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 1, 2013 at 4:11 AM, Renaud Gaujoux <span dir="ltr"><<a href="mailto:renaud@mancala.cbio.uct.ac.za" target="_blank">renaud@mancala.cbio.uct.ac.za</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>What type of R installation did you test this procedure with?<br></div>Ideally this would work with the plain CRAN binary, modulo adapting ~/.R/Makevars.<br>
<div><div><br><br><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>As you probably know, the last line of embedded.cc (attached)</div><div>is very important. Without it there is still a memory error!</div>
<div><br></div></div></div><br></blockquote><div><br></div></div><div>I checked Octave source and clean_up_and_exit is a simple wrapper to do_octave_atexit, which I call directly to skip the call to exit, which would otherwise terminate the R session as well:<br>
<br></div><div>[from <a href="http://hg.savannah.gnu.org/hgweb/octave/file/eff3d78367f0/src/toplev.cc#l667" target="_blank">http://hg.savannah.gnu.org/hgweb/octave/file/eff3d78367f0/src/toplev.cc#l667</a>]<br><br></div><div>
void clean_up_and_exit (int retval)<br>
{<br> do_octave_atexit ();<br> if (octave_exit)<br> (*octave_exit) (retval == EOF ? 0 : retval);<br>}<br><br></div><div>Note that I actually don't know how to effectively terminate the Octave session. Don't know if this even possible since it currently runs in the same thread as R (that's at least my understanding). So even after cleaning up with do_octave_atexit(), we can still send commands to Octave which responds fine, except if errors occurs and then a segfault sometimes come up suggesting some thing is in a bad state. Anyway, this is not really a big issue.<br>
<br></div><div>library(RcppOctave)<br></div><div>o_runif(1)<br></div><div>octave_end()<br></div><div>o_runif(1)<br></div><br><div><br></div></div></div></div></div></div>
</blockquote></div><br></div>