Comments and questions about building packages with rstantools

Thank you! Your answer saves me lots of time from keeping digging in and makes me so sad.

2 Likes

Hi everyone,

I am building a R package (not yet on CRAN) which depends on rstan and was built with rstantools. Following this thread, I was wondering if there is currently an easy way (i.e. one or two lines of code) for people to install the package without the need to compile all the stan models?

From the previous posts, it seems that install_github will automatically compile the stan models again even though the models were already pre-compiled.

Thanks for your help!

install_github requires compilation. I gather you are trying to commit the compiled version of the models to the GitHub repository, but the compiled code is depends on the OS, the compiler, and the version of R. So, it will not generally work on a user’s computer, which is why install_github builds it locally from source. Once you get your package onto CRAN, it builds binary versions for all recent versions of Mac and Windows.

1 Like

Thanks a lot for your quick answer!

I will then ask the users to download a C++ compiler as explained on the rstan website to install the package from Github. Once the package is on CRAN, a C++ compiler should not be necessary anymore.