cmdstanr
cmdstanr copied to clipboard
Add option for linking and executing models through R/Rcpp to avoid admin issues with executables
As discussed in #815 and many other issues and forum posts, users in organisations aren't able to use cmdstanr (or at least not without some difficulty) due to organisational restrictions in running arbitrary executables.
To avoid this, we could add an option to instead execute the model via Rcpp - by linking the compiled object file as an R-compatible DLL via R CMD SHLIB. This is essentially how rstan models are executed.
Much of the minutiae in platform-specific handling for this will be covered in #894, the main complexity will come from plumbing it into the $sample()/$optimize()/etc methods
Not to be a member of the peanut gallery, but wouldn't that mean this package basically has to maintain both something at the level of complexity of rstan and an interface for cmdstan?
Not to be a member of the peanut gallery, but wouldn't that mean this package basically has to maintain both something at the level of complexity of rstan and an interface for cmdstan?
No, it's just linking the existing model object to an Rcpp function which calls cmdstan::command, you can see an example of this kind of function on this StanEstimators branch.
The rstan approach is to completely reimplement cmdstan in R