Hi,all
I was trying to compile my model but an error occurs without any information or log.
I can’t even see what wents wrong.
mod <- cmdstan_model("binomial.stan")
Compiling Stan program...
Error: An error occured during compilation! See the message above for more information.
I tried an example:
> file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
> mod <- cmdstan_model(file)
Model executable is up to date!
> class(mod)
[1] "CmdStanModel" "R6"
which seems working.
But another example:
stan_program <- write_stan_file("
parameters {
real x;
}
model {
real mu = -2;
x ~ normal(fabs(mu), 1);
}
"
)
> mod <- cmdstan_model(stan_program)
Compiling Stan program...
Error: An error occured during compilation! See the message above for more information.
Again, there’s just a notice of error but nothing detailed about it.
stan_program <- write_stan_file("
parameters {
real x;
}
model {
real mu = -2;
x ~ normal(fabs(mu), 1);
}
"
)
> mod <- cmdstan_model(stan_program, quiet = FALSE)
Compiling Stan program...
mingw32-make.exe: *** No rule to make target 'C:/Users/Mike Xu/AppData/Local/Temp/RtmpYHKjEF/model-14389ce321.exe'. Stop.
Error: An error occured during compilation! See the message above for more information.
So a error pops up. I searched on google but didn’t come up with a solution…
Hm, thats interesting. Not sure why that would cause a problem. It shouldnt for cmdstan itself, but might be an R or path issue. I am guessing the path to the models is something like \\DRIVE\....
This is just a regular network drive you have mapped in Windows?
The space in “C:/Users/Mike Xu” is causing the issue, thats where your R temp folder is located at the moment. Will check whats the easiest way to fix this.
I finally solved it. There can’t be any space in the address of R temp folder, which in my case the space between “Mike” and “Xu”.
First I tried to change my user folder name and it turns out to be complicated.
In the end, I just simply changed all temp path to another folder and solved the problem.
thanks for the report and glad you fixed it. Can you point to a guide you used or explain a bit more what exactly you mean by “ I just simply changed all temp path to another folder”.