我需要为数据分析类安装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<:string> s;
s.push_back("hello");
s.push_back("world");
return Rcpp::wrap(s);
'
hellofun
cat(hellofun(), '\n')
它返回以下错误:
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 preprocessed source if appropriate.
See for
instructions.
make: *** [file795214e66510.o] Error 1
In addition: Warning message:
running command '/Library/Frameworks/R.framework/Resources/bin/
R CMD SHLIB file795214e66510.cpp 2>
file795214e66510.cpp.err.txt' had status 1
当我尝试安装stan时:
install.packages('rstan', type = 'source') ]
我收到这个警告:
警告信息:
在install.packages(“rstan”,type =“source”)中:
包’rstan’的安装具有非零退出状态
我不知道C是如何工作的.我的所有编码经验都在R中,并且之前没有要求编译成C语言.我一直在努力弄清楚过去4个小时左右出了什么问题,一遍又一遍地搜索这些错误信息而没有太多运气.任何帮助将不胜感激,也将帮助我班上其他10个有相同或类似问题的学生.非常非常感谢你.
解决方法:
这看起来像是安装C编译器或安装Rcpp软件包的问题,而不是rstan软件包的问题.但是,如果g给你带来了一个棘手的问题,那么另一个是clang编译器,如果用这两行创建$HOME / .R / Makevars,它应该与Rcpp和rstan一起使用
CC =铛
CXX =铛
标签:stan,c,r,xcode,compiler-construction
来源: https://codeday.me/bug/20190729/1570978.html
在MacOS 10.5.8上,用户遇到在R环境中安装数据分析包RStan的问题。他们已经安装了Xcode 3.1.4和对应的编译器,但尝试检查编译器是否正常工作时遇到了错误。用户输入的代码导致了编译错误,提示内部编译器错误和Bus error。同时,尝试通过R的`install.packages()`安装rstan包时也收到了非零退出状态的警告。用户对于C编译器不熟悉,寻求解决方案。
358

被折叠的 条评论
为什么被折叠?



