Open christineymshen opened 4 years ago
In addition, now that as I'm editing my codes in .stan file in Rstudio, I noticed that I'm constantly getting this message in my console (every a few mins):
sh: clang++ -mmacosx-version-min=10.13: command not found
Updates:
I've installed R 4.0.2. I'm still getting all these messages. And for the example I mentioned above where it fails to run, now instead of generating error msg, my R session would crash with message saying:
R Session Aborted. R encountered a fatal error. The session was terminated.
Would really appreciate your help! Thanks!
Another update, I made the following change and then it can run without crashing. But I don't see why the original declaration is illegal.
original code:
parameters {
vector<lower=0, upper=1>[n] theta; // chance of success (unpooled)
}
new code:
parameters {
real<lower=0, upper=1> theta[n]; // chance of success (unpooled)
}
did you get the same following error again in R or Rstudio ? 2: In file.remove(c(unprocessed, processed)) : cannot remove file '/var/folders/fr/b4bvkc_11vj3ntd1r6859x5m0000gn/T//RtmpjkdCOb/file13be45025d82.stan', reason 'No such file or directory'
maybe the solution tips put on this link (https://discourse.mc-stan.org/t/rstan-on-windows/16673) can help you solve the problem
did you get the same following error again in R or Rstudio ? 2: In file.remove(c(unprocessed, processed)) : cannot remove file '/var/folders/fr/b4bvkc_11vj3ntd1r6859x5m0000gn/T//RtmpjkdCOb/file13be45025d82.stan', reason 'No such file or directory'
I've been using Rstudio the whole time. The error msg appears in the console.
maybe the solution tips put on this link (https://discourse.mc-stan.org/t/rstan-on-windows/16673) can help you solve the problem
I saw this link, but wasn't sure whether I should follow the suggestions there since it's said to be for windows, while I'm using a mac~~
well, maybe reinstall an earlier version of rstan. there are a large number of people who are having problems with rstan 2.21.x....
well, maybe reinstall an earlier version of rstan. there are a large number of people who are having problems with rstan 2.21.x....
I was just about to come and tell you that I've falled back to using 2.19.3 now and it works much better!! [facepalm
hahah..congratulations!
Sorry for the hassle! A few questions and suggestions:
Does installing RStan from GitHub with
remove.packages("rstan") # restart R after doing this before running the next line
remotes::install_github("stan-dev/rstan", ref = "develop", subdir =
"rstan/rstan")
work for you? Some people reported success with that in this other issue: https://github.com/stan-dev/rstan/issues/774
Also, what are the contents of your Makevars file? That can be accessed using file.edit(file.path(Sys.getenv("HOME"), ".R", "Makevars"))
.
file.edit(file.path(Sys.getenv("HOME"), ".R", "Makevars"))
Here's my Makevars file:
CXX14FLAGS=-O3 -march=native -mtune=native CXX14FLAGS += -arch x86_64 -ftemplate-depth-256
I think I was trying to follow the rstan get started page to set up this thing. But I remember when I installed the latest rstan, somehow it can't detect the buildtool so I was re-installing that and had to go over the process on get started page a few times. In the end I wasn't sure what I did... it was a blur.
I haven't tried installing from github. I need to use stan for something recently so guess I'll stick to the old version for now~~ I'll try that later!! Thanks for the suggestion!
Ok that's the same as my Makevars file and I'm using the same operating system as you (Catalina), so that's not the problem. So yeah I recommend trying installing from GitHub, but totally fine to use the older version until then. If you do end up trying the GitHub installation let us know if that resolves the problem.
Ok that's the same as my Makevars file and I'm using the same operating system as you (Catalina), so that's not the problem. So yeah I recommend trying installing from GitHub, but totally fine to use the older version until then. If you do end up trying the GitHub installation let us know if that resolves the problem.
Thanks a lot for following up on this! I'll let you know later if I get to explore the development version on GitHub.
I just want to mention, when I was using v2.21.1, one issue is I constantly get R Session Aborted error, at random time running the same codes. And now that I've switched to using the old version, the same code runs fine. Also one time when I was exploring, I noticed that after rstan finished running, my R console was flooded (endlessly) with the following msg. And I had to terminate my R session manually. It seems like there's sth wrong with rstan working with C++...
*** recursive gc invocation
I've been noting down my issues here as well. Um... just in case it might be useful in any way...
https://discourse.mc-stan.org/t/r-session-aborted/17005 https://discourse.mc-stan.org/t/r-session-crash-while-using-vb-function-fullrank/16986
Again thanks a lot!!
Thanks a lot for letting us know about the weird messages and other issues! I'll also respond to your discourse post(s) with a few other suggestions.
For what it's worth I had exactly (macOS=big sur; R=4.0.2; rstudio=1.4.1103) the same problem. None of the solutions here worked for me. I ended up deleting RStudio, R, every hidden R and R studio file (there are a few) and (i think crucially) all the R packages. I rebooted and reinstalled and all errors have vanished.
my first few attempts did not delete all the R packages because I couldn't find them all, so i suspect whatever was causing this warning/message was embedded in an ancillary package. (and i did try removing 'rstan' on through R a few times to no avail).
Summary:
I re-installed my rstan package earlier today, and warning msg starts to show up, and also some models that used to work ok now cannot be run.
Description:
After re-installing rstan, I followed the start guide and checked the following:
Somehow it showed FALSE. So I further installed the C++ toolchain using the macOS R toolchain installer.
Now whenever I need to do model fit, I see this message
And it's usually accompanied with this error msg:
Sometimes the model can run. Sometimes it failed (whereas previously works ok). And when it fails, in addition to the previous msg, I also got the following one:
Reproducible
Here's the codes I was using where it fails to run:
stan file (filename:lab-02-nopool.stan) :
R code
Here's info on my systems:
RStan Version:
2.21.1
R Version:
R 4.0.1
Operating System:
macOS Catalina 10.15.5