# Dealing with Catalina IV

**URL:** <https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502>\
**Category:** RStan\
**Created:** [March 3, 2020, 7:16pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502 "2020-03-03T19:16:08Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![davidh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/davidh/32/3334_2.png) [@davidh](https://discourse.mc-stan.org/u/davidh)\
**Post date:** [July 16, 2020, 6:49pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/21 "2020-07-16T18:49:31Z")

</div>

Not sure exactly what happened but I just updated to R4.0.2 and everything installed smoothly after that. Thanks for the quick response!

---

<div class="post-metadata">

**Author:** ![rovsom](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@rovsom](https://discourse.mc-stan.org/u/rovsom)\
**Post date:** [July 19, 2020, 9:37am UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/22 "2020-07-19T09:37:27Z")

</div>

Hello,

I’m running Catalina 10.15.6 and R 3.6.1 and have manually installed the toolchain (Xcode CLI, clang7, gfortran6.1) following @coatless instructions. I have also installed rstan , stanheaders and rstanarm from source following @bgoodri advice in previous posts . The install appears fine, the “helloworld.cpp” test runs fine, RStan examples run fine (from e.g. [here](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started)), everything seems fine - works perfect.

But I’m getting the following random error when trying to run a brm model - has anybody seen it or similar?

```
> m<-brm(log_fecundity~log_WL+(1+log_WL|Ref_unique_species), data=dat, chains=3, iter=10000, warmup=5000,
+ prior=prior, control=list(adapt_delta=0.99, max_treedepth=17), thin=5,
+ file='aeAlbFec_ref')
Compiling Stan program...
/var/folders/kh/lyr1fly54gb6m19c19pbm4jh_2gv05/T//RtmpnzLw2K/file9c252f58ef5.stan:42:45: warning: missing terminating ' character [-Winvalid-pp-token]
  r_1 = (diag_pre_multiply(sd_1, L_1) * z_1)';
                                            ^
1 warning generated.

```

It’s random, as if I shutdown/restart either RStudio or the whole laptop, and try running it again, it will sometimes compile and run (fast - \<1 second), without warning.  
Sometimes the warning will appear but it will still run through all chains, although take a long, long time to complete (\> 10 mins). Other times the warning will appear, the chains will not run and the fan in the laptop starts getting loud, and it appears as though the system has hung.

I’ve tried uninstall/reinstall everything - but each time it appears to install fine, and my models will run without error, but then I’ll start another model, or re-run the same one, and the error starts to appear.

Any ideas? I tried searching for /var/folders… info and “missing terminating ’ character” info but couldn’t find anything. Not too sure what this all means either…

Cheers  
Jon

---

<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:** [July 19, 2020, 3:01pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/23 "2020-07-19T15:01:40Z")

</div>

You can ignore that.

---

<div class="post-metadata">

**Author:** ![cichia](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@cichia](https://discourse.mc-stan.org/u/cichia)\
**Post date:** [October 11, 2020, 2:48am UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/24 "2020-10-11T02:48:05Z")

</div>

Hi,  
I have been trying to download Rcpp and Rstan and encountered some of the same errors as davidh.

When downloading Rcpp from drat, I get the following warning in the first few lines:

```
Warning in install.packages :
  unable to access index for repository https://rcppcore.github.io/drat/bin/macosx/contrib/4.0:
  cannot open URL 'https://rcppcore.github.io/drat/bin/macosx/contrib/4.0/PACKAGES'

```

Other warning will also pop up throughout the download including a warning about the clang (attached). I’m a little confused about this one as well. I’m on Catalina (10.15), but it says I don’t meet the 10.13+.

```
1 warning generated. 
clan++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I/usr/local/include-fPIC -Wall -g -02 attributes.cpp -o attributes.o
In file included from attributes.cpp:39: 

```

When I download Rstan, several sets of warnings are generated as well. One of which looks like the section below:

```
30 warnings generated.
ar -rs ../inst/lib//libStanServices.a stan_fit.o stan_fit_base.o
ar: creating archive ../inst/lib//libStanServices.a
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-rstan/00new/rstan/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rstan

```

Has anyone come across some different solutions that can help with these issues?

For context, I’m running on Catalina 10.15.6 and R 4.0.2. So, I’m not able to use the same solution as davidh.

---

<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 11, 2020, 5:03pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/25 "2020-10-11T17:03:33Z")

</div>

With R 4.x, you should be able to install all the binaries from CRAN with no ~/.R/Makevars . On Macs, you might need to eliminate the `PATH` line from the ~/.Renviron file if you have that from an older version of the C++ toolchain.

---

<div class="post-metadata">

**Author:** ![cichia](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@cichia](https://discourse.mc-stan.org/u/cichia)\
**Post date:** [October 11, 2020, 5:42pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/26 "2020-10-11T17:42:07Z")

</div>

Thank you so much for the response! At the time of the first post, I had the latest macOS R toolchain installed, and the ~/.Renviron file was not linked to older versions of clang.

Should I be looking in locations other than the ~/.Renviron file for an out of place PATH line?

---

<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 11, 2020, 7:07pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/27 "2020-10-11T19:07:37Z")

</div>

Not that I know of. What is

```
Sys.getenv("PATH")

```

?

---

<div class="post-metadata">

**Author:** ![cichia](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@cichia](https://discourse.mc-stan.org/u/cichia)\
**Post date:** [October 11, 2020, 7:23pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/28 "2020-10-11T19:23:51Z")

</div>

I get this output with Sys.getenv(“PATH”)

```
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/RStudio.app/Contents/MacOS/postback"

```

---

<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 11, 2020, 11:52pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/29 "2020-10-11T23:52:04Z")

</div>

Then it should be fine.

---

<div class="post-metadata">

**Author:** ![cichia](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@cichia](https://discourse.mc-stan.org/u/cichia)\
**Post date:** [October 11, 2020, 11:56pm UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/30 "2020-10-11T23:56:31Z")

</div>

Would you have any suggestions about remedying some of the warnings that were listed in the previous post? They seem to be causing some massive issues. When Rstan is successfully installed, similar warnings about clang are still issued, and the output for seeded analysis seems to be very off. Others running the same analyses are getting different output.

Thank you so much for the help and the replies by the way!

---

<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 12, 2020, 12:00am UTC](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502/31 "2020-10-12T00:00:31Z")

</div>

The drat thing I can’t help with, except to say install the binary Rcpp from CRAN. The compiler warnings when you install rstan from source are to be expected.

[Previous page](https://discourse.mc-stan.org/t/dealing-with-catalina-iv/13502.md?page=1)
