I got the problem that cmdstanr gets stuck when compiling a stan model or even installing cmdstan.
I starting using cmdstan awhile ago. Last week, I installed the macos-rtools to get rstanarm and brms working again on Catalina. All went well as far as I could see. However, when I tried to use cmdstanr again I got errors that made me think that because I switched compilers I had to recompile cmdstan. That did not finish after >12hours. I then recompiled cmdstan from the command line and it was a breeze (5 minutes).
The problem now is that cmdstanr is taking ages (killed it after 10 minutes) to compile simple models. Again from the command line, everything is fine. In fact, it’s so fast that I thought nothing has happened at first (kudos on that!).
As a side note: the bernoulli example in cmdstan throws an error.
Semantic error in 'examples/bernoulli/bernoulli.stan', line 10, column 6 to column 15:
-------------------------------------------------
8: model {
9: theta ~ beta(1,1); // uniform prior on interval 0,1
10: y ~ bernoulli(theta);
^
11: }
-------------------------------------------------
Identifier 'bernoulli' clashes with model name.
I am not an expert on anything Mac related but @andrewgelman had a similar issue installing on Catalina.
@mitzimorris got to the bottom of this and found out that Catalina has added a bunch of security features such that the stanc binaries when downloaded are automatically quarantined (sign of the times :) ) because they are not signed using Apple developer program credentials.
This issue was fixed on the cmdstan side but is currently only available on the Github repository. You need to install cmdstan from the repo using install_cmdstan(repo_clone = TRUE, cores = 4)
Hm, I am confused by this one. We did change the compilation of models so that we now explicitly set the name stanc flag so it could come from that. But I am unable to reproduce this one :/
library(cmdstanr)
file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
mod <- cmdstan_model(file)
This runs ok for me.
Can you make sure you are using the latest version of cmdstanr. Sorry for the troubles.
and then cmdstan_install times out. The command line building worked fine again. cmdstan_model just hangs again.
I reinstalled cmdstanr from github. No worries about the troubles. I know cmdstanr is still beta and Catalina has been something else. I can work with rstan for the moment. I am going to miss those sweet compile times though :-).
throws the error I mentioned before. I used that because that is what the cmdstan starting guide suggests. The following two calls work without a hitch.
Yeah, this has something to do with clang and Catalina. I am sorry, cant help much there as I am complete noob when it comes to Macs. Hopefully @mitzimorris has an idea.
Yes, stanc3 requires the model name not to be used. The default name is usually filename_model so its not really an issue.
I will delete the use of name from the example on the PR.
Not sure what you mean by removing it from makefile? I think @stijn just played around directly with the stanc3 compiler binaries.