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 rstan_create_package
.
Our package is hosted here: https://github.com/nschiett/fishflux
Questions
-
Should we keep
.o
,.cc
,.cpp
, and.h
files undersrc/
on the package repo?rstantools
(viarstan_create_package
) doesn’t add those tosrc/
by default, andpkgbuild::compile_dll()
creates a bunch of those files based on the code ininst/stan
. However, when comparing our code with that ofrstanarm
, 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, perhapsrstantools
could add them automatically to.gitignore
? -
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 usingrstantools
was to have an entirely compiler-free package? Or did we make the make the wrong assumption?
Comments
-
At the moment,
rstantools
dependency needs to be set back to >= 2.0.0 on the DESCRIPTION file (the originalrstan_create_package
output 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
tbb
library on Mac and Linux to get R-CMD-Build and pkgdown GitHub Actions to pass.
https://github.com/nschiett/fishflux/blob/master/.github/workflows/R-CMD-check.yml
https://github.com/nschiett/fishflux/blob/master/.github/workflows/pkgdown.yaml
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?
Thanks heaps!