Error installing cmdstan 2.32.1 with R4.3 Rtools43

Hi,

I have run into a problem installing Cmdstan 2.32.1 from cmdstanr, using R 4.3 and rtools43. I’ve reproduced it on two separate machines with identical results.

I have tried rebuilding mingw (does not help). I can install cmdstan 2.31.0 w/o problems on the same setups (R4.3/rtools43).

When running install_cmdstan() I get the following output:

INFO: Could not find files for the given pattern(s).
cp bin/windows-stanc bin/stanc.exe
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/nvector/serial/nvector_serial.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/nvector/serial/nvector_serial.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_math.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_math.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodea_io.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bandpre.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bandpre.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bbdpre.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_bbdpre.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_diag.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_diag.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_direct.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_direct.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_io.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_ls.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_ls.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_sim.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_sim.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg1.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_nls_stg1.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_spils.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/cvodes/cvodes_spils.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_band.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_band.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_context.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_context.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_dense.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_dense.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_direct.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_direct.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_futils.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_futils.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_iterative.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_iterative.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_linearsolver.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_linearsolver.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_matrix.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_matrix.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_memory.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_memory.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nonlinearsolver.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nonlinearsolver.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector_senswrapper.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_nvector_senswrapper.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_version.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sundials/sundials_version.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/band/sunmatrix_band.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/band/sunmatrix_band.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/dense/sunmatrix_dense.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunmatrix/dense/sunmatrix_dense.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/band/sunlinsol_band.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/band/sunlinsol_band.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/dense/sunlinsol_dense.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunlinsol/dense/sunlinsol_dense.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/newton/sunnonlinsol_newton.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/newton/sunnonlinsol_newton.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idaa_io.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_bbdpre.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_bbdpre.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_direct.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_direct.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_ic.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_ic.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_io.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_ls.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_ls.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_nls.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_nls.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_nls_sim.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_nls_sim.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_nls_stg.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_nls_stg.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_spils.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/idas/idas_spils.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_bbdpre.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_bbdpre.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_direct.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_direct.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_io.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_io.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_ls.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_ls.o
g++ -pipe   -m64 -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DNO_FPRINTF_OUTPUT   -D_USE_MATH_DEFINES  -O3  -c -x c -include stan/lib/stan_math/lib/sundials_6.1.1/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_spils.c -o stan/lib/stan_math/lib/sundials_6.1.1/src/kinsol/kinsol_spils.o
if ! [[ mingw32-make.exe =~ mingw32 ]]; then \
	echo "ERROR: Please use mingw32-make on Windows to build the Intel TBB library."; \
	echo "This is packaged with RTools, for example."; \
	exit 1; \
fi
touch stan/lib/stan_math/lib/tbb/tbb-make-check

--- Compiling the main object file. This might take up to a minute. ---
g++ -Wno-nonnull -Wno-deprecated-declarations -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 -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I stan/lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.4.0 -I stan/lib/stan_math/lib/boost_1.78.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS          -c -o src/cmdstan/main.o src/cmdstan/main.cpp

--- Compiling pre-compiled header. This might take a few seconds. ---
g++ -Wno-nonnull -Wno-deprecated-declarations -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 -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I stan/lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.4.0 -I stan/lib/stan_math/lib/boost_1.78.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS          -c stan/src/stan/model/model_header.hpp -o stan/src/stan/model/model_header.hpp.gch
In file included from stan/lib/stan_math/stan/math/prim/prob/von_mises_lccdf.hpp:5,
                 from stan/lib/stan_math/stan/math/prim/prob/von_mises_ccdf_log.hpp:4,
                 from stan/lib/stan_math/stan/math/prim/prob.hpp:356,
                 from stan/lib/stan_math/stan/math/prim.hpp:16,
                 from stan/lib/stan_math/stan/math/rev.hpp:14,
                 from stan/lib/stan_math/stan/math.hpp:19,
                 from stan/src/stan/model/model_header.hpp:4:
stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp: In function 'stan::return_type_t<T_x, T_sigma, T_l> stan::math::von_mises_cdf(const T_x&, const T_mu&, const T_k&)':
stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
  194 |       if (cdf_n < 0.0)
      | 
stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
In file included from stan/lib/stan_math/stan/math/rev/fun.hpp:74,
                 from stan/lib/stan_math/stan/math/rev.hpp:10,
                 from stan/src/stan/model/log_prob_grad.hpp:4,
                 from src/cmdstan/command_helper.hpp:10,
                 from src/cmdstan/command.hpp:14,
                 from src/cmdstan/main.cpp:1:
stan/lib/stan_math/stan/math/rev/fun/generalized_inverse.hpp: In function 'auto stan::math::generalized_inverse(const VarMat&)':
stan/lib/stan_math/stan/math/rev/fun/generalized_inverse.hpp:67: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
   67 |   if (G.size() == 0)
      | 
stan/lib/stan_math/stan/math/rev/fun/generalized_inverse.hpp:67: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
mingw32-make: *** [make/program:14: src/cmdstan/main.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....

Don’t know if this is helpful, but if I try to force a compile using the demo installation model, this is the 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).

ar: 
creating stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_nvecserial.a

ar: 
creating stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_cvodes.a

ar: 
creating stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_idas.a

ar: 
creating stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_kinsol.a

In file included from stan/lib/stan_math/stan/math/rev/fun.hpp:74,
                 from stan/lib/stan_math/stan/math/rev.hpp:10,
                 from stan/src/stan/model/log_prob_grad.hpp:4,
                 from src/cmdstan/command_helper.hpp:10,
                 from src/cmdstan/command.hpp:14,
                 from src/cmdstan/main.cpp:1:
stan/lib/stan_math/stan/math/rev/fun/generalized_inverse.hpp: In function 'auto stan::math::generalized_inverse(const VarMat&)':
stan/lib/stan_math/stan/math/rev/fun/generalized_inverse.hpp:67: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
   67 |   if (G.size() == 0)
      | 

stan/lib/stan_math/stan/math/rev/fun/generalized_inverse.hpp:67: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory

mingw32-make: *** [make/program:14: src/cmdstan/main.o] Error 1

Error: An error occured during compilation! See the message above for more information.
In addition: Warning message:
In readLines(hpp_path) :
  incomplete final line found on 'C:/Users/phili/AppData/Local/Temp/RtmpG8Xyvy/model-7abc99a7a95.hpp'

Appreciate any pointers,

Thanks
Philip

Hi,

Thanks for parnamets opened this topic. I got almost same error but on different version.

I try to install cmdstan-2.32.1 with R4.2.2 and Rtools42 on window 11 system. I make sure that wingw32-make is in the environment PATH. Then I use

check_cmdstan_toolchain()
install_cmdstan(cores = 4)

The first comment gives me:

The C++ toolchain required for CmdStan is setup properly!

But the installation return with a long message with errors:

The C++ toolchain required for CmdStan is setup properly!
* Latest CmdStan release is v2.32.1
* Installing CmdStan v2.32.1 in C:\Users\jc817859\OneDrive - James Cook University\Documents/.cmdstan/cmdstan-2.32.1
* Downloading cmdstan-2.32.1.tar.gz from GitHub...
* Download complete
* Unpacking archive...
* Building CmdStan binaries...
INFO: Could not find files for the given pattern(s).

cp bin/windows-stanc bin/stanc.exe

I skip several lines character limitation. The error seems to appear here.

mingw32-make: *** [make/program:14: src/cmdstan/main.o] Error 1

mingw32-make: *** Waiting for unfinished jobs....

g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/backend.cpp

g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/large_objects.cpp

g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/backref.cpp

g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/tbbmalloc.cpp

g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -o itt_notify_malloc.o -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/itt_notify.cpp

cmd /C cscript /nologo /E:jscript ../tbb_2020.3/build/version_info_windows.js gcc intel64 "g++ -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm  -Wall -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1  -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include" > version_string.ver

g++ -E -x c++ ../tbb_2020.3/src/tbbmalloc/win64-gcc-tbbmalloc-export.def -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm  -Wall -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1  -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include > tbbmalloc.def

g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm  -Wall -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1  -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -D__TBBMALLOC_BUILD=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/proxy.cpp

g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm  -Wall -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1  -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -D__TBBMALLOC_BUILD=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/tbb_function_replacement.cpp

