M1 Mac issues

I only have access to this iMac for a few more days (father has one) and I’m testing out cmdstanr.

I haven’t seen this particular issue mentioned. I’m using cmdstanr and cmdstan 2.28.2. Everything installs and I can compile and sample models. But I can only do this once. If I change the Stan file or I force_recompile the model compiles but I cannot sample from it.

The error I’m getting says zsh killed process. I believe that the recompilation is kicking off a terminal process in Rosetta and then when it tries to call this process zsh kills it immediately because it’s arm compiled.

I can only get sampling to start if I manually go into the directory with the compiled Stan model, delete it, and then recompile.

2 Likes

Thanks Sean for the report and debugging this.

Can you try installing:

remotes::install_github("stan-dev/cmdstanr@m1_fix")

and seeing that helps. Its a silly attempt, but based on what you are saying it should work.

1 Like

I’m getting an error with

> schools <- cmdstan_model("eight_schools.stan", force_recompile = TRUE)
Error in if (file.exists(self$exe_file())) { : argument is of length zero

error persists even if force_recompile = FALSE and I make changes to the stan file and re-save.

Sorry, fixed the syntax. Can you try again?

It works!

Huh, a weird fix, but I will take it :)

hi @spinkney - is this an issue for CmdStanPy as well?

Hello,

I have a similar issue with M1 Mac, and tried to use your code. But I had the following error message. Maybe, the file is not available anymore. Is there a way that I can use it? Thank you in advance for your advice!

Downloading GitHub repo stan-dev/cmdstanr@m1_fix
Error in utils::download.file(url, path, method = method, quiet = quiet, :
cannot open URL ‘https://api.github.com/repos/stan-dev/cmdstanr/tarball/m1_fix