R 4.3, rstan 2.26.22, windows, github actions -- errors when compiling models from package

I believe this is related to R 4.3 but could be wrong. package tests for ctsem on github actions that use the current cran (2.21.x) version of Rstan on windows pass, because tests that use model specifications that require recompiling are disabled, since rstan 2.21 doesn’t compile on recent versions of R. I have a test setup that installs the most up to date rstan from the stan repository, and previously models that required compiling worked fine on this. Currently, this is broken on windows and I can’t see why. When I test a similar setup – win 11, R 4.3, rstan 2.26.22, on my personal machine, things are fine. Any ideas out there?

Full test results here – .. · cdriveraus/ctsem@66f9521 · GitHub

Error here:

Error in `compileCode(f, code, language = language, verbose = verbose)`: C:/Users/runneradmin/AppData/Local/Temp/RtmpWyNCEE/RLIBS_41c31067cd2/RcppEigen/include/Eigen/src/Core/products/TriangularMatrixVector.h:105:24: note: by argument 5 of type 'const double*' to 'static void Eigen::internal::triangular_matrix_vector_product<Index, Mode, LhsScalar, ConjLhs, RhsScalar, ConjRhs, 1, Version>::run(Index, Index, const LhsScalar*, Index, const RhsScalar*, Index, ResScalar*, Index, const ResScalar&) [with Index = long long int; int Mode = 6; LhsScalar = double; bool ConjLhs = false; RhsScalar = double; bool ConjRhs = false; int Version = 0]' declared here  105 | EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,RowMajor,Version>      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1plus.exe: out of memory allocating 65536 bytesmake: *** [C:/R/etc/x64/Makeconf:272: file754689033fa.o] Error 1
Backtrace:
    ▆
 1. ├─base::do.call(ctStanFit, argslist[[argi]]) at test-timevarying.R:59:8
 2. └─ctsem (local) `<fn>`(datalong = `<dbl[,4]>`, ctstanmodel = `<ctStnMdl>`)
 3.   └─rstan::stan_model(...) at ctsem/R/ctStanFit.R:650:6
 4.     └─rstan:::cxxfunctionplus(...) at rstan/R/rstan.R:179:2
 5.       ├─pkgbuild::with_build_tools(...) at rstan/R/cxxfunplus.R:174:2
 6.       │ └─withr::with_path(rtools_path(), code)
 7.       │   └─base::force(code)
 8.       └─inline::cxxfunction(...) at rstan/R/cxxfunplus.R:174:2
 9.         └─inline:::compileCode(f, code, language = language, verbose = verbose)
── Error ('test-timevarying.R:59:9'): varyingLAMBDA ────────────────────────────
Error in `sink(type = "output")`: invalid connection
Backtrace:
    ▆
 1. ├─base::do.call(ctStanFit, argslist[[argi]]) at test-timevarying.R:59:8
 2. └─ctsem (local) `<fn>`(datalong = `<dbl[,4]>`, ctstanmodel = `<ctStnMdl>`)
 3.   └─rstan::stan_model(...) at ctsem/R/ctStanFit.R:650:6
 4.     └─rstan:::cxxfunctionplus(...) at rstan/R/rstan.R:179:2
 5.       └─base::sink(type = "output") at rstan/R/rstan.R:179:2