In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/multi_array/multi_array_ref.hpp:32,
                 from stan/lib/stan_math/lib/boost_1.78.0/boost/multi_array.hpp:34,
                 from stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/algebra/multi_array_algebra.hpp:22,
                 from stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint.hpp:63,
                 from stan/lib/stan_math/stan/math/prim/functor/ode_rk45.hpp:9,
                 from stan/lib/stan_math/stan/math/prim/functor/integrate_ode_rk45.hpp:6,
                 from stan/lib/stan_math/stan/math/prim/functor.hpp:15,
                 from stan/lib/stan_math/stan/math/prim.hpp:15,
                 from stan/src/stan/io/stan_csv_reader.hpp:5,
                 from stan/src/stan/mcmc/chains.hpp:4,
                 from src/cmdstan/stansummary_helper.hpp:4,
                 from src/cmdstan/diagnose.cpp:1:
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:180:45: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  180 |         : public boost::functional::detail::unary_function<typename unary_traits<Predicate>::argument_type,bool>
      |                                             ^~~~~~~~~~~~~~
In file included from C:/rtools42/ucrt64/include/c++/13.1.0/string:49,
                 from stan/lib/stan_math/lib/boost_1.78.0/boost/algorithm/string/std/string_traits.hpp:15,
                 from stan/lib/stan_math/lib/boost_1.78.0/boost/algorithm/string/std_containers_traits.hpp:19,
                 from stan/lib/stan_math/lib/boost_1.78.0/boost/algorithm/string.hpp:18,
                 from stan/src/stan/io/stan_csv_reader.hpp:4:
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:214:45: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
  214 |         : public boost::functional::detail::binary_function<
      |                                             ^~~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:252:45: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  252 |         : public boost::functional::detail::unary_function<
      |                                             ^~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:299:45: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  299 |         : public boost::functional::detail::unary_function<
      |                                             ^~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:345:57: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  345 |     class mem_fun_t : public boost::functional::detail::unary_function<T*, S>
      |                                                         ^~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:361:58: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
  361 |     class mem_fun1_t : public boost::functional::detail::binary_function<T*, A, S>
      |                                                          ^~~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:377:63: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  377 |     class const_mem_fun_t : public boost::functional::detail::unary_function<const T*, S>
      |                                                               ^~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:393:64: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
  393 |     class const_mem_fun1_t : public boost::functional::detail::binary_function<const T*, A, S>
      |                                                                ^~~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:438:61: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  438 |     class mem_fun_ref_t : public boost::functional::detail::unary_function<T&, S>
      |                                                             ^~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:454:62: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
  454 |     class mem_fun1_ref_t : public boost::functional::detail::binary_function<T&, A, S>
      |                                                              ^~~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:470:67: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  470 |     class const_mem_fun_ref_t : public boost::functional::detail::unary_function<const T&, S>
      |                                                                   ^~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:487:68: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
  487 |     class const_mem_fun1_ref_t : public boost::functional::detail::binary_function<const T&, A, S>
      |                                                                    ^~~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:533:73: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
  533 |     class pointer_to_unary_function : public boost::functional::detail::unary_function<Arg,Result>
      |                                                                         ^~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:557:74: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
  557 |     class pointer_to_binary_function : public boost::functional::detail::binary_function<Arg1,Arg2,Result>
      |                                                                          ^~~~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/13.1.0/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -U__MSVCRT_VERSION__ -D__MSVCRT_VERSION__=0x0E00 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor  -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc -I. ../tbb_2020.3/src/tbbmalloc/frontend.cpp

gcc  -o tbbmalloc.dll backend.o large_objects.o backref.o  tbbmalloc.o  itt_notify_malloc.o frontend.o   -lpsapi -shared -m64 -Wl,-L,"C:/Users/jc817859/OneDrive - James Cook University/Documents/.cmdstan/cmdstan-2.32.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/jc817859/OneDrive - James Cook University/Documents/.cmdstan/cmdstan-2.32.1/stan/lib/stan_math/lib/tbb"   -Wl,--version-script,tbbmalloc.def

g++  -o tbbmalloc_proxy.dll proxy.o tbb_function_replacement.o   -lpsapi tbbmalloc.dll  -shared -m64 -Wl,-L,"C:/Users/jc817859/OneDrive - James Cook University/Documents/.cmdstan/cmdstan-2.32.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/jc817859/OneDrive - James Cook University/Documents/.cmdstan/cmdstan-2.32.1/stan/lib/stan_math/lib/tbb"  

mingw32-make[1]: Leaving directory 'C:/Users/jc817859/OneDrive - James Cook University/Documents/.cmdstan/cmdstan-2.32.1/stan/lib/stan_math/lib/tbb'


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

