Comments and questions about building packages with rstantools

Yeah, thanks for tagging me.

@dbarneche Sorry for the slow reply. I hadn’t noticed this post. I’ll try to answer your questions, but first let me say that fishflux is a great package name!

Yes to gitignore. I think that should happen now after Add generated C++ files to .gitignore and .Rbuildignore by mcol · Pull Request #66 · stan-dev/rstantools · GitHub from last month. Although I guess if you add your Stan programs after using rstan_create_package() it might not automatically gitignore the compiled files. We’ll look into that.

Good question. You’re only half wrong ;) The intention was to allow users that download your package from CRAN to have a compiler-free experience. Unfortunately install_github() has to install a package from source which means compiling everything. But once your package gets on CRAN users will be able to install the pre-compiled version, so when they do install.packages("fishflux") nothing will need to get compiled. Does that make sense? If you want to enable people to install a pre-compiled version from GitHub you could look into making binary versions of your package available on GitHub using drat.

Yeah this was our fault, but will just be temporary. There was a problem with the interaction between StanHeaders and rstantools that we didn’t anticipate and CRAN had to revert rstantools back to 2.0.0.

Hmm, the tbb library is used by Stan but I’m not sure why anything would have changed between versions of rstantools. @wds15 @bgoodri Any ideas about this?

3 Likes