# Complier errors M1 Pro Macs

**URL:** <https://discourse.mc-stan.org/t/complier-errors-m1-pro-macs/25094>\
**Category:** Modeling\
**Tags:** rstan, specification\
**Created:** [November 2, 2021, 11:57pm UTC](https://discourse.mc-stan.org/t/complier-errors-m1-pro-macs/25094 "2021-11-02T23:57:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxyaks](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oxyaks](https://discourse.mc-stan.org/u/oxyaks)\
**Post date:** [November 2, 2021, 11:57pm UTC](https://discourse.mc-stan.org/t/complier-errors-m1-pro-macs/25094/1 "2021-11-02T23:57:43Z")

</div>

I have just migrated to Mac and for some reason my code does not work. The example code runs fine though which is surprising.

 ![Screen Shot 2021-11-03 at 10.50.56 am](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/d/da52c3ab00ed24df4b8640504232b82bce149e32.jpeg)

But when I run my code which works fine on Windows gives the following errors

 ![Screen Shot 2021-11-03 at 10.52.21 am](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/6/6491b8bfc01d6f223aa73ea7c99dbb60dee0a56a.png)

Any suggestions ?

---

<div class="post-metadata">

**Author:** ![stijn](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/stijn/32/105_2.png) [@stijn](https://discourse.mc-stan.org/u/stijn)\
**Post date:** [November 3, 2021, 3:25am UTC](https://discourse.mc-stan.org/t/complier-errors-m1-pro-macs/25094/2 "2021-11-03T03:25:10Z")

</div>

This is merely a guess based on the error message but I wonder whether you are running into the same error as [2.16.1 and adapt\_delta](https://discourse.mc-stan.org/t/2-16-1-and-adapt-delta/24239).

That thread seems to indicate that using `control = list(adapt_delta = 0.8)` leads to some problems with `rstan 2.12.2`. You could delete the `control` argument to test. The thread also indicates that switching to `cmdstanr` might be an option.

---

<div class="post-metadata">

**Author:** ![oxyaks](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oxyaks](https://discourse.mc-stan.org/u/oxyaks)\
**Post date:** [November 3, 2021, 3:30am UTC](https://discourse.mc-stan.org/t/complier-errors-m1-pro-macs/25094/3 "2021-11-03T03:30:44Z")

</div>

@stijn Thank you. That worked. However if I cannot change adapt\_delta manually in case of divergences. I might indeed have to move to cmdstan. I however am worried my system my not be able to run the model using cmdstan since on cmdstan there is no way to specify which parameters to save samples for and considering that in my case there are significantly high number of parameters, that might be an issue.

Unless you can suggest a work around?

---

<div class="post-metadata">

**Author:** ![stijn](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/stijn/32/105_2.png) [@stijn](https://discourse.mc-stan.org/u/stijn)\
**Post date:** [November 3, 2021, 3:40am UTC](https://discourse.mc-stan.org/t/complier-errors-m1-pro-macs/25094/4 "2021-11-03T03:40:31Z")

</div>

I think you could try to install the github version of `rstan` which is not available on CRAN yet.

```no-highlight
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

```

Or any of the proposed solutions in this thread: [Can't install latest version of Rstan](https://discourse.mc-stan.org/t/cant-install-latest-version-of-rstan/24859)

> [@oxyaks](#):
>
> I however am worried my system my not be able to run the model using cmdstan since on cmdstan there is no way to specify which parameters to save samples for and considering that in my case there are significantly high number of parameters, that might be an issue.

If the worry has to do with memory, than `cmdstanr` might still be fine because it does not keep all samples in memory (or at least there is an option to not do that) but saves them to a .csv file.

---

<div class="post-metadata">

**Author:** ![oxyaks](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oxyaks](https://discourse.mc-stan.org/u/oxyaks)\
**Post date:** [November 3, 2021, 3:44am UTC](https://discourse.mc-stan.org/t/complier-errors-m1-pro-macs/25094/5 "2021-11-03T03:44:44Z")

</div>

Tried installing rstan from source worked. Thanks
