<div>The main error that pops out is that 'g++', the compiler used to compile the C++ code, was not found.</div><div><br></div><div>Best guess: Rtools isn't in your PATH. I believe the Windows Rtools installer automatically adds itself to your system PATH, so if you just installed with default settings you'd be fine there. If not, you're going to have to change your PATH to point to both Rtools and the gcc installation subdir in Rtools. You might consider using something like RStudio as well, since it'll do some magic behind the scenes to ensure Rtools is found and called whenever compiling code.</div>
<div><br></div><div>Other potential problem: you have R installed in 'C:/Program Files', and that space in the path can potentially cause problems. You might consider reinstalling R in a directory with no spaces. Frustrating and silly, I know :P</div>
<div><br></div><div>Hope it helps,</div><div><br></div><div>-Kevin</div><div><br><div class="gmail_quote">On Mon, Jan 28, 2013 at 3:23 PM, Aileen Lin <span dir="ltr"><<a href="mailto:aileenshanhong.lin@gmail.com" target="_blank">aileenshanhong.lin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Hi there,</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">I am trying the package of RcppArmadillo. This is the code I copied from your website. I am not sure what went wrong.</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
> suppressMessages(require(inline))</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">> code <- '</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
+ arma::mat coeff = Rcpp::as<arma::mat>(a);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+ arma::mat errors = Rcpp::as<arma::mat>(e);</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+ int m = errors.n_rows; int n = errors.n_cols;</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
+ arma::mat simdata(m,n);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+ simdata.row(0) = arma::zeros<arma::mat>(1,n);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
+ for (int row=1; row<m; row++) {</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+ simdata.row(row) = simdata.row(row-1)*trans(coeff)+errors.row(row);</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+ }</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
+ return Rcpp::wrap(simdata);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+ '</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
> ## create the compiled function</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">> rcppSim <- cxxfunction(signature(a="numeric",e="numeric"),</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+ code,plugin="RcppArmadillo")</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
"tty" option detected in CYGWIN environment variable.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">CYGWIN=tty is no longer supported. Please remove it from your</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">CYGWIN environment variable and use a terminal emulator like mintty,</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
xterm, or rxvt.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">cygwin warning:</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> CYGWIN environment variable option "nodosfilewarning" turns off this warning.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Consult the user's guide for more details about POSIX paths:</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> <a href="http://cygwin.com/cygwin-ug-net/using.html#using-pathnames" style="color:rgb(17,85,204)" target="_blank">http://cygwin.com/cygwin-ug-net/using.html#using-pathnames</a></div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">/usr/bin/sh: g++: command not found</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
make: *** [filee245f631629.o] Error 127</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
ERROR(s) during compilation: source code errors or compiler configuration errors!</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Program source:</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 1: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
2: // includes from the plugin</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 3: #include <RcppArmadillo.h></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
4: #include <Rcpp.h></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 5: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
6: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 7: #ifndef BEGIN_RCPP</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
8: #define BEGIN_RCPP</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 9: #endif</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
10: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 11: #ifndef END_RCPP</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
12: #define END_RCPP</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 13: #endif</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
14: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 15: using namespace Rcpp;</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
16: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 17: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
18: // user includes</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 19: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
20: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 21: // declarations</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
22: extern "C" {</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 23: SEXP filee245f631629( SEXP a, SEXP e) ;</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
24: }</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 25: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
26: // definition</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 27: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
28: SEXP filee245f631629( SEXP a, SEXP e ){</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 29: BEGIN_RCPP</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
30: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 31: arma::mat coeff = Rcpp::as<arma::mat>(a);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
32: arma::mat errors = Rcpp::as<arma::mat>(e);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 33: int m = errors.n_rows; int n = errors.n_cols;</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 34: arma::mat simdata(m,n);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
35: simdata.row(0) = arma::zeros<arma::mat>(1,n);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 36: for (int row=1; row<m; row++) {</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 37: simdata.row(row) = simdata.row(row-1)*trans(coeff)+errors.row(row);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
38: }</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 39: return Rcpp::wrap(simdata);</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
40: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 41: END_RCPP</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
42: }</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> 43: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
44: </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Error in compileCode(f, code, language = language, verbose = verbose) : </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Compilation ERROR, function(s)/method(s) not created! "tty" option detected in CYGWIN environment variable.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
CYGWIN=tty is no longer supported. Please remove it from your</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">CYGWIN environment variable and use a terminal emulator like mintty,</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">xterm, or rxvt.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
cygwin warning:</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> CYGWIN environment variable option "nodosfilewarning" turns off this warning.</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> Consult the user's guide for more details about POSIX paths:</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<a href="http://cygwin.com/cygwin-ug-net/using.html#using-pathnames" style="color:rgb(17,85,204)" target="_blank">http://cygwin.com/cygwin-ug-net/using.html#using-pathnames</a></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
/usr/bin/sh: g++: command not found</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">make: *** [filee245f631629.o] Error 127</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">My inline package is 0.3.10, RcppArmadillo is 0.3.6.1, Rcpp is 0.10.2. I also installed Rtools216.exe. Please let me know what I did wrongly. Thank you.</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br></div><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Regards,</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Aileen L.</span>
<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></div>