My colleague, @nschiett and I wanted to share some of our comments and questions about developing a package based on rstantools, i.e. using the function
Our package is hosted here: https://github.com/nschiett/fishflux
Should we keep
src/on the package repo?
rstan_create_package) doesn’t add those to
src/by default, and
pkgbuild::compile_dll()creates a bunch of those files based on the code in
inst/stan. However, when comparing our code with that of
rstanarm, we notice that these file extensions are not present either. For that reason, we deliberately decided to remove them from the repo, also because adding them makes the package increasingly heavy to download from GitHub. Should they be kept in the repo, and if not, perhaps
rstantoolscould add them automatically to
Maybe this relates to the previous question, but is there a way to avoid pre-compilation during installation?
remotes::install_github("nschiett/fishflux")triggers pre-compilation, but we assumed the whole point of using
rstantoolswas to have an entirely compiler-free package? Or did we make the make the wrong assumption?
At the moment,
rstantoolsdependency needs to be set back to >= 2.0.0 on the DESCRIPTION file (the original
rstan_create_packageoutput states >= 2.0.1), at least until the newest version gets pushed to CRAN release. Our GitHub Actions to test package build and installation on multiple OS triggered errors using the default dependency on R devel version:
https://github.com/nschiett/fishflux/blob/master/DESCRIPTION (current version)
https://github.com/nschiett/fishflux/runs/776380492?check_suite_focus=true (example of error)
Building on this last comment, we also had to install the
tbblibrary on Mac and Linux to get R-CMD-Build and pkgdown GitHub Actions to pass.
This wasn’t needed on previous versions of rstantools, I think. Any ideas about what is causing this, and could this external dependency somehow be avoided in the future?