Problem running STAN

When I run stan command from RStudio I have this problems:

hash mismatch so recompiling; make sure Stan code ends with a blank line
Error in file(con, "r") : cannot open the connection
Inoltre: Warning messages:
1: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
  'C:/rtools40/usr/mingw_/bin/g++' not found
2: In system(cmd, intern = !verbose) :
  running command 'C:/PROGRA~1/R/R-40~1.2/bin/x64/R CMD SHLIB file17d059e31379.cpp 2> file17d059e31379.cpp.err.txt' had status 5
3: In file(con, "r") :
  cannot open file 'file17d059e31379.cpp.err.txt': No such file or directory
Error in sink(type = "output") : invalid connection

This is the output of version:

platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          4                           
minor          0.2                         
year           2020                        
month          06                          
day            22                          
svn rev        78730                       
language       R                           
version.string R version 4.0.2 (2020-06-22)
nickname       Taking Off Again    

Have you got any advise?

Hi Davide,

Warnings 1 & 2 are safe to ignore, for warning 3 can you run:

remotes::install_github("bgoodri/inline")

And try the model again?

2 Likes

I run the command line but it gives me another error:

> remotes::install_github("bgoodri/inline")
Downloading GitHub repo bgoodri/inline@HEAD
Errore: Failed to install 'inline' from GitHub:
  System command 'Rcmd.exe' failed, exit status: -1073741819, stdout + stderr empty

rstan::stan gives me the same error:

Error in file(con, "r") : cannot open the connection
Inoltre: Warning messages:
1: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
  'C:/rtools40/usr/mingw_/bin/g++' not found
2: In system(cmd, intern = !verbose) :
  running command 'C:/PROGRA~1/R/R-40~1.2/bin/x64/R CMD SHLIB file17d045549dc.cpp 2> file17d045549dc.cpp.err.txt' had status 5
3: In file(con, "r") :
  cannot open file 'file17d045549dc.cpp.err.txt': No such file or directory
Error in sink(type = "output") : invalid connection

Iā€™m working in a wd which is shared with Dropbox, could it be a problem?

Try this instead

install.packages("https://github.com/bgoodri/inline/archive/master.tar.gz", 
                 repos = NULL, type = "source")

Thanks, now the problem seems to be solved!