Rstudio crashing reasons when compiling model

Hey!

Every time I’m in Rstudio, and compiling a model, if there’s a function missing, a syntax error, etc, instead of the language parser telling me what the error is, Rstudio crashes. This is horribly obnoxious, and why I avoid Rstan and use cmdstan. But then I don’t have this ‘stan fit’ object and all of these wonderful diagnostics that are in Rstan.

Is there any way to fix this? Is this only on my OS? Here’s my session info:

─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                          
 version  R version 3.5.3 (2019-03-11)   
 os       Fedora 29 (Workstation Edition)
 system   x86_64, linux-gnu              
 ui       RStudio                        
 language (EN)                           
 collate  en_US.UTF-8                    
 ctype    en_US.UTF-8                    
 tz       America/Detroit                
 date     2019-05-27                     

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package      * version   date       lib source        
 assertthat     0.2.0     2017-04-11 [1] CRAN (R 3.5.1)
 backports      1.1.3     2018-12-14 [1] CRAN (R 3.5.1)
 BH             1.69.0-1  2019-01-07 [1] CRAN (R 3.5.1)
 callr          3.1.1     2018-12-21 [1] CRAN (R 3.5.1)
 cli            1.0.1     2018-09-25 [1] CRAN (R 3.5.1)
 colorspace     1.4-0     2019-01-13 [1] CRAN (R 3.5.1)
 crayon         1.3.4     2017-09-16 [1] CRAN (R 3.5.1)
 desc           1.2.0     2018-05-01 [1] CRAN (R 3.5.1)
 digest         0.6.18    2018-10-10 [1] CRAN (R 3.5.1)
 fansi          0.4.0     2018-10-05 [1] CRAN (R 3.5.1)
 ggplot2        3.1.0     2018-10-25 [1] CRAN (R 3.5.1)
 glue           1.3.0     2018-07-17 [1] CRAN (R 3.5.1)
 gridExtra      2.3       2017-09-09 [1] CRAN (R 3.5.1)
 gtable         0.2.0     2016-02-26 [1] CRAN (R 3.5.1)
 inline         0.3.15    2018-05-18 [1] CRAN (R 3.5.1)
 labeling       0.3       2014-08-23 [1] CRAN (R 3.5.1)
 lattice        0.20-38   2018-11-04 [2] CRAN (R 3.5.3)
 lazyeval       0.2.1     2017-10-29 [1] CRAN (R 3.5.1)
 loo            2.0.0     2018-04-11 [1] CRAN (R 3.5.1)
 magrittr       1.5       2014-11-22 [1] CRAN (R 3.5.1)
 MASS           7.3-51.1  2018-11-01 [2] CRAN (R 3.5.3)
 Matrix         1.2-15    2018-11-01 [2] CRAN (R 3.5.3)
 matrixStats    0.54.0    2018-07-23 [1] CRAN (R 3.5.1)
 mgcv           1.8-27    2019-02-06 [2] CRAN (R 3.5.3)
 munsell        0.5.0     2018-06-12 [1] CRAN (R 3.5.1)
 nlme           3.1-137   2018-04-07 [2] CRAN (R 3.5.3)
 pillar         1.3.1     2018-12-15 [1] CRAN (R 3.5.1)
 pkgbuild       1.0.2     2018-10-16 [1] CRAN (R 3.5.1)
 pkgconfig      2.0.2     2018-08-16 [1] CRAN (R 3.5.1)
 plyr           1.8.4     2016-06-08 [1] CRAN (R 3.5.1)
 prettyunits    1.0.2     2015-07-13 [1] CRAN (R 3.5.1)
 processx       3.2.1     2018-12-05 [1] CRAN (R 3.5.1)
 ps             1.3.0     2018-12-21 [1] CRAN (R 3.5.1)
 R6             2.3.0     2018-10-04 [1] CRAN (R 3.5.1)
 RColorBrewer   1.1-2     2014-12-07 [1] CRAN (R 3.5.1)
 Rcpp           1.0.0     2018-11-07 [1] CRAN (R 3.5.1)
 RcppEigen      0.3.3.5.0 2018-11-24 [1] CRAN (R 3.5.1)
 reshape2       1.4.3     2017-12-11 [1] CRAN (R 3.5.1)
 rlang          0.3.1     2019-01-08 [1] CRAN (R 3.5.1)
 rprojroot      1.3-2     2018-01-03 [1] CRAN (R 3.5.1)
 rstan          2.18.2    2018-11-07 [1] CRAN (R 3.5.3)
 scales         1.0.0     2018-08-09 [1] CRAN (R 3.5.1)
 StanHeaders    2.18.0-1  2018-12-13 [1] CRAN (R 3.5.1)
 stringi        1.2.4     2018-07-20 [1] CRAN (R 3.5.1)
 stringr        1.3.1     2018-05-10 [1] CRAN (R 3.5.1)
 tibble         2.0.1     2019-01-12 [1] CRAN (R 3.5.1)
 utf8           1.1.4     2018-05-24 [1] CRAN (R 3.5.1)
 viridisLite    0.3.0     2018-02-01 [1] CRAN (R 3.5.1)
 withr          2.1.2     2018-03-15 [1] CRAN (R 3.5.1)

I don’t know the extent of what you are trying to do but I find littler works nicely with CmdStan giving us access to data frames, etc. in what are basically bash scripts. Largely made possible thanks to rstan::stan_rdump().

1 Like

Just a note: rstan::read_stan_csv (the real name is similar) will read in and paste cmdstan files…

1 Like

That is not supposed to happen, but that hasn’t happened to anyone else for a long time. Are you using clang4 or clang6 or some other compiler?

Yeah, that could be the issue. In cmdstan Stan I can set the cmdstan/make/local or look at cmdstan/makefile, but where can I find the default compiler options in the R/…/rstan/ directories? I dug around for 3 minutes with no success.

@sakrejda yeah I was doing that, but for reproducable-ness it’s nice to let someone just press “go” and not have to move many files around.

It is ultimately governed by ~/.R/Makevars although it gets some default values from other files.