Maybe. But Rcpp::sourceCpp and inline::cxxfunction are loading the DLLs automatically, so I don’t see how those would ever work on a Catalina machine. Prior to Catalina, rstan was working with essentially
Hello, I am a new Stan user and just want to echo that I am having the exact same issue as other people here. It seems like conversation on this thread has fallen off in the past few days - was a permanent, consistent solution ever found? Thanks.
Docker is the only way I can work right now on the machines I “upgraded” to Catalina. It’s just amazing that Apple has bricked so many people. I have several friends who just can’t work until there is a simple solution.
For transparency: I posted about the issues with Catalina on official Stan Twitter so that users are warned. If you think I’ve mischaracterized the situation, let me know and I will update the info there (people with access to official Twitter can obviously do it themselves).
@torkar I just installed Docker ran a brms job with it but the error emerged for one of the chains:
m_demos_secular_age ← brm(auth_theta_st |weights(weight)~ s(age,by=religion_sample),family=gaussian(),
data=survey_data,
cores = 4,chains=4, iter = 5000,
file=“models/m_demos_secular_age”)
Compiling the C++ model
recompiling to avoid crashing R session
Start sampling
starting worker pid=1162 on localhost:11460 at 01:37:30.530
starting worker pid=1176 on localhost:11460 at 01:37:30.722
starting worker pid=1190 on localhost:11460 at 01:37:30.911
starting worker pid=1204 on localhost:11460 at 01:37:31.099
SAMPLING FOR MODEL ‘0c266c38e0747884b21cf03aad6cbcc2’ NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.00253 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 25.3 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 5000 [ 0%] (Warmup)
SAMPLING FOR MODEL ‘0c266c38e0747884b21cf03aad6cbcc2’ NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 0.002729 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 27.29 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Chain 2: Iteration: 1 / 5000 [ 0%] (Warmup)
SAMPLING FOR MODEL ‘0c266c38e0747884b21cf03aad6cbcc2’ NOW (CHAIN 3).
Chain 3:
Chain 3: Gradient evaluation took 0.003116 seconds
Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 31.16 seconds.
Chain 3: Adjust your expectations accordingly!
Chain 3:
Chain 3:
[1] “Error in sampler$call_sampler(args_list[[i]]) : "
[2] " c++ exception (unknown reason)”
error occurred during calling the sampler; sampling not done
SAMPLING FOR MODEL ‘0c266c38e0747884b21cf03aad6cbcc2’ NOW (CHAIN 4).
Chain 4:
Chain 4: Gradient evaluation took 0.002956 seconds
Chain 4: 1000 transitions using 10 leapfrog steps per transition would take 29.56 seconds.
Chain 4: Adjust your expectations accordingly!
Chain 4:
Chain 4:
Chain 4: Iteration: 1 / 5000 [ 0%] (Warmup)
Am I possibly doing/done something wrong? Have you had success sampling with each implementation of rstan? Does this extend to brms or any other package such as blavaan that acts as a wrapper for RStan?
You are running this on localhost:8787?!? I, and others, have used the Docker image now for a number of days and I haven’t seen that error on Docker :( Can you send a MWE (incl. data) that I can try to run to see what happens?
I was hoping it could be that I was doing something wrong since I’m unfamiliar with much computer science. What do you mean by running it on localhost:8787 exactly?
@torkar I downloaded the Docker desktop app, ran the code you posted, I put localhost:8787 into Chrome an RStudio login appeared; I couldn’t log in, didn’t know what credentials it was after, I guessed it was the credentials I had made to download the Docker desktop app.
@mansillo, in case there are more questions regarding Docker please start a new thread/question so we keep this separate from the issues in this forum.
Login using rstudio and the password you set when starting your docker image.
Thanks, @Jonah. I am able to get cmdstanr to work correctly on stan models on Catalina after removing the .Renviron that sets the path to clang7, which I think was created as part of the @coatless instructions for rstan. I also removed the .Makevars file, so rstan is just using the apple clang compiler, but that may not have been needed for cmdstanr anyway. So this looks like at least a great interim option.
It might be interesting to see if PyStan on Catalina faces the same problems as RStan. One might think that it should, but given that I’ve seen other circumstances where PyStan worked but RStan failed, that’s far from guaranteed. If Catalina affects the two Stan interfaces differently, it may help narrow down the source of the problem.
Using clang7 means having two copies of the libc++. The benefit of the second libc++ and clang7 compiler is access to OpenMP methods. Thus, when the clang7 compiler is removed from the PATH variable in .Renviron there is a loss of OpenMP compatibility. Again, mileage may vary for Stan, but this does go against the standard configuration. Perhaps two sets of installers are required?
Deleting the ~/R/.Makevars file makes little sense as there must be variables set for the new location of the C header files in macOS Catalina.