Loo_moment_match not working with brms model fit using cmdstanr

I’m fitting categorical models, with 2 varying-intercept terms and about 30 population-level parameters. I recently managed to install cmdstanr and immediately experienced a major speedup in model fitting, which is awesome.

However, part of this improvement is offset by the fact that loo_moment_match() appears to have stopped working since I migrated to cmdstanr. Here’s the very messy error:

> loo_moment_match(mod00, loo = mod00_loo)

Recompiling the model with 'rstan'
make cmd is
  make -f "C:/PROGRA~1/R/R-42~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-42~1.1/share/make/winshlib.mk" CXX='$(CXX14) $(CXX14STD)' CXXFLAGS='$(CXX14FLAGS)' CXXPICFLAGS='$(CXX14PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX14LDFLAGS)' SHLIB_LD='$(SHLIB_CXX14LD)' SHLIB="file1cd0a6514e4.dll" WIN=64 TCLBIN= OBJECTS="file1cd0a6514e4.o"

make would use
if test "zfile1cd0a6514e4.o" != "z"; then \
  if test -e "file1cd0a6514e4-win.def"; then \
    echo g++  -shared -s -static-libgcc -o file1cd0a6514e4.dll file1cd0a6514e4-win.def file1cd0a6514e4.o  -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib"  -L"C:/PROGRA~1/R/R-42~1.1/bin/x64" -lR ; \
    g++  -shared -s -static-libgcc -o file1cd0a6514e4.dll file1cd0a6514e4-win.def file1cd0a6514e4.o  -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib"  -L"C:/PROGRA~1/R/R-42~1.1/bin/x64" -lR ; \
  else \
    echo EXPORTS > tmp.def; \
    nm file1cd0a6514e4.o | sed -n 's/^.* [BCDRT] / /p' | sed -e '/[.]refptr[.]/d' -e '/[.]weak[.]/d' | sed 's/[^ ][^ ]*/"&"/g'  >> tmp.def; \
    echo g++  -shared -s -static-libgcc -o file1cd0a6514e4.dll tmp.def file1cd0a6514e4.o  -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib"  -L"C:/PROGRA~1/R/R-42~1.1/bin/x64" -lR ; \
    g++  -shared -s -static-libgcc -o file1cd0a6514e4.dll tmp.def file1cd0a6514e4.o  -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"c:/rtools42/x86_64-w64-mingw32.static.posix/lib"  -L"C:/PROGRA~1/R/R-42~1.1/bin/x64" -lR ; \
    rm -f tmp.def; \
  fi \
fi
Error in compileCode(f, code, language = language, verbose = verbose) : 
  C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file1cd0a6514e4.o:file1cd0a6514e4.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D1Ev[_ZN3tbb8internal26task_scheduler_observer_v3D1Ev]+0x14): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file1cd0a6514e4.o:file1cd0a6514e4.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D0Ev[_ZN3tbb8internal26task_scheduler_observer_v3D0Ev]+0x1c): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file1cd0a6514e4.o:file1cd0a6514e4.cpp:(.text$_ZN3tbb10interface623task_scheduler_observerD0Ev[_ZN3tbb10interface623task_scheduler_observerD0Ev]+0x1c): undefined reference to `tbb::internal::task_scheduler_observer_v3::
In addition: Warning messages:
1: The global prior 'exponential(2)' of class 'sd' will not be used in the model as all related coefficients have individual priors already. If you did not set those priors yourself, then maybe brms has assigned default priors. See ?set_prior and ?get_prior for more details. 
2: The global prior 'exponential(2)' of class 'sd' will not be used in the model as all related coefficients have individual priors already. If you did not set those priors yourself, then maybe brms has assigned default priors. See ?set_prior and ?get_prior for more details. 
 Error in compileCode(f, code, language = language, verbose = verbose) : 
C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file1cd0a6514e4.o:file1cd0a6514e4.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D1Ev[_ZN3tbb8internal26task_scheduler_observer_v3D1Ev]+0x14): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file1cd0a6514e4.o:file1cd0a6514e4.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D0Ev[_ZN3tbb8internal26task_scheduler_observer_v3D0Ev]+0x1c): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file1cd0a6514e4.o:file1cd0a6514e4.cpp:(.text$_ZN3tbb10interface623task_scheduler_observerD0Ev[_ZN3tbb10interface623task_scheduler_observerD0Ev]+0x1c): undefined reference to `tbb::internal::task_scheduler_observer_v3::
 Error in sink(type = "output") : invalid connection

