Problems installing RStan on macOS Ventura 13.3.1


I’m trying to work with the BRMS package in R and proceeded as indicated at this link:

When typing the command

example(stan_model, package = "rstan", run.dontrun = TRUE)

I get the following error. I tried re-installing from scratch, but the issue keeps surfacing. I hope to get a hint about how to make this work. Thank you very much

Error in compileCode(f, code, language = language, verbose = verbose) :
typedef double local_scalar_t__; ^32 warnings generated.error: unknown target CPU 'apple-m1’note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, geodemake: *** [filede4165b2d3.o] Error 1

Did you ever figure this out? I am running into similar issues, but when I try

example(stan_model, package = "rstan", run.dontrun = TRUE)

my R session crashes.

Well, it looks like I just needed to compile from source and it did the trick.

install.packages("rstan", repos = c("", getOption("repos")))

1 Like

Thank you for sharing your experience. Never managed to solve this. I seem to remember I tried every form of installation, including the one you’re mentioning, but to no avail. I’ll give it a try though.

Thank you so much for your helpfulness, I really appreciate it.

1 Like