我需要为数据分析类安装Rstan.说明在http://code.google.com/p/stan/wiki/RStanGettingStarted上发布.我正在运行Mac OS 10.5.8和R 2.15.1 GUI 1.52 Leopard构建32位(6188).我刚安装了Xcode 3.1.4版,与leopard兼容的Xcode c ++编译器(我必须得到一个mac开发者帐户才能执行此操作).
根据Stan安装说明,我输入以下代码以查看我的编译器是否正常工作:
library(inline)
library(Rcpp)
src <- '
std::vector<std::string> s;
s.push_back("hello");
s.push_back("world");
return Rcpp::wrap(s);
'
hellofun <- cxxfunction(body = src, includes = '', plugin = 'Rcpp', verbose = FALSE)
cat(hellofun(), '\n')
Run Code Online (Sandbox Code Playgroud)
它返回以下错误:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
Library/Frameworks/R.framework/Versions/2.15/Resources/library/
Rcpp/include/Rcpp/internal/export.h: In function ‘void
Rcpp::internal::export_range__dispatch(SEXPREC*, InputIterator,
Rcpp::traits::r_type_primitive_tag)’:
/Library/Frameworks/R.framework/Versions/2.15/Resources/
library/Rcpp/include/Rcpp/internal/export.h:56: internal
compiler error: Bus error
Please submit a full bug report,
with …Run Code Online (Sandbox Code Playgroud)