I’m not sure if this helps, but here is the complete red text that I get when I knit the document after it reaches a code chunk containing a stan model. Like I say, none of this actually stops the document knitting if you leave it, but it slows it down by quite a lot.
In terms of my system I’m running R version 4.0.0, R studio version 1.2.5042, Windows 10 (64 bit). AMD Ryzen 1600 CPU, 16gb RAM.
file33502ed76c58.cpp:6:36: warning: ISO C++11 requires whitespace after the macro name
#define STAN__SERVICES__COMMAND_HPP#include <boost/integer/integer_log2.hpp>
^
In file included from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/aux_/na_assert.hpp:23,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/arg.hpp:25,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/placeholders.hpp:24,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/apply.hpp:24,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/aux_/iter_apply.hpp:17,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/aux_/find_if_pred.hpp:14,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/find_if.hpp:17,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/find.hpp:17,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/aux_/contains_impl.hpp:20,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/contains.hpp:20,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/math/policies/policy.hpp:10,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/math/special_functions/math_fwd.hpp:29,
from C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/math/special_functions/fpclassify.hpp:19,
from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp:14,
from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/rstaninc.hpp:3,
from file33502ed76c58.cpp:7:
C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/assert.hpp:194:21: warning: unnecessary parentheses in declaration of ‘assert_arg’ [-Wparentheses]
failed ************ (Pred::************
^
C:/Users/ruben/Documents/R/win-library/4.0/BH/include/boost/mpl/assert.hpp:199:21: warning: unnecessary parentheses in declaration of ‘assert_not_arg’ [-Wparentheses]
failed ************ (boost::mpl::not_::************
^
In file included from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/prim/mat/prob/poisson_log_glm_log.hpp:5,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/prim/mat.hpp:336,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/mat.hpp:12,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/model/test_gradients.hpp:7,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10,
from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp:35,
from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/rstaninc.hpp:3,
from file33502ed76c58.cpp:7:
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/prim/mat/prob/poisson_log_glm_lpmf.hpp: In function ‘typename stan::return_type<T_x, T_alpha, T_beta>::type stan::math::poisson_log_glm_lpmf(const T_y&, const T_x&, const T_alpha&, const T_beta&)’:
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/prim/mat/prob/poisson_log_glm_lpmf.hpp:64:59: warning: typedef ‘T_alpha_val’ locally defined but not used [-Wunused-local-typedefs]
typename partials_return_type<T_alpha>::type>::type T_alpha_val;
^~~~~~~~~~~
file33502ed76c58.cpp: In member function ‘void model33502566b67_48fb61b1d0aa544784d44a0562893fc7_namespace::model33502566b67_48fb61b1d0aa544784d44a0562893fc7::transform_inits(const stan::io::var_context&, std::vector&, std::vector&, std::ostream*) const’:
file33502ed76c58.cpp:134:24: warning: typedef ‘local_scalar_t__’ locally defined but not used [-Wunused-local-typedefs]
typedef double local_scalar_t__;
^~~~~~~~~~~~~~~~
In file included from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/rstaninc.hpp:3,
from file33502ed76c58.cpp:7:
C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp: In instantiation of ‘SEXPREC* rstan::stan_fit<Model, RNG_t>::standalone_gqs(SEXP, SEXP) [with Model = model33502566b67_48fb61b1d0aa544784d44a0562893fc7_namespace::model33502566b67_48fb61b1d0aa544784d44a0562893fc7; RNG_t = boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399> >; SEXP = SEXPREC*]’:
file33502ed76c58.cpp:500:170: required from here
C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp:1238:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
int ret = stan::services::error_codes::CONFIG;
^~~
In file included from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp:52,
from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/rstaninc.hpp:3,
from file33502ed76c58.cpp:7:
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/sample/standalone_gqs.hpp: In instantiation of ‘int stan::services::standalone_generate(const Model&, const MatrixXd&, unsigned int, stan::callbacks::interrupt&, stan::callbacks::logger&, stan::callbacks::writer&) [with Model = model33502566b67_48fb61b1d0aa544784d44a0562893fc7_namespace::model33502566b67_48fb61b1d0aa544784d44a0562893fc7; Eigen::MatrixXd = Eigen::Matrix<double, -1, -1>]’:
C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp:1239:46: required from ‘SEXPREC* rstan::stan_fit<Model, RNG_t>::standalone_gqs(SEXP, SEXP) [with Model = model33502566b67_48fb61b1d0aa544784d44a0562893fc7_namespace::model33502566b67_48fb61b1d0aa544784d44a0562893fc7; RNG_t = boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399> >; SEXP = SEXPREC*]’
file33502ed76c58.cpp:500:170: required from here
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/sample/standalone_gqs.hpp:92:22: warning: comparison of integer expressions of different signedness: ‘std::vector<std::__cxx11::basic_string >::size_type’ {aka ‘long long unsigned int’} and ‘Eigen::Index’ {aka ‘long long int’} [-Wsign-compare]
if (p_names.size() != draws.cols()) {
~^
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/sample/standalone_gqs.hpp:110:24: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long long unsigned int’} and ‘Eigen::Index’ {aka ‘long long int’} [-Wsign-compare]
for (size_t i = 0; i < draws.rows(); ++i) {
^~~~~~~~~~~~
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/sample/standalone_gqs.hpp: In instantiation of ‘void stan::services::get_model_parameters(const Model&, std::vector<std::__cxx11::basic_string >&, std::vector<std::vector >&) [with Model = model33502566b67_48fb61b1d0aa544784d44a0562893fc7_namespace::model33502566b67_48fb61b1d0aa544784d44a0562893fc7]’:
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/sample/standalone_gqs.hpp:106:23: required from ‘int stan::services::standalone_generate(const Model&, const MatrixXd&, unsigned int, stan::callbacks::interrupt&, stan::callbacks::logger&, stan::callbacks::writer&) [with Model = model33502566b67_48fb61b1d0aa544784d44a0562893fc7_namespace::model33502566b67_48fb61b1d0aa544784d44a0562893fc7; Eigen::MatrixXd = Eigen::Matrix<double, -1, -1>]’
C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp:1239:46: required from ‘SEXPREC* rstan::stan_fit<Model, RNG_t>::standalone_gqs(SEXP, SEXP) [with Model = model33502566b67_48fb61b1d0aa544784d44a0562893fc7_namespace::model33502566b67_48fb61b1d0aa544784d44a0562893fc7; RNG_t = boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399> >; SEXP = SEXPREC*]’
file33502ed76c58.cpp:500:170: required from here
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/sample/standalone_gqs.hpp:41:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector::size_type’ {aka ‘long long unsigned int’} [-Wsign-compare]
for (int j = 0; j < dimss[i].size(); ++j)
^~~~~~~~~~~~~~~
In file included from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/core.hpp:45,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/mat.hpp:4,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/model/test_gradients.hpp:7,
from C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10,
from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/stan_fit.hpp:35,
from C:/Users/ruben/Documents/R/win-library/4.0/rstan/include/rstan/rstaninc.hpp:3,
from file33502ed76c58.cpp:7:
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp: At global scope:
C:/Users/ruben/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:14:13: warning: ‘void stan::math::set_zero_all_adjoints()’ defined but not used [-Wunused-function]
static void set_zero_all_adjoints() {