[Rcpp-devel] RcppArmadillo and the version of Rcpp

Romain Francois romain at r-enthusiasts.com
Fri Nov 8 08:18:39 CET 2013


Le 08/11/2013 08:14, Greg Distiller a écrit :
> Hi
>
> I hope its not inappropriate for me to post this as a follow up to my
> problems with getting RcppArmadillo to work. I tried to compile from
> source using R CMD INSTALL as Dirk suggested but am getting the error
> message below. I don’t know if this particular problem is related to a
> small issue I had getting Rcpp to work from within RStudio: for some
> reason RStudio was not seeing the correct system environment path and so
> could not find the compiler. I managed to resolve this by explicitly
> setting the path when I start RStudio using Sys.setenv(). The error I
> get when trying to install RcppArmadillo is as follows (specifically see
> the errors at the bottom):
>
> C:\Program Files\R\R-2.15.1\library>R CMD INSTALL RcppArmadillo*tar.gz

Bad idea to have R installed in a path with spaces.

> * installing to library 'C:/Program Files/R/R-2.15.1/library'
>
> * installing *source* package 'RcppArmadillo' ...
>
> ** package 'RcppArmadillo' successfully unpacked and MD5 sums checked
>
> ** libs
>
> *** arch - i386
>
> cygwin warning:
>
>    MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf
>
>    Preferred POSIX equivalent is:
> /cygdrive/c/PROGRA~1/R/R-215~1.1/etc/i386/Makec
>
> onf
>
>    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
>
> g++  -I"C:/PROGRA~1/R/R-215~1.1/include" -DNDEBUG -I../inst/include
> -I.   -I"C:/
>
> Program Files/R/R-2.15.1/library/Rcpp/include"      -O2 -Wall
> -mtune=core2 -c R
>
> cppArmadillo.cpp -o RcppArmadillo.o
>
> In file included from ../inst/include/RcppArmadillo.h:30:0,
>
>                   from RcppArmadillo.cpp:22:
>
> ../inst/include/RcppArmadilloForward.h:99:33: error:
> 'ConstReferenceInputParameter' is not a template
>
> ../inst/include/RcppArmadilloForward.h:100:33: error:
> 'ReferenceInputParameter' is not a template
>
> ../inst/include/RcppArmadilloForward.h:101:33: error:
> 'ConstInputParameter' is not a template

You likely need a newer Rcpp. Chances are you are using Rcpp < 0.10.5 
and the RcppArmadillo you are trying to compiler requires Rcpp >= 0.10.5

> make: *** [RcppArmadillo.o] Error 1
>
> ERROR: compilation failed for package 'RcppArmadillo'
>
> * removing 'C:/Program Files/R/R-2.15.1/library/RcppArmadillo'
>
> Any advice would be much appreciated.
>
> Thanks
>
> Greg



-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30



More information about the Rcpp-devel mailing list