I also tried to install cmdstan manually, but while I am trying the testing model from this page. It gave me error related to wingw32-make.

mingw32-make: *** [make/program:14: src/cmdstan/main.o] Error 1

Any suggestion is appreciated!!

I can also re-create this error locally. It does not seem to occur if you use an older version of CmdStan (2.31) or an older version of RTools (40) and needs more investigation

2 Likes

Thanks a lot for your reply. I tried to manually install cmdstan2.31.0 and run the example model in R 4.2.2 with rtool42. The error change to these two below.

mingw32-make[1]: *** [C:/Users/jc817859/OneDrive - James Cook University/Documents/.cmdstan/cmdstan-2.31.0/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbbmalloc:65: backend.o] Error 1

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

Just some additional information. Sys.getenv(“PATH”) gives me a messy and duplicate list as below.

[1] "C:\\rtools42\\x86_64-w64-mingw32.static.posix\\bin;
C:\\rtools42\\usr\\bin;
C:\\Program Files (x86)\\Amazon Corretto\\jdk1.8.0_272\\bin;
C:\\Windows\\System32;
C:\\Windows;
C:\\Windows\\System32\\wbem;
C:\\Windows\\System32\\WindowsPowerShell\\v1.0;
C:\\Windows\\System32\\OpenSSH;
C:\\Program Files\\PuTTY;
C:\\Windows;
C:\\Windows\\System32;
C:\\Windows\\System32\\wbem;
C:\\rtools42\\usr\\bin;
C:\\Program Files (x86)\\Amazon Corretto\\jdk1.8.0_272\\bin;
C:\\Windows\\System32;
C:\\Windows;C:\\Windows\\System32\\wbem;
C:\\Windows\\System32\\WindowsPowerShell\\v1.0;
C:\\Windows\\System32\\OpenSSH;
C:\\Program Files\\PuTTY;
C:\\mingw64\\bin;
C:\\Program Files (x86)\\Amazon Corretto\\jdk1.8.0_272\\bin;
C:\\Windows\\System32;
C:\\Windows;
C:\\Windows\\System32\\wbem;
C:\\Windows\\System32\\WindowsPowerShell\\v1.0;
C:\\Windows\\System32\\OpenSSH;
C:\\Program Files\\PuTTY;
C:\\Users\\jc817859\\Anaconda3;
C:\\Users\\jc817859\\Anaconda3\\Library\\mingw-w64\\bin;
C:\\Users\\jc817859\\Anaconda3\\Library\\usr\\bin;
C:\\Users\\jc817859\\Anaconda3\\Library\\bin;
C:\\Users\\jc817859\\Anaconda3\\Scripts;
C:\\Users\\jc817859\\AppData\\Local\\Microsoft\\WindowsApps;
C:\\Users\\jc817859\\AppData\\Local\\Programs\\Git\\cmd;
C:\\cmdstan-2.32.1\\bin;C:\\cmdstan-2.32.1\\bin"

Any suggestion? Thank you.

The make program we use for building generally does very poorly if there are spaces in the folder paths it is working with

Thanks for your suggestion.
I restructured the backup plan and got rid of the folder with space. Still I have some other problems.
At the end I follow multiple threads to set up environment PATH, install mingw32-make and gcc in Rtool42. Finally reinstall cmdstan 2.32.1 through cmdstanr. It works this time!!

Just to clarify - you are using Rtool42, so this doesn’t resolve my original issue (cmdstan 2.321, w rtools 43), correct?

Yes, I am using Rtool42 with R4.2.2. The error messages were exactly the same. It might be worth looking into those threads in the link.

An update! I tried again today on a third computer and on one of the previous systems after a clean reinstall. In both cases it worked. Still following only the basic steps from the cmdstan user guide for path and setup of rtools.

Looking at Package: mingw-w64-x86_64-gcc - MSYS2 Packages , it looks like this was updated 10 May, reverting some changes gcc: revert recent changes · msys2/MINGW-packages@7e39629 · GitHub . This all matches it not working for me in OP 9th May, but working for @ChiehTony after his updating mingw32 11th May as reported above.

In conclusion: it was all probably a weird one-off gcc error, but now seems to be fixed.

Interesting! I have also been unable to recreate the issue again after I could at first. My best guess is it was a hidden out of memory error or other internal crash inside gcc, and trying again under different circumstances “fixed” it