Hey all,
I can’t seem to compile any models whether I’m using cmdstanr, rstan, or brms. I’m getting similar errors for cmdstanr and brms (when cmdstanr is set as the backend), so I’ll focus on those…
Here’s the code I’m running for cmdstanr:
unlocked_folder <- "path_to_whitelisted_folder_on_my_work_computer"
## data for test model
data_list <- list(N = 10, y = c(0,1,0,0,0,0,0,0,0,1))
## model code for cmdstanr
mod_string <- "
data {
int<lower=0> N;
int<lower=0,upper=1> y[N];
}
parameters {
real<lower=0,upper=1> p;
}
model {
p ~ beta(1,1); // uniform prior on interval 0,1
y ~ bernoulli(p);
}
"
file <- write_stan_file(mod_string, dir= unlocked_folder )
mod <- cmdstan_model(file)
The result is…
Compiling Stan program...
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'make' failed
---
Exit status: 2
Stderr:
make: *** /c/Users/<my_username>/OneDrive: Is a directory. Stop.
---
Type .Last.error to see the more details.
> .Last.error
<system_command_status_error/rlib_error_3_0/rlib_error/error>
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'make' failed
---
Exit status: 2
Stderr:
make: *** /c/Users/<my_username>/OneDrive: Is a directory. Stop.
---
Backtrace:
1. cmdstanr::cmdstan_model(file)
2. CmdStanModel$new(stan_file = stan_file, exe_file = exe_file, …
3. local initialize(...)
4. self$compile(...)
5. cmdstanr:::get_cmdstan_flags("STANCFLAGS")
6. cmdstanr:::wsl_compatible_run(command = "make", args = c(paste0("print-", …
7. base::do.call(processx::run, run_args)
8. (function (command = NULL, args = character(), error_on_status = TRUE, …
9. processx:::throw(new_process_error(res, call = sys.call(), echo = echo, …
And here’s a similar error I get when trying to fit the same model with brms using cmdstanr as a backend. First the code…
options(cmdstanr_write_stan_file_dir = unlocked_folder)
brms_fit <- brm(y ~ 1, family="bernoulli",
data=data.frame(y = data_list$y), backend="cmdstanr")
And here’s the error:
Compiling Stan program...
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'make' failed
---
Exit status: 2
Stderr:
make: *** /c/Users/<my_username>/OneDrive: Is a directory. Stop.
---
Type .Last.error to see the more details.
> .Last.error
<system_command_status_error/rlib_error_3_0/rlib_error/error>
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'make' failed
---
Exit status: 2
Stderr:
make: *** /c/Users/<my_username>/OneDrive: Is a directory. Stop.
---
Backtrace:
1. brms::brm(y ~ 1, family = "bernoulli", data = data.frame(y = data_list$y), …
2. brms::do_call(compile_model, compile_args)
3. brms:::eval2(call, envir = args, enclos = envir)
4. base::eval(expr, envir, ...)
5. base::eval(expr, envir, ...)
6. local .fun(model = .x1, backend = .x2, threads = .x3, opencl = .x4, …
7. local .compile_model(model, ...)
8. brms:::eval_silent(do_call(cmdstanr::cmdstan_model, args), type = "message", …
9. base::eval(expr, envir)
10. base::eval(expr, envir)
11. brms::do_call(cmdstanr::cmdstan_model, args)
12. brms:::eval2(call, envir = args, enclos = envir)
13. base::eval(expr, envir, ...)
14. base::eval(expr, envir, ...)
15. local .fun(stan_file = .x1)
16. CmdStanModel$new(stan_file = stan_file, exe_file = exe_file, …
17. local initialize(...)
18. self$compile(...)
19. cmdstanr:::get_cmdstan_flags("STANCFLAGS")
20. cmdstanr:::wsl_compatible_run(command = "make", args = c(paste0("print-", …
21. base::do.call(processx::run, run_args)
22. (function (command = NULL, args = character(), error_on_status = TRUE, …
23. processx:::throw(new_process_error(res, call = sys.call(), echo = echo, …
I tried rebuild_cmdstan() but it didn’t help.
I’d be grateful for any ideas from anyone about how to fix this.
Thank you.