I tried the example of sourceCpp on Mac mountain lion with R 2.15.1 with the following error (I hit the similar error in using RStan as well).
library(Rcpp)
require(Rcpp)
sourceCpp(code='
+ #include <Rcpp.h>
+
+ // [[Rcpp::export]]
+ int fibonacci(const int x) {
+ if (x == 0) return(0);
+ if (x == 1) return(1);
+ return (fibonacci(x - 1)) + fibonacci(x - 2);
+ }'
+ , verbose = TRUE)
Generated Rcpp module declaration:
--------------------------------------------------------
RCPP_MODULE(sourceCpp_72196) {
Rcpp::function("fibonacci", &fibonacci,
Rcpp::List::create(Rcpp::Named("x")));
}
Building shared library
--------------------------------------------------------
DIR: /var/folders/vs/tzgx0z_s0zvgg15pw84b93km0000gn/T//RtmpuSV7dx/sourcecpp_12a13a02b8d4
Error in tools:::file_path_as_absolute(base:::system.file(..., package
= "Rcpp")) :
file '' does not exist
sessionInfo()
R version 2.15.1 (2012-06-22) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] tools stats graphics grDevices utils datasets methods base other attached packages: [1] Rcpp_0.10.0 === Another place: Error in tools:::file_path_as_absolute(base:::system.file(..., package = "Rcpp")) : file '' does not exist Calls: stan_model ... <Anonymous> -> RcppLdPath -> Rcpp.system.file -> <Anonymous> Execution halted -- Jiqiang