── Error ('test-timevarying.R:132:5'): higherDimNonLinearCompileCheck ──────────
Error in `compileCode(f, code, language = language, verbose = verbose)`: C:/Users/runneradmin/AppData/Local/Temp/RtmpWyNCEE/RLIBS_41c31067cd2/RcppEigen/include/Eigen/src/Core/products/TriangularMatrixVector.h:105:24: note: by argument 5 of type 'const double*' to 'static void Eigen::internal::triangular_matrix_vector_product<Index, Mode, LhsScalar, ConjLhs, RhsScalar, ConjRhs, 1, Version>::run(Index, Index, const LhsScalar*, Index, const RhsScalar*, Index, ResScalar*, Index, const ResScalar&) [with Index = long long int; int Mode = 6; LhsScalar = double; bool ConjLhs = false; RhsScalar = double; bool ConjRhs = false; int Version = 0]' declared here  105 | EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,RowMajor,Version>      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1plus.exe: out of memory allocating 868320 bytesmake: *** [C:/R/etc/x64/Makeconf:272: file75471c8636c.o] Error 1
Backtrace:
    ▆
 1. └─ctsem::ctStanFit(datalong = d, ctstanmodel = test_) at test-timevarying.R:132:4
 2.   └─rstan::stan_model(...) at ctsem/R/ctStanFit.R:650:6
 3.     └─rstan:::cxxfunctionplus(...) at rstan/R/rstan.R:179:2
 4.       ├─pkgbuild::with_build_tools(...) at rstan/R/cxxfunplus.R:174:2
 5.       │ └─withr::with_path(rtools_path(), code)
 6.       │   └─base::force(code)
 7.       └─inline::cxxfunction(...) at rstan/R/cxxfunplus.R:174:2
 8.         └─inline:::compileCode(f, code, language = language, verbose = verbose)
── Error ('test-timevarying.R:132:5'): higherDimNonLinearCompileCheck ──────────
Error in `sink(type = "output")`: invalid connection
Backtrace:
    ▆
 1. └─ctsem::ctStanFit(datalong = d, ctstanmodel = test_) at test-timevarying.R:132:4
 2.   └─rstan::stan_model(...) at ctsem/R/ctStanFit.R:650:6
 3.     └─rstan:::cxxfunctionplus(...) at rstan/R/rstan.R:179:2
 4.       └─base::sink(type = "output") at rstan/R/rstan.R:179:2
── Error ('test_behavGenNLcor.R:211:5'): behavGenNLcor ─────────────────────────
Error in `compileCode(f, code, language = language, verbose = verbose)`: C:/Users/runneradmin/AppData/Local/Temp/RtmpWyNCEE/RLIBS_41c31067cd2/RcppEigen/include/Eigen/src/Core/products/TriangularMatrixVector.h:105:24: note: by argument 5 of type 'const double*' to 'static void Eigen::internal::triangular_matrix_vector_product<Index, Mode, LhsScalar, ConjLhs, RhsScalar, ConjRhs, 1, Version>::run(Index, Index, const LhsScalar*, Index, const RhsScalar*, Index, ResScalar*, Index, const ResScalar&) [with Index = long long int; int Mode = 6; LhsScalar = double; bool ConjLhs = false; RhsScalar = double; bool ConjRhs = false; int Version = 0]' declared here  105 | EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,RowMajor,Version>      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1plus.exe: out of memory allocating 11153448 bytesmake: *** [C:/R/etc/x64/Makeconf:272: file754758b4f89.o] Error 1
Backtrace:
    ▆
 1. └─ctsem::ctStanFit(...) at test_behavGenNLcor.R:211:4
 2.   └─rstan::stan_model(...) at ctsem/R/ctStanFit.R:650:6
 3.     └─rstan:::cxxfunctionplus(...) at rstan/R/rstan.R:179:2
 4.       ├─pkgbuild::with_build_tools(...) at rstan/R/cxxfunplus.R:174:2
 5.       │ └─withr::with_path(rtools_path(), code)
 6.       │   └─base::force(code)
 7.       └─inline::cxxfunction(...) at rstan/R/cxxfunplus.R:174:2
 8.         └─inline:::compileCode(f, code, language = language, verbose = verbose)
── Error ('test_behavGenNLcor.R:211:5'): behavGenNLcor ─────────────────────────
Error in `sink(type = "output")`: invalid connection
Backtrace:
    ▆
 1. └─ctsem::ctStanFit(...) at test_behavGenNLcor.R:211:4
 2.   └─rstan::stan_model(...) at ctsem/R/ctStanFit.R:650:6
 3.     └─rstan:::cxxfunctionplus(...) at rstan/R/rstan.R:179:2
 4.       └─base::sink(type = "output") at rstan/R/rstan.R:179:2

It’s a RAM issue:

cc1plus.exe: out of memory allocating 11153448

Are you compiling multiple models at once or similar?

Oh. Somehow I saw that but assumed the problem was elsewhere. Slow this morning! :) No, just compiling the one model. I can disable any such compile requiring tests on github, just seemed strange that it was previously working.