File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -470,6 +470,24 @@ CmdStanR can of course be used for developing other packages that require compil
470470and running Stan models as well as using new or custom Stan features available
471471through CmdStan.
472472
473+ ### Pre-compiled Stan models in R packages
474+
475+ You may compile a Stan model at runtime (e.g. just before sampling),
476+ or you may compile all the models inside the package file system in advance at installation time.
477+ The latter avoids compilations at runtime, which matters in centrally managed R installations
478+ where users should not compile their own software.
479+
480+ To pre-compile all the models in a package,
481+ you may create top-level scripts ` configure ` and ` configure.win `
482+ which run ` cmdstan_model() ` with ` compile = TRUE ` and save the compiled executables
483+ somewhere inside the ` inst/ ` folder of the package source.
484+ The [ ` instantiate ` ] ( https://wlandau.github.io/instantiate/ ) package helps developers
485+ configure packages this way,
486+ and it documents other topics such as submitting to CRAN and administering CmdStan.
487+ Kevin Ushey's [ ` configure ` ] ( https://github.com/kevinushey/configure ) package helps
488+ create and manage package configuration files in general.
489+
490+
473491### Troubleshooting and debugging
474492
475493When developing or testing new features it might be useful to have more
You can’t perform that action at this time.
0 commit comments