I’m trying to setup Stan before the workshop at Calvin College next week but running into trouble.
Following the instructions on RStan Getting Started · stan-dev/rstan Wiki · GitHub, I’ve downloaded the packages and run the following code for the schools example. But I’m getting the earlier message at the bottom. Please help!
pkgbuild::has_build_tools(debug = TRUE)
[1] TRUE
library(“rstan”) # observe startup messages
options(mc.cores = parallel::detectCores())
rstan_options(auto_write = TRUE)
Sys.setenv(LOCAL_CPPFLAGS = ‘-march=native’)
#model ← stan_demo()
schools_dat ← list(J = 8,
-
y = c(28, 8, -3, 7, -1, 1, 18, 12),
-
sigma = c(15, 10, 16, 11, 9, 11, 10, 18))
fit ← stan(file = ‘8schools.stan’, data = schools_dat)
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) :
C++14 standard requested but CXX14 is not defined
Calls: → .shlib_internal
Execution halted
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘C:/PROGRA~1/R/R-36~1.0/bin/x64/R CMD SHLIB file14f84ac373fd.cpp 2> file14f84ac373fd.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection