$ export PKG_CPPFLAGS=`Rscript -e 'Rcpp:::CxxFlags()'`
$ export PKG_LIBS=`Rscript -e 'Rcpp:::LdFlags()'`
$ R CMD SHLIB my.cpp
g++ -I/usr/share/R/include -DNDEBUG -I/usr/local/lib/R/site-library/Rcpp/include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c my.cpp -o my.o
my.cpp:3:27: fatal error: RcppArmadillo.h: No such file or directory
compilation terminated.
make: *** [my.o] Error 1
My RcppArmadillo.his under
$ locate -i RcppArmadillo.h
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadillo.h
I wonder how to indicate your path to the compiler?
my.cpp as follows:
#include <RcppArmadillo.h>
#include <math.h>
using namespace Rcpp;
using namespace arma;
...
My OS is Ubuntu 12.04. R is R version 3.1.0 (2014-04-10). I just installed Rcppand RcppArmadillo, therefore, I think they are also the last.
Thank you and welcome!
source
share