Below is my session info:

R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 
 
locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

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

other attached packages:
[1] beepr_1.3      cmdstanr_0.5.3 brms_2.17.0    Rcpp_1.0.9    

Any idea what’s wrong?

loo_moment_match() requires access to the log density function and it’s gradient, which are not yet available in CmdStanR. That’s why brms tries to use RStan as indicated by the output you posted

It seems your RStan installation plus available compiler are not working. You could try installing a more recent RStan from Repository for distributing (some) stan-dev R packages | r-packages

1 Like

I updated RStan to version 2.26.13 following the instructions on that page. It definitely did something: now there’s no longer an error message from loo_moment_match(). Instead, the whole RStudio session crashes.

Any further suggestions?

Does this post help ? Rstan crashing in Windows - #2 by andrjohns

1 Like

Well, at least it helped me graduate to the next problem. Updating RTools from 4.0 to 4.2 seems to have fixed loo_moment_match(), which now ran without incident for the first time. It then complained about high pareto-k values, and so I turned to loo(reloo = TRUE), which seems to now have stopped working. The error message is extremely long and messy:

Error : An error occured during compilation! See the message above for more information.
Compiling Stan program...
In file included from stan/lib/stan_math/stan/math/rev/functor.hpp:29,
                 from stan/lib/stan_math/stan/math/rev.hpp:11,
                 from stan/lib/stan_math/stan/math.hpp:19,
                 from stan/src/stan/model/model_header.hpp:4,
                 from C:/Rtemp/RtmpOEpubY/model-14185bc1480c.hpp:3:
stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp: In instantiation of 'stan::math::internal::reduce_sum_impl<ReduceFunction, typename std::enable_if<stan::is_var<typename std::decay<_Tp2>::type, void>::value, void>::type, ReturnType, Vec, Args ...>::recursive_reducer::recursive_reducer(size_t, size_t, double*, VecT&&, ArgsT&& ...) [with VecT = const std::vector<int>&; ArgsT = {const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&,
 const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&}; ReduceFunction = model_264c62b4e48d42677858c6bf987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>; ReturnType = stan::math::var_value<double>; Vec = const std::vector<int>&; Args = {const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, c
onst std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&}; size_t = long long unsigned int]':
stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp:249:23:   required from 'stan::math::var stan::math::internal::reduce_sum_impl<ReduceFunction, typename std::enable_if<stan::is_var<typename std::decay<_Tp2>::type, void>::value, void>::type, ReturnType, Vec, Args ...>::operator()(Vec&&, bool, int, std::ostream*, Args&& ...) const [with ReduceFunction = model_264c62b4e48d42677858c6bf987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>; ReturnType = stan::math::var_value<double>; Vec = const std::vector<int>&; Args = {const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>
, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&}; typename std::enable_if<stan::is_var<typename std::decay<_Tp2>::type, void>::value, void>::type = void; stan::math::var = stan::math::var_value<double>; std::ostream = std::basic_ostream<char>]'
stan/lib/stan_math/stan/math/prim/functor/reduce_sum.hpp:208:60:   required from 'auto stan::math::reduce_sum(Vec&&, int, std::ostream*, Args&& ...) [with ReduceFunction = model_264c62b4e48d42677858c6bf987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>; Vec = const std::vector<int>&; <template-parameter-1-3> = void; Args = {const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<
0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&}; std::ostream = std::basic_ostream<char>]'
C:/Rtemp/RtmpOEpubY/model-14185bc1480c.hpp:3049:76:   required from 'stan::scalar_type_t<T2> model_264c62b4e48d42677858c6bf987a113e_model_namespace::model_264c62b4e48d42677858c6bf987a113e_model::log_prob_impl(VecR&, VecI&, std::ostream*) const [with bool propto__ = false; bool jacobian__ = false; VecR = Eigen::Matrix<stan::math::var_value<double>, -1, 1>; VecI = Eigen::Matrix<int, -1, 1>; stan::require_vector_like_t<VecR>* <anonymous> = 0; stan::require_vector_like_vt<std::is_integral, VecI>* <anonymous> = 0; stan::scalar_type_t<T2> = stan::
math::var_value<double>; std::ostream = std::basic_ostream<char>]'
C:/Rtemp/RtmpOEpubY/model-14185bc1480c.hpp:4739:49:   required from 'T_ model_264c62b4e48d42677858c6bf987a113e_model_namespace::model_264c62b4e48d42677858c6bf987a113e_model::log_prob(Eigen::Matrix<T_job_param, -1, 1>&, std::ostream*) const [with bool propto__ = false; bool jacobian__ = false; T_ = stan::math::var_value<double>; std::ostream = std::basic_ostream<char>]'
stan/src/stan/model/model_base_crtp.hpp:95:72:   required from 'stan::math::var stan::model::model_base_crtp<M>::log_prob(Eigen::Matrix<stan::math::var_value<double>, -1, 1>&, std::ostream*) const [with M = model_264c62b4e48d42677858c6bf987a113e_model_namespace::model_264c62b4e48d42677858c6bf987a113e_model; stan::math::var = stan::math::var_value<double>; std::ostream = std::basic_ostream<char>]'
stan/src/stan/model/model_base_crtp.hpp:93:20:   required from here
stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp:58:23: warning: 'stan::math::internal::reduce_sum_impl<model_264c62b4e48d42677858c6bf987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>, void, stan::math::var_value<double>, const std::vector<int>&, const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, 
-1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&>::recursive_reducer::local_args_tuple_scope_' will be initialized after [-Wreorder]
   58 |     scoped_args_tuple local_args_tuple_scope_;
      |                       ^~~~~~~~~~~~~~~~~~~~~~~

stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp:57:25: warning:   'std::tuple<const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&> stan::math::internal::reduce_sum_impl<model_264c62b4e48d42677858c6b
f987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>, void, stan::math::var_value<double>, const std::vector<int>&, const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&>::recursive_reducer::arg
s_tuple_' [-Wreorder]
   57 |     std::tuple<Args...> args_tuple_;
      |                         ^~~~~~~~~~~
stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp:63:5: warning:   when initialized here [-Wreorder]
   63 |     recursive_reducer(size_t num_vars_per_term, size_t num_vars_shared_terms,
      |     ^~~~~~~~~~~~~~~~~

stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp: In instantiation of 'stan::math::internal::reduce_sum_impl<ReduceFunction, typename std::enable_if<stan::is_var<typename std::decay<_Tp2>::type, void>::value, void>::type, ReturnType, Vec, Args ...>::recursive_reducer::recursive_reducer(stan::math::internal::reduce_sum_impl<ReduceFunction, typename std::enable_if<stan::is_var<typename std::decay<_Tp2>::type, void>::value, void>::type, ReturnType, Vec, Args ...>::recursive_reducer&, tbb::split) [with ReduceFunction = model_264c62b4e48d42677858c6bf987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>; ReturnType = stan::math::var_value<double>; Vec = const std::vector<int>&; Args = {const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, c
onst Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&}]':
stan/lib/stan_math/lib/tbb_2020.3/include/tbb/parallel_reduce.h:186:27:   required from 'tbb::task* tbb::interface9::internal::start_reduce<Range, Body, Partitioner>::execute() [with Range = tbb::blocked_range<long long unsigned int>; Body = stan::math::internal::reduce_sum_impl<model_264c62b4e48d42677858c6bf987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>, void, stan::math::var_value<double>, const std::vector<int>&, const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_
value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&>::recursive_reducer; Partitioner = const tbb::auto_partitioner]'
stan/lib/stan_math/lib/tbb_2020.3/include/tbb/parallel_reduce.h:181:11:   required from here
stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp:58:23: warning: 'stan::math::internal::reduce_sum_impl<model_264c62b4e48d42677858c6bf987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>, void, stan::math::var_value<double>, const std::vector<int>&, const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1
, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&>::recursive_reducer::local_args_tuple_scope_' will be initialized after [-Wreorder]
   58 |     scoped_args_tuple local_args_tuple_scope_;
      |                       ^~~~~~~~~~~~~~~~~~~~~~~

stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp:57:25: warning:   'std::tuple<const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&> stan::math::internal::reduce_sum_impl<model_264c62b4e48d42677858c6b
f987a113e_model_namespace::partial_log_lik_lpmf_rsfunctor__<false>, void, stan::math::var_value<double>, const std::vector<int>&, const int&, const std::vector<int, std::allocator<int> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, stan::math::var_value<double, void>&, const Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0> >&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&, const std::vector<int, std::allocator<int> >&, const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >&, Eigen::Matrix<stan::math::var_value<double, void>, -1, 1, 0, -1, 1>&>::recursive_reducer::arg
s_tuple_' [-Wreorder]
   57 |     std::tuple<Args...> args_tuple_;
      |                         ^~~~~~~~~~~
stan/lib/stan_math/stan/math/rev/functor/reduce_sum.hpp:78:5: warning:   when initialized here [-Wreorder]
   78 |     recursive_reducer(recursive_reducer& other, tbb::split)
      |     ^~~~~~~~~~~~~~~~~

C
:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: 
s
rc/cmdstan/main_threads.o:main.cpp:(.text$_ZN4stan2io15stan_csv_reader13read_metadataERSiRNS0_17stan_csv_metadataEPSo[_ZN4stan2io15stan_csv_reader13read_metadataERSiRNS0_17stan_csv_metadataEPSo]+0xe3): undefined reference to `std::istream::seekg(std::fpos<int>)'
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: 
s
rc/cmdstan/main_threads.o:main.cpp:(.text$_ZN4stan2io15stan_csv_reader15read_adaptationERSiRNS0_19stan_csv_adaptationEPSo[_ZN4stan2io15stan_csv_reader15read_adaptationERSiRNS0_19stan_csv_adaptationEPSo]+0x164): undefined reference to `std::istream::seekg(std::fpos<int>)'
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: 
s
rc/cmdstan/main_threads.o:main.cpp:(.text$_ZN4stan2io15stan_csv_reader12read_samplesERSiRN5Eigen6MatrixIdLin1ELin1ELi0ELin1ELin1EEERNS0_15stan_csv_timingEPSo[_ZN4stan2io15stan_csv_reader12read_samplesERSiRN5Eigen6MatrixIdLin1ELin1ELi0ELin1ELin1EEERNS0_15stan_csv_timingEPSo]+0x74d): undefined reference to `std::istream::seekg(std::fpos<int>)'

collect2.exe: error: ld returned 1 exit status

mingw32-make.exe: *** [make/program:59: C:\Rtemp\RtmpOEpubY\model-14185bc1480c.exe] Error 1

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

Importantly, the model was fit using CmdStanR as backend. Could it be confusing CmdStanR that there are now two versions of RTools in my root directory? I didn’t uninstall/delete RTools4.0 given my recollection that CmdStan depended on it crucially.

It’s supposed to be possible to use CmdStanR and RStan side by side depending on the task at hand, right?

If you’ve changed your RTools version then you’ll need to rebuild cmdstan (e.g., cmdstanr::rebuild_cmdstan())

2 Likes

Thanks for the help, gentlemen. Updating RStan, StanHeaders and RTools to the newest versions fixed the loo_moment_match() problem. Updating RTools broke CmdStan, however, so both it and CmdStanR had to be completely reinstalled. But everything seems to be working now, thankfully.

2 Likes