Hi all,
I am trying to install CmdStanR on Windows 10. I have installed cmdstan via a Conda environment and can get the example model to compile but not sample. I am having very similar problems to here.
file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
# compile model
mod <- cmdstan_model(file) # this works fine!
# sampling
data_list <- list(N = 10, y = c(0,1,0,0,0,0,0,0,0,1))
fit <- mod$sample( # this does not!
  data = data_list, 
  seed = 123, 
  chains = 4, 
  parallel_chains = 4,
  refresh = 500
)
But this fails with the following error.
Running MCMC with 4 parallel chains...
Warning: Chain 1 finished unexpectedly!
Warning: Chain 2 finished unexpectedly!
Warning: Chain 3 finished unexpectedly!
Warning: Chain 4 finished unexpectedly!
Warning: Use read_cmdstan_csv() to read the results of the failed chains.
Warning messages:
1: All chains finished unexpectedly! Use the $output(chain_id) method for more information.
 
2: No chains finished successfully. Unable to retrieve the fit. 
Following the error messages I ran fit$output_files() but there were no csv files (i.e. the output read character(0). I thought maybe it had something to do with the parallel chains, but removing this option has no effect on the error message.
I have also tried
fit <- cmdstanr_example(chains = 1)
but this fails with a similar error.
Any ideas as to what could be the problem here? Thank you in advance.
My current R and system info below:
> cmdstan_path()
[1] "C:/Users/n9401849/Anaconda3/envs/stan/Library/bin/cmdstan"
> cmdstan_version()
[1] "2.30.1"
> Sys.info()
         sysname          release          version         nodename          machine 
       "Windows"         "10 x64"    "build 19044" "QUT-PA00146740"         "x86-64" 
           login             user   effective_user 
      "n9401849"       "n9401849"       "n9401849" 
> R.version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          4                           
minor          0.5                         
year           2021                        
month          03                          
day            31                          
svn rev        80133                       
language       R                           
version.string R version 4.0.5 (2021-03-31)
nickname       Shake and Throw
            