Cmdstanr error: cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in

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 !!

Hi,

It seems that you have another mingw installation that is clashing with the rtools 4.0 mingw installation. The gcc version you are seeing is 6.3.0, but you should be seeing 8.1.

Remove any path that starts with c:/mingw from your PATH environment variable. Then close and open a new shell and check g++ —version. If its 8.1 you are good to go.

1 Like

Thanks @rok_cesnovar !
I have removed C:/mingW/… from PATH & now running g++ --version on a new shell shows 8.3.0, but now if I run install_cmdstan, with overwrite = TRUE, it gives me a very long error message :

> install_cmdstan(overwrite = TRUE)
* Latest CmdStan release is v2.23.0
* Installing CmdStan v2.23.0 in C:\Users\jd033\Documents/.cmdstanr/cmdstan-2.23.0
* Downloading cmdstan-2.23.0.tar.gz from GitHub...
* Removing the existing installation of CmdStan...
* Download complete
* Unpacking archive...
* Building CmdStan binaries...
INFO: Could not find files for the given pattern(s).
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT src/cmdstan/stanc.o -M -E -MG -MP -MF src/cmdstan/stanc.d src/cmdstan/stanc.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/ast_def.o -MT stan/src/stan/lang/ast_def.d -M -E -MG -MP -MF stan/src/stan/lang/ast_def.d stan/src/stan/lang/ast_def.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/semantic_actions_def.o -MT stan/src/stan/lang/grammars/semantic_actions_def.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/semantic_actions_def.d stan/src/stan/lang/grammars/semantic_actions_def.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/program_grammar_inst.o -MT stan/src/stan/lang/grammars/program_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/program_grammar_inst.d stan/src/stan/lang/grammars/program_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/expression_grammar_inst.o -MT stan/src/stan/lang/grammars/expression_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/expression_grammar_inst.d stan/src/stan/lang/grammars/expression_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/statement_grammar_inst.o -MT stan/src/stan/lang/grammars/statement_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/statement_grammar_inst.d stan/src/stan/lang/grammars/statement_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/expression07_grammar_inst.o -MT stan/src/stan/lang/grammars/expression07_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/expression07_grammar_inst.d stan/src/stan/lang/grammars/expression07_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/statement_2_grammar_inst.o -MT stan/src/stan/lang/grammars/statement_2_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/statement_2_grammar_inst.d stan/src/stan/lang/grammars/statement_2_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/block_var_decls_grammar_inst.o -MT stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d stan/src/stan/lang/grammars/block_var_decls_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/indexes_grammar_inst.o -MT stan/src/stan/lang/grammars/indexes_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/indexes_grammar_inst.d stan/src/stan/lang/grammars/indexes_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/local_var_decls_grammar_inst.o -MT stan/src/stan/lang/grammars/local_var_decls_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/local_var_decls_grammar_inst.d stan/src/stan/lang/grammars/local_var_decls_grammar_inst.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/whitespace_grammar_inst.o -MT stan/src/stan/lang/grammars/whitespace_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/whitespace_grammar_inst.d stan/src/stan/lang/grammars/whitespace_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/bare_type_grammar_inst.o -MT stan/src/stan/lang/grammars/bare_type_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/bare_type_grammar_inst.d stan/src/stan/lang/grammars/bare_type_grammar_inst.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/term_grammar_inst.o -MT stan/src/stan/lang/grammars/term_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/term_grammar_inst.d stan/src/stan/lang/grammars/term_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -MT bin/cmdstan/lang/grammars/functions_grammar_inst.o -MT stan/src/stan/lang/grammars/functions_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/functions_grammar_inst.d stan/src/stan/lang/grammars/functions_grammar_inst.cpp
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -o bin/cmdstan/print.o src/cmdstan/print.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs      -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS      -c -o bin/cmdstan/stansummary.o src/cmdstan/stansummary.cpp
src/cmdstan/print.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
 #include <algorithm>
 
src/cmdstan/stansummary.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
 #include <algorithm>
 
mingw32-make.exe: *** [make/command:4: bin/cmdstan/print.o] Error 1
mingw32-make.exe: *** Waiting for unfinished jobs....
mingw32-make.exe: *** [make/command:4: bin/cmdstan/stansummary.o] Error 1

Warning message:
There was a problem during installation. See the error message(s) above. 

Thanks again !

This seems to use the 32-bit mingw instead of the 64-bit one. Could you post a screenshot what you have in you PATH environment. Or just post the PATH environment.

I restarted my computer, removed older cmdstanr installation and installed everything again, and now install_cmdstan gives a few pages of warning messages (pasted a part below), but it does seems to sample.

Thanks a lot !

FWIW, here’s the screenshot of PATH (in case someone has the same problem).

and here’s a random selection of the warning message that I get before it starts working:

In file included from stan/lib/stan_math/lib/eigen_3.3.3/Eigen/Core:420,
                 from stan/lib/stan_math/lib/eigen_3.3.3/Eigen/Dense:1,
                 from stan/lib/stan_math/stan/math/prim/fun/Eigen.hpp:22,
                 from stan/lib/stan_math/stan/math/rev.hpp:4,
                 from stan/lib/stan_math/stan/math.hpp:19,
                 from stan/src/stan/model/model_header.hpp:4,
                 from examples/bernoulli/bernoulli.hpp:3:
stan/lib/stan_math/lib/eigen_3.3.3/Eigen/src/Core/AssignEvaluator.h:90:50: warning: enum constant in boolean context [-Wint-in-bool-context]
     MaySliceVectorize  = bool(MightVectorize) && bool(DstHasDirectAccess)
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from stan/lib/stan_math/lib/eigen_3.3.3/Eigen/Core:420,
                 from stan/lib/stan_math/lib/eigen_3.3.3/Eigen/Dense:1,
                 from stan/lib/stan_math/stan/math/prim/fun/Eigen.hpp:22,
                 from stan/lib/stan_math/stan/math/rev.hpp:4,
                 from stan/lib/stan_math/stan/math.hpp:19,
                 from stan/src/stan/model/model_header.hpp:4,
                 from examples/bernoulli/bernoulli.hpp:3:
stan/lib/stan_math/lib/eigen_3.3.3/Eigen/src/Core/AssignEvaluator.h: In instantiation of 'struct Eigen::internal::copy_using_evaluator_traits<Eigen::internal::evaluator<Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false> >, Eigen::internal::evaluator<Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false> >, Eigen::internal::assign_op<double, double> >':
stan/lib/stan_math/lib/eigen_3.3.3/Eigen/src/Core/AssignEvaluator.h:607:49:   required from 'class Eigen::internal::generic_dense_assignment_kernel<Eigen::internal::evaluator<Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false> >, Eigen::internal::evaluator<Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false> >, Eigen::internal::assign_op<double, double>, 0>'
stan/lib/stan_math/lib/eigen_3.3.3/Eigen/src/Core/AssignEvaluator.h:739:10:   required from 'void Eigen::internal::call_dense_assignment_loop(DstXprType&, const SrcXprType&, const Functor&) [with DstXprType = Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false>; SrcXprType = Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false>; Functor = Eigen::internal::assign_op<double, double>]'
1 Like

Great!

The warnings are expected for the 2.23 Cmdstan version. g++ 8 warns for some of the code in the downstream libraries we use. You can run the following once to make the warnings go away:

cmdstan_make_local(cpp_options = "CXXFLAGS += --Wno-int-in-bool-context", append = TRUE)

2 Likes