Stan & R 4.2 on Windows

The problem with RStan + R4.2 on Windows is due to unrespecting LOCAL_LIBS environment variable. As a workaround, after a failed compilation where LOCAL_LIBS is set correctly but not used:

Sys.setenv(PKG_LIBS = Sys.getenv("LOCAL_LIBS"))

Alternatively, you may add/create the required RStan plugin flags into file.path(Sys.getenv("HOME"), ".R", "Makevars.win").

This has been fixed in the development version of RStan by `rstan`: `plugin`: Fix environment variables · stan-dev/rstan@4d78f1d · GitHub.

4 Likes