[Rcpp-devel] an error message from RcppArmadillo
Kevin Ushey
kevinushey at gmail.com
Tue Jan 29 00:34:54 CET 2013
The main error that pops out is that 'g++', the compiler used to compile
the C++ code, was not found.
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.
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
Hope it helps,
-Kevin
On Mon, Jan 28, 2013 at 3:23 PM, Aileen Lin <aileenshanhong.lin at gmail.com>wrote:
> Hi there,
>
> I am trying the package of RcppArmadillo. This is the code I copied from
> your website. I am not sure what went wrong.
>
> > suppressMessages(require(inline))
> > code <- '
> + arma::mat coeff = Rcpp::as<arma::mat>(a);
> + arma::mat errors = Rcpp::as<arma::mat>(e);
> + int m = errors.n_rows; int n = errors.n_cols;
> + arma::mat simdata(m,n);
> + simdata.row(0) = arma::zeros<arma::mat>(1,n);
> + for (int row=1; row<m; row++) {
> + simdata.row(row) = simdata.row(row-1)*trans(coeff)+errors.row(row);
> + }
> + return Rcpp::wrap(simdata);
> + '
> > ## create the compiled function
> > rcppSim <- cxxfunction(signature(a="numeric",e="numeric"),
> + code,plugin="RcppArmadillo")
> "tty" option detected in CYGWIN environment variable.
> CYGWIN=tty is no longer supported. Please remove it from your
> CYGWIN environment variable and use a terminal emulator like mintty,
> xterm, or rxvt.
> cygwin warning:
> MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf
> Preferred POSIX equivalent is:
> /cygdrive/c/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf
> CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
> Consult the user's guide for more details about POSIX paths:
> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> /usr/bin/sh: g++: command not found
> make: *** [filee245f631629.o] Error 127
>
> ERROR(s) during compilation: source code errors or compiler configuration
> errors!
>
> Program source:
> 1:
> 2: // includes from the plugin
> 3: #include <RcppArmadillo.h>
> 4: #include <Rcpp.h>
> 5:
> 6:
> 7: #ifndef BEGIN_RCPP
> 8: #define BEGIN_RCPP
> 9: #endif
> 10:
> 11: #ifndef END_RCPP
> 12: #define END_RCPP
> 13: #endif
> 14:
> 15: using namespace Rcpp;
> 16:
> 17:
> 18: // user includes
> 19:
> 20:
> 21: // declarations
> 22: extern "C" {
> 23: SEXP filee245f631629( SEXP a, SEXP e) ;
> 24: }
> 25:
> 26: // definition
> 27:
> 28: SEXP filee245f631629( SEXP a, SEXP e ){
> 29: BEGIN_RCPP
> 30:
> 31: arma::mat coeff = Rcpp::as<arma::mat>(a);
> 32: arma::mat errors = Rcpp::as<arma::mat>(e);
> 33: int m = errors.n_rows; int n = errors.n_cols;
> 34: arma::mat simdata(m,n);
> 35: simdata.row(0) = arma::zeros<arma::mat>(1,n);
> 36: for (int row=1; row<m; row++) {
> 37: simdata.row(row) =
> simdata.row(row-1)*trans(coeff)+errors.row(row);
> 38: }
> 39: return Rcpp::wrap(simdata);
> 40:
> 41: END_RCPP
> 42: }
> 43:
> 44:
> Error in compileCode(f, code, language = language, verbose = verbose) :
> Compilation ERROR, function(s)/method(s) not created! "tty" option
> detected in CYGWIN environment variable.
> CYGWIN=tty is no longer supported. Please remove it from your
> CYGWIN environment variable and use a terminal emulator like mintty,
> xterm, or rxvt.
> cygwin warning:
> MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf
> Preferred POSIX equivalent is:
> /cygdrive/c/PROGRA~1/R/R-215~1.2/etc/i386/Makeconf
> CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
> Consult the user's guide for more details about POSIX paths:
> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> /usr/bin/sh: g++: command not found
> make: *** [filee245f631629.o] Error 127
>
> 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.
>
> Regards,
> Aileen L.
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130128/d20fb989/attachment.html>
More information about the Rcpp-devel
mailing list