Having trouble when testing my RStan configuration

I’m trying to setup Stan before the workshop at Calvin College next week but running into trouble.

Following the instructions on https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started, 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

Just install the binaries

install.packages("https://win-builder.r-project.org/yBy293t1c6Wo/StanHeaders_2.18.1-9.zip", repos = NULL)
install.packages("https://win-builder.r-project.org/1R86iN7B5NYq/rstan_2.19.1.zip", repos = NULL)
1 Like