Skip to content

Cannot compile brms model with cmdstanr on Windows 10 #815

Open
@qdread

Description

@qdread

I apologize if this duplicates an existing issue but it seems like there are many similar issues involving Windows. I am responsible for teaching Stan to federal employees and I am having trouble getting brms + CmdStan + cmdstanr combination to work on Windows 10 machines that they are required to use.

We experienced issues with cmdstanr 0.6.0 so we rolled back to 0.5.3, however we are still unable to compile any model with brm() via cmdstanr backend. Unfortunately, I do not have access to a machine with the configuration that the employees will be using so I have had to go back and forth with an IT person at another location trying to debug this issue. Here I am providing the error message we see on trying to compile the model, plus as much system information as I could get. Any help would be greatly appreciated! Thank you for this amazing package. It makes my life much better!

Compilation error

library(brms)
options(brms.backend = 'cmdstanr')
brm(mpg~hp, data=mtcars)

Error message:

Compiling Stan program...
INFO: Could not find files for the given pattern(s).

INFO: Could not find files for the given pattern(s).

p
rocess_begin: CreateProcess(C:\Windows\System32\cmd.exe, cmd /C "cscript /nologo /E:jscript ../tbb_2020.3/build/detect.js  /arch gcc", ...) failed.
../tbb_2020.3/build/windows.inc:29: pipe: No error

p
rocess_begin: CreateProcess(C:\Windows\System32\cmd.exe, cmd /C "cscript /nologo /E:jscript ../tbb_2020.3/build/detect.js  /runtime gcc", ...) failed.
../tbb_2020.3/build/windows.inc:33: pipe: No error
../tbb_2020.3/build/common.inc:81: *** Architecture not detected.  Stop.

mingw32-make: *** [stan/lib/stan_math/make/libraries:173: stan/lib/stan_math/lib/tbb/tbbmalloc.def] Error 2

Error: An error occured during compilation! See the message above for more information.

System information

> cmdstanr::check_cmdstan_toolchain()
The C++ toolchain required for CmdStan is setup properly!
>> Sys.which("mingw32-make")
mingw32-make 
          ""
> Sys.which("g++")
                                         g++ 
"C:\\rtools43\\X86_64~1.POS\\bin\\G__~1.EXE" 
>

Session info call:

> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] brms_2.19.0    Rcpp_1.0.11    cmdstanr_0.5.3

loaded via a namespace (and not attached):
[1] tidyselect_1.2.0     dplyr_1.1.2          farver_2.1.1        
 [4] loo_2.6.0            fastmap_1.1.1        tensorA_0.36.2      
 [7] shinystan_2.6.0      promises_1.2.0.1     shinyjs_2.1.0       
[10] digest_0.6.33        mime_0.12            lifecycle_1.0.3     
[13] StanHeaders_2.26.27  ellipsis_0.3.2       processx_3.8.2      
[16] magrittr_2.0.3       posterior_1.4.1      compiler_4.3.1      
[19] rlang_1.1.1          tools_4.3.1          igraph_1.5.0.1      
[22] utf8_1.2.3           knitr_1.43           prettyunits_1.1.1   
[25] bridgesampling_1.1-2 htmlwidgets_1.6.2    pkgbuild_1.4.2      
[28] plyr_1.8.8           dygraphs_1.1.1.6     abind_1.4-5         
[31] miniUI_0.1.1.1       withr_2.5.0          grid_4.3.1          
[34] stats4_4.3.1         fansi_1.0.4          xts_0.13.1          
[37] xtable_1.8-4         colorspace_2.1-0     inline_0.3.19       
[40] ggplot2_3.4.2        scales_1.2.1         gtools_3.9.4        
[43] cli_3.6.1            mvtnorm_1.2-2        crayon_1.5.2        
[46] generics_0.1.3       RcppParallel_5.1.7   reshape2_1.4.4      
[49] rstan_2.21.8         stringr_1.5.0        shinythemes_1.2.0   
[52] bayesplot_1.10.0     parallel_4.3.1       matrixStats_1.0.0   
[55] base64enc_0.1-3      vctrs_0.6.3          Matrix_1.5-4.1      
[58] jsonlite_1.8.7       callr_3.7.3          crosstalk_1.2.0     
[61] glue_1.6.2           codetools_0.2-19     ps_1.7.5            
[64] DT_0.28              distributional_0.3.2 stringi_1.7.12      
[67] gtable_0.3.3         later_1.3.1          munsell_0.5.0       
[70] tibble_3.2.1         colourpicker_1.2.0   pillar_1.9.0        
[73] htmltools_0.5.5      Brobdingnag_1.2-9    R6_2.5.1            
[76] shiny_1.7.4.1        lattice_0.21-8       markdown_1.7        
[79] backports_1.4.1      threejs_0.3.3        httpuv_1.6.11       
[82] rstantools_2.3.1.1   coda_0.19-4          gridExtra_2.3       
[85] nlme_3.1-162         checkmate_2.2.0      xfun_0.39           
[88] zoo_1.8-12           pkgconfig_2.0.3     

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwindows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions