简体   繁体   中英

running map2stan function error 127

I installed rstan and when I call map2stan I get the error below:

> library(rstan)
>  packageVersion("rstan",    lib.loc =    "C://TOOLS//R-3.4.0patched//library"   )
[1] ‘2.16.2’

here's the call to map2stan

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 )

here's the error

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 
>  

Hmm, I installed rethinking library via http://xcelab.net/rm/software/ (it was not on CRAN) and ran the same code and didn't get any errors in my case. What's the Rtools, R, and OS type/version? Have you followed all installation instructions, eg if your OS is Windows, on https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows ? Can you check that their eight school example in https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started runs fine?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM