cmdstanR installation error
I am trying to install cmdstanR after updating to R 4.0.2 on Windows 10, following the steps outlined in this link, and the step-by-step discussion on this discourse topic.
I have been able to get both bash --version
, g++ -v
and mingw32-make --version
to run from command prompt (see the screenshot below).
I get the following error when trying to compile the toy example on ‘getting started page’, i.e. after I run
file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
if I compile the stan file, I am getting this error:
mod <- cmdstan_model(file)
Compiling Stan program...
Compiling the main object file and precompiled headers (may take up to a few minutes). This is only necessary the first time a model is compiled after installation or when threading, MPI or OpenCL are used for the first time.
Error in processx::run(command = make_cmd(), args = c(cpp_options_to_compile_flags(cpp_options), :
System command 'mingw32-make.exe' failed, exit status: 2, stderr (last 10 lines):
E> cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
E> cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
E> cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
E> cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
E> cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
E> cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
E> C:/Users/jd033/Documents/.cmdstanr/cmdstan-2.23.0/src/cmdstan/main.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
E> #include <stan/services/error_codes.hpp>
E>
E> mingw32-make.exe: *** [<builtin>: C:/Users/jd033/Documents/.cmdstanr/cmdstan-2.23.0/src/cmdstan/main.o] Error 1
Type .Last.error.trace to see where the error occured
- Operating System: Windows 10
- CmdStan Version:
> packageVersion("cmdstanr")
[1] ‘0.0.0.9008’
> packageVersion("StanHeaders")
[1] ‘2.21.0.6’
- Compiler/Toolkit: (not sure if
sessionInfo()
should cover this, but here’s the entire output)
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bayesplot_1.7.2 posterior_0.1.0 cmdstanr_0.0.0.9008
loaded via a namespace (and not attached):
[1] rstan_2.21.2 tinytex_0.24 tidyselect_1.1.0 xfun_0.15
[5] purrr_0.3.4 V8_3.2.0 colorspace_1.4-1 vctrs_0.3.2
[9] generics_0.0.2 htmltools_0.5.0 stats4_4.0.2 loo_2.3.1
[13] yaml_2.2.1 rlang_0.4.7 pkgbuild_1.1.0 pillar_1.4.6
[17] glue_1.4.1 plyr_1.8.6 matrixStats_0.56.0 lifecycle_0.2.0
[21] munsell_0.5.0 gtable_0.3.0 codetools_0.2-16 evaluate_0.14
[25] inline_0.3.15 knitr_1.29 callr_3.4.3 ps_1.3.3
[29] curl_4.3 parallel_4.0.2 fansi_0.4.1 Rcpp_1.0.5
[33] scales_1.1.1 backports_1.1.8 checkmate_2.0.0 RcppParallel_5.0.2
[37] StanHeaders_2.21.0-6 jsonlite_1.7.0 abind_1.4-5 gridExtra_2.3
[41] ggplot2_3.3.2 digest_0.6.25 processx_3.4.3 dplyr_1.0.0
[45] grid_4.0.2 cli_2.0.2 tools_4.0.2 magrittr_1.5
[49] tibble_3.0.3 crayon_1.3.4 pkgconfig_2.0.3 ellipsis_0.3.1
[53] prettyunits_1.1.1 ggridges_0.5.2 assertthat_0.2.1 rmarkdown_2.3
[57] rstudioapi_0.11 R6_2.4.1 compiler_4.0.2
I found some stackexchange question searching for the error message here, but I am not sure if following those steps will break something else.
Any help will be greatly appreciated. Thanks a lot !!