stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.04k stars 269 forks source link

"Can't open connection" error on Windows #849

Open Theanalyst152 opened 4 years ago

Theanalyst152 commented 4 years ago

Summary:

Please provide a short summary (no more than a sentence or two). I 'm trying to use rstan and the stan function with rstudio and windows 10. I get a connection issue Error in file(con, "r") : cannot open the connection

Description:

Describe the issue as clearly as possible.

Reproducible Steps:

Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.

I 'm trying to use rstan and the stan function with rstudio and windows 10. Every time, i use the stan function I get this error message

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

If you have a reproducible example, please include it.

Current Output:

If applicable, any relevant output from RStan.

Expected Output:

If applicable, the output you expected from RStan.

RStan Version:

The version of RStan you are running (e.g., from packageVersion("rstan"))

R Version:

The version of R you are running (e.g., from R.version.string)

Operating System:

Your operating system (e.g., OS X 10.11.3)

jgabry commented 4 years ago

Sorry you're getting an error. Does the solution suggested in this post on the Stan forums

https://discourse.mc-stan.org/t/error-in-file-con-r-editing-makevars-win/17433

work for you?

Theanalyst152 commented 4 years ago

Hi, thanks for responding quickly. I did all those fixes now I have this error message. It looks like its look for a file that is name differently I think. Its looking for RcppCommon.h:29 and mine is just RcppCommon.h. Should I change the name?

Thanks

Error in compileCode(f, code, language = language, verbose = verbose) : In file included from C:/Users/thean/AppData/Local/Temp/Rtmp0kEsrn/downloaded_packages/rJava_0.9-13.zip/Rcpp/include/RcppCommon.h:29, from C:/Users/thean/AppData/Local/Temp/Rtmp0kEsrn/downloaded_packages/rJava_0.9-13.zip/Rcpp/include/Rcpp.h:27, from file39a07da34162.cpp:7:C:/Users/thean/AppData/Local/Temp/Rtmp0kEsrn/downloaded_packages/rJava_0.9-13.zip/Rcpp/include/Rcpp/r/headers.h:71:10: fatal error: R.h: No such file or directory #include <R.h> ^~~~~compilation terminated.make: *** [C:/PROGRA~1/R/R-40~1.1/etc/x64/Makeconf:229: file39a07da34162.o] Error 1

jgabry commented 4 years ago

I'm a bit out of my depth here since I don't know much about Windows. @bgoodri or @rok-cesnovar?

@Theanalyst152 If nobody else responds here I recommend asking on the forum (you'll get more eyes on your question there)

Theanalyst152 commented 4 years ago

ok thanks