I’m running R 4.2 on a windows 10 machine with rtools42 installed. I’ve seen that the version of rstan on CRAN is incompatible, and that I need to install the development version. The catch is that the machine running R is on an isolated network and cannot access github. I need to move everything over via external hard drive, so any solution that requires direct access to CRAN, github, etc. will not work.
I have successfully installed StanHeaders as follows:
- Download the rstan, math, and stan repositories from github as .zip files
- Move these files to the machine of interest and unzip them
- Move the package contents from the math and stan repositories into rstan-develop/StanHeaders/inst/include/[upstream or mathlib]
install.packages("path/to/rstan", type = 'source', repos = NULL, INSTALL_opts = '--preclean')
This was inspired by the install-github function included in the StanHeaders folder. I suspect I just manually did a few things that most would have let git2r take care of.
Now I need to actually install rstan. Unfortunately, I’m getting “compilation failed”/non-zero exist status messages and I’m not sure why. (If I need to copy some of the compiler output across machines I can, but it’s not quite as easy for me as it would be in normal situations.)
Running install.packages("./rstan", type = 'source', repos = NULL)
, I see
make: *** [C:/PROGRA~1/R/R-42~1.1/etc/x64/Makeconf:260: stan_fit.o] Error 1
Are there other packages that I need to provide the compiler access to in order to perform this install?
I’ve looked at install.R (hoping for a similar solution to what I did for StanHeaders).
I have BH 1.78.0-0, inline 0.3.19, and Rcpp 1.0.8.3 installed and I can compile other Rcpp functions without issue.
Although I’m aware it’s a solution, I’m not interested in downgrading R to 4.0.x - I’ve made the switch from %>% to |> so my code is no longer compatible with 4.0 and the package collection on this machine is all 4.2, not 4.0.