首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行map2stan函数错误127

运行map2stan函数错误127
EN

Stack Overflow用户
提问于 2017-07-20 01:15:20
回答 1查看 317关注 0票数 0

我安装了rstan,当我调用map2stan时,我得到以下错误:

代码语言:javascript
复制
> library(rstan)
>  packageVersion("rstan",    lib.loc =    "C://TOOLS//R-3.4.0patched//library"   )
[1] ‘2.16.2’

下面是对map2stan的调用

代码语言:javascript
复制
library(rethinking)
 data(rugged)
 d <- rugged
 d$log_gdp <- log(d$rgdppc_2000)
 dd <- d[ complete.cases(d$rgdppc_2000) , ]
 dd.trim <- dd[ , c("log_gdp","rugged","cont_africa") ] 
 str(dd.trim)

 m8.1stan <- map2stan( 
                       alist(
                         log_gdp ~ dnorm( mu , sigma ) ,
                         mu <- a + bR*rugged + bA*cont_africa + bAR*rugged*cont_africa ,
                         a ~ dnorm(0,100),
                         bR ~ dnorm(0,10),
                         bA ~ dnorm(0,10),
                         bAR ~ dnorm(0,10),
                         sigma ~ dcauchy(0,2)
                       ) ,
                       data=dd.trim )

错误是这样的

代码语言:javascript
复制
Warning message:
running command 'make -f "C:/TOOLS/R-34~1.0PA/etc/x64/Makeconf" -f "C:/TOOLS/R-34~1.0PA/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file29cc72047709.dll" WIN=64 TCLBIN=64 OBJECTS="file29cc72047709.o"' had status 127 

ERROR(s) during compilation: source code errors or compiler configuration errors!

Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! Warning message:
running command 'make -f "C:/TOOLS/R-34~1.0PA/etc/x64/Makeconf" -f "C:/TOOLS/R-34~1.0PA/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file344416f9304.dll" WIN=64 TCLBIN=64 OBJECTS="file344416f9304.o"' had status 127 
In addition: Warning message:
running command 'C:/TOOLS/R-34~1.0PA/bin/x64/R CMD SHLIB file344416f9304.cpp 2> file344416f9304.cpp.err.txt' had status 1 
Error in map2stan(alist(log_gdp ~ dnorm(mu, sigma), mu <- a + bR * rugged +  : 
  Something went wrong, when calling Stan. Check any debug messages for clues, detective.
Compilation ERROR, function(s)/method(s) not created! Warning message:
running command 'make -f "C:/TOOLS/R-34~1.0PA/etc/x64/Makeconf" -f "C:/TOOLS/R-34~1.0PA/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file344416f9304.dll" WIN=64 TCLBIN=64 OBJECTS="file344416f9304.o"' had status 127 
>  
EN

回答 1

Stack Overflow用户

发布于 2017-07-24 04:31:27

嗯,我通过http://xcelab.net/rm/software/ (它不在CRAN上)安装了rethinking库,并且运行了相同的代码,在我的例子中没有得到任何错误。Rtools、R和OS类型/版本是什么?你是否遵循了所有的安装说明,例如,如果你的操作系统是Windows,在https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows上?你能检查一下他们在https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started中的八个学校的例子运行得很好吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45197043

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档