# Force recompilation

**URL:** <https://discourse.mc-stan.org/t/force-recompilation/22017>\
**Category:** RStan\
**Created:** [April 21, 2021, 1:27pm UTC](https://discourse.mc-stan.org/t/force-recompilation/22017 "2021-04-21T13:27:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertgrant](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/robertgrant/32/21233_2.png) [@robertgrant](https://discourse.mc-stan.org/u/robertgrant)\
**Post date:** [April 21, 2021, 1:27pm UTC](https://discourse.mc-stan.org/t/force-recompilation/22017/1 "2021-04-21T13:27:30Z")

</div>

Hi, I would like to get rstan::stan\_model() to recompile within an R session. I’ve seen folk refer to this but don’t see any mention of it in stan\_model options. What’s the trick?

Background info: if I run a script including compilation under Ubuntu, save.image(), then load the environment on a Mac, the compiled models come with, but they won’t run of course. And it won’t recompile them either.

---

<div class="post-metadata">

**Author:** ![martinmodrak](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/martinmodrak/32/133_2.png) [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Post date:** [April 29, 2021, 8:55pm UTC](https://discourse.mc-stan.org/t/force-recompilation/22017/2 "2021-04-29T20:55:19Z")

</div>

Maybe @jonah knows?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/1/9/190baba5d6cf7e2bde3ad3a6c819fe8b7fb79243.png) [@system](https://discourse.mc-stan.org/u/system)\
**Post date:** [May 3, 2021, 9:00am UTC](https://discourse.mc-stan.org/t/force-recompilation/22017/3 "2021-05-03T09:00:04Z")

</div>



---

<div class="post-metadata">

**Author:** ![mike-lawrence](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mike-lawrence/32/59_2.png) [@mike-lawrence](https://discourse.mc-stan.org/u/mike-lawrence)\
**Post date:** [May 3, 2021, 12:51pm UTC](https://discourse.mc-stan.org/t/force-recompilation/22017/4 "2021-05-03T12:51:55Z")

</div>

Presumably using cmdstanr isn’t an option?

---

<div class="post-metadata">

**Author:** ![robertgrant](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/robertgrant/32/21233_2.png) [@robertgrant](https://discourse.mc-stan.org/u/robertgrant)\
**Post date:** [May 7, 2021, 11:18am UTC](https://discourse.mc-stan.org/t/force-recompilation/22017/5 "2021-05-07T11:18:48Z")

</div>

It’s certainly an option. It just feels like there should be something in rstan.
