I can’t get Rstan working. It’s a Windows 11 PC, and I’ve downloaded R 4.4.2, RStudio 2024.09.1 Build 394, and Rtools44. Then, within RStudio, install.packages(“rstan”, repos = “https://cloud.r-project.org/”, dependencies = TRUE)
I’ve then tried:
example(stan_model, package = “rstan”, run.dontrun = TRUE)
This doesn’t work (see error message below).
I also attempted to verify toolchain is okay, by typing:
pkgbuild::check_build_tools(debug = TRUE)
Which returned:
Found in Rtools 4.4 installation folder
Your system is ready to build packages!
Operating System: Windows 11 home 24H2
Interface Version: RStan 2.32.2
Compiler/Toolkit: Er…I guess Rtools 4.4?
Error message from example(stan_model, package = “rstan”, run.dontrun = TRUE):
Error in compileCode(f, code, language = language, verbose = verbose) :
/Users/kiela/AppData/Local/R/win-library/4.4/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:22:0: required from ‘double stan::mcmc::dense_e_metric<Model, BaseRNG>::T(stan::mcmc::dense_e_point&) [with Model = model4a88429f1e9c__namespace::model4a88429f1e9c_; BaseRNG = boost::random::mixmax_engine<17, 36, 0>]’
C:/Users/kiela/AppData/Local/R/win-library/4.4/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:21:0: required from here
C:/Users/kiela/AppData/Local/R/win-library/4.4/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:654:74: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type’ {aka ‘__m128d’} [-Wignored-attributes]
654 | return internal::first_aligned<int(unpacket_traits::alignment),Derived>(m);
| ^~~~~~~~~
make: *** [C:/PROGRA~1/R/R-44~1.2/etc/x64/Makeconf:296: file4a883a3c6169.o
Error in sink(type = “output”) : invalid connection
I also tried this for diagnostics based on advice I saw somewhere via Google…
devtools::session_info(“rstan”)
Which returned:
─ Session info ────────────────────────────────────────────────────────────────────────
setting value
version R version 4.4.2 (2024-10-31 ucrt)
os Windows 11 x64 (build 26100)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United Kingdom.utf8
ctype English_United Kingdom.utf8
tz Europe/London
date 2024-12-01
rstudio 2024.09.1+394 Cranberry Hibiscus (desktop)
pandoc NA
restoring previous ‘C:/Users/kiela/AppData/Local/R/win-library/4.4/RcppParallel’
Warning in install.packages :
installation of package ‘RcppParallel’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\kiela\AppData\Local\Temp\RtmpEJyY7x\downloaded_packages’