# Developing a package that uses rstan - Pre-translated c++ files

**URL:** <https://discourse.mc-stan.org/t/developing-a-package-that-uses-rstan-pre-translated-c-files/6251>\
**Category:** Developers\
**Tags:** rstan\
**Created:** [October 29, 2018, 3:55am UTC](https://discourse.mc-stan.org/t/developing-a-package-that-uses-rstan-pre-translated-c-files/6251 "2018-10-29T03:55:28Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [October 29, 2018, 12:46pm UTC](https://discourse.mc-stan.org/t/developing-a-package-that-uses-rstan-pre-translated-c-files/6251/4 "2018-10-29T12:46:31Z")

</div>

Yes, I think that is right. But if it is wrong in some respect, it doesn’t really matter. For one thing, with the next version of **rstantools** , then Stan programs get put under inst/ . It took us a while to figure out how to get **rstanarm** to build, but once we incorporated that process into **rstantools** a lot of other people were able to copy it without knowing much more than

1. Write good Stan programs
2. Write wrapper functions that call `sampling` on those `stanmodels` that are in the `stanmodels` list

Keep an eye on

> [@How to update a package that has StanHeaders and rstan in its LinkingTo](https://discourse.mc-stan.org/t/how-to-update-a-package-that-has-stanheaders-and-rstan-in-its-linkingto/6041):
>
> This thread is for maintainers of R packages that ship with C++ code generated by Stan. Due to the move to C++14 by Stan, many such packages need to get updated ASAP because they currently do not build from source. I will make PRs on GitHub for the applicable packages, but the basic idea in each case is to install rstan 2.18.1 from CRAN and then in your package make the following changes: In DESCRIPTION, Under Depends: edit it to R \>= 3.4.0, Rcpp (\>= 0.12.0), methods (plus perhaps other pac…

and

> [@How to update a package that has StanHeaders and rstan in its LinkingTo, part II](https://discourse.mc-stan.org/t/how-to-update-a-package-that-has-stanheaders-and-rstan-in-its-linkingto-part-ii/6214):
>
> If you have a R package on CRAN that has StanHeaders in its LinkingTo, you likely received an email from CRAN objecting to some of the patterns rstanarm has used since 2015 to build. Please do not forward or quote from that email because reasons. If you have a R package that is going to CRAN eventually but was created since 2015, you will likely need to change some of them. I will update this thread after trying some alternative build syntax and seeking clarification from CRAN.

though.

---

_[View the full topic](https://discourse.mc-stan.org/t/developing-a-package-that-uses-rstan-pre-translated-c-files/6251)._
