# Problem using rstan on OSX Catalina

**URL:** https://discourse.mc-stan.org/t/problem-using-rstan-on-osx-catalina/25544
**Category:** General
**Tags:** fitting-issues, rstan
**Created:** [December 2, 2021, 4:03pm UTC](https://discourse.mc-stan.org/t/problem-using-rstan-on-osx-catalina/25544 "2021-12-02T16:03:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![d1234](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@d1234](https://discourse.mc-stan.org/u/d1234)
#### Post date: [December 2, 2021, 4:03pm UTC](https://discourse.mc-stan.org/t/problem-using-rstan-on-osx-catalina/25544/1 "2021-12-02T16:03:29Z")

</div>

I’m hitting an error trying to use `rstan::stan_model`, it always fails for me.

From reading previous forum messages, I feel like this might have to do with Mac OSX Catalina (10.15.6), but I’m not sure. I’ve tried everything suggested from previous formum messages, including upgrading to the “develop” version of `rstan`.

Here’s output of `version`, and the output of what I’m seeing:

```
version

## _                           
## platform x86_64-apple-darwin17.0     
## arch x86_64                      
## os darwin17.0                  
## system x86_64, darwin17.0          
## status                                     
## major 4                           
## minor 0.2                         
## year 2020                        
## month 06                          
## day 22                          
## svn rev 78730                       
## language R                           
## version.string R version 4.0.2 (2020-06-22)
## nickname Taking Off Again            

```

```
library(rstan)

## Loading required package: StanHeaders
## Loading required package: ggplot2
## rstan (Version 2.21.3, GitRev: 2e1f913d3ca3)
## For execution on a local, multicore CPU with excess RAM we recommend calling
## options(mc.cores = parallel::detectCores()).
## To avoid recompilation of unchanged Stan programs, we recommend calling
## rstan_options(auto_write = TRUE)

```

```
stan_code <- '
data {
  int<lower=0> N;
  vector[N] x;
  vector[N] y;
}
parameters {
  real alpha;
  real beta;
  real<lower=0> sigma;
}
model {
  y ~ normal(alpha + beta * x, sigma);
}

'

```

```
stan_mod <- rstan::stan_model(model_code = stan_code)

## 'config' variable 'CPP' is deprecated
## clang -mmacosx-version-min=10.13 -E
## Warning message:
## In system(paste(CPP, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
## error in running command

```

```
stan_mod

## Error: object 'stan_mod' not found

```

I can provide any additional system information, if that’s helpful.

Thank you very much for any help.

---

<div class="post-metadata">

### Author: ![d1234](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@d1234](https://discourse.mc-stan.org/u/d1234)
#### Post date: [December 2, 2021, 8:03pm UTC](https://discourse.mc-stan.org/t/problem-using-rstan-on-osx-catalina/25544/2 "2021-12-02T20:03:06Z")

</div>

This appears to have been resolved by the following alternate post:

[Dealing with Catalina III](https://discourse.mc-stan.org/t/dealing-with-catalina-iii/12731)

which suggested installing `rstan` from source:

```
install.packages("rstan", type = "source")

```
