DIAGNOSTIC(S) FROM PARSER:
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
In file included from /users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/arr.hpp:33,
from /users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/mat.hpp:232,
from /users/tblanchard/apps/R/StanHeaders/include/stan/math/rev/mat.hpp:8,
from /users/tblanchard/apps/R/StanHeaders/include/stan/math.hpp:4,
from /users/tblanchard/apps/R/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file5b482c35e703.cpp:8:
/users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp: In function ‘std::vector<std::vector<typename stan::return_type<T_y, T_loc, double, double, double, double>::type, std::allocator<typename stan::return_type<T_y, T_loc, double, double, double, double>::type> >, std::allocator<std::vector<typename stan::return_type<T_y, T_loc, double, double, double, double>::type, std::allocator<typename stan::return_type<T_y, T_loc, double, double, double, double>::type> > > > stan::math::integrate_ode_rk45(const F&, std::vector<S, std::allocator<_T2> >, double, const std::vector<double, std::allocator<double> >&, const std::vector<T2, std::allocator<_Tp> >&, const std::vector<double, std::allocator<double> >&, const std::vector<int, std::allocator<int> >&, std::ostream*, double, double, int)’:
/users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:81: error: ‘boost::numeric::odeint::max_step_checker’ has not been declared
/users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:136: error: there are no arguments to ‘max_step_checker’ that depend on a template parameter, so a declaration of ‘max_step_checker’ must be available
/users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:136: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
make: *** [file5b482c35e703.o] Error 1
ERROR(s) during compilation: source code errors or compiler configuration errors!
Program source:
1:
2: // includes from the plugin
3:
4:
5: // user includes
6: #define STAN__SERVICES__COMMAND_HPP// Code generated by Stan version 2.10
7:
8: #include <stan/model/model_header.hpp>
9:
10: namespace model5b4846796203_8schools_namespace {
11:
12: using std::istream;
13: using std::string;
14: using std::stringstream;
15: using std::vector;
16: using stan::io::dump;
17: using stan::math::lgamma;
18: using stan::model::prob_grad;
19: using namespace stan::math;
20:
21: typedef Eigen::Matrix<double,Eigen::Dynamic,1> vector_d;
22: typedef Eigen::Matrix<double,1,Eigen::Dynamic> row_vector_d;
23: typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> matrix_d;
24:
25: static int current_statement_begin__;
26:
27: class model5b4846796203_8schools : public prob_grad {
28: private:
29: int J;
30: vector<double> y;
31: vector<double> sigma;
32: public:
33: model5b4846796203_8schools(stan::io::var_context& context__,
34: std::ostream* pstream__ = 0)
35: : prob_grad(0) {
36: current_statement_begin__ = -1;
37:
38: static const char* function__ = "model5b4846796203_8schools_namespace::model5b4846796203_8schools";
39: (void) function__; // dummy call to supress warning
40: size_t pos__;
41: (void) pos__; // dummy call to supress warning
42: std::vector<int> vals_i__;
43: std::vector<double> vals_r__;
44: context__.validate_dims("data initialization", "J", "int", context__.to_vec());
45: J = int(0);
46: vals_i__ = context__.vals_i("J");
47: pos__ = 0;
48: J = vals_i__[pos__++];
49: context__.validate_dims("data initialization", "y", "double", context__.to_vec(J));
50: validate_non_negative_index("y", "J", J);
51: y = std::vector<double>(J,double(0));
52: vals_r__ = context__.vals_r("y");
53: pos__ = 0;
54: size_t y_limit_0__ = J;
55: for (size_t i_0__ = 0; i_0__ < y_limit_0__; ++i_0__) {
56: y[i_0__] = vals_r__[pos__++];
57: }
58: context__.validate_dims("data initialization", "sigma", "double", context__.to_vec(J));
59: validate_non_negative_index("sigma", "J", J);
60: sigma = std::vector<double>(J,double(0));
61: vals_r__ = context__.vals_r("sigma");
62: pos__ = 0;
63: size_t sigma_limit_0__ = J;
64: for (size_t i_0__ = 0; i_0__ < sigma_limit_0__; ++i_0__) {
65: sigma[i_0__] = vals_r__[pos__++];
66: }
67:
68: // validate data
69: check_greater_or_equal(function__,"J",J,0);
70: for (int k0__ = 0; k0__ < J; ++k0__) {
71: check_greater_or_equal(function__,"sigma[k0__]",sigma[k0__],0);
72: }
73:
74: double DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
75: (void) DUMMY_VAR__; // suppress unused var warning
76:
77:
78: // initialize transformed variables to avoid seg fault on val access
79:
80: try {
81: } catch (const std::exception& e) {
82: stan::lang::rethrow_located(e,current_statement_begin__);
83: // Next line prevents compiler griping about no return
84: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
85: }
86:
87: // validate transformed data
88:
89: // set parameter ranges
90: num_params_r__ = 0U;
91: param_ranges_i__.clear();
92: ++num_params_r__;
93: ++num_params_r__;
94: num_params_r__ += J;
95: }
96:
97: ~model5b4846796203_8schools() { }
98:
99:
100: void transform_inits(const stan::io::var_context& context__,
101: std::vector<int>& params_i__,
102: std::vector<double>& params_r__,
103: std::ostream* pstream__) const {
104: stan::io::writer<double> writer__(params_r__,params_i__);
105: size_t pos__;
106: (void) pos__; // dummy call to supress warning
107: std::vector<double> vals_r__;
108: std::vector<int> vals_i__;
109:
110: if (!(context__.contains_r("mu")))
111: throw std::runtime_error("variable mu missing");
112: vals_r__ = context__.vals_r("mu");
113: pos__ = 0U;
114: context__.validate_dims("initialization", "mu", "double", context__.to_vec());
115: double mu(0);
116: mu = vals_r__[pos__++];
117: try {
118: writer__.scalar_unconstrain(mu);
119: } catch (const std::exception& e) {
120: throw std::runtime_error(std::string("Error transforming variable mu: ") + e.what());
121: }
122:
123: if (!(context__.contains_r("tau")))
124: throw std::runtime_error("variable tau missing");
125: vals_r__ = context__.vals_r("tau");
126: pos__ = 0U;
127: context__.validate_dims("initialization", "tau", "double", context__.to_vec());
128: double tau(0);
129: tau = vals_r__[pos__++];
130: try {
131: writer__.scalar_lb_unconstrain(0,tau);
132: } catch (const std::exception& e) {
133: throw std::runtime_error(std::string("Error transforming variable tau: ") + e.what());
134: }
135:
136: if (!(context__.contains_r("eta")))
137: throw std::runtime_error("variable eta missing");
138: vals_r__ = context__.vals_r("eta");
139: pos__ = 0U;
140: context__.validate_dims("initialization", "eta", "double", context__.to_vec(J));
141: std::vector<double> eta(J,double(0));
142: for (int i0__ = 0U; i0__ < J; ++i0__)
143: eta[i0__] = vals_r__[pos__++];
144: for (int i0__ = 0U; i0__ < J; ++i0__)
145: try {
146: writer__.scalar_unconstrain(eta[i0__]);
147: } catch (const std::exception& e) {
148: throw std::runtime_error(std::string("Error transforming variable eta: ") + e.what());
149: }
150:
151: params_r__ = writer__.data_r();
152: params_i__ = writer__.data_i();
153: }
154:
155: void transform_inits(const stan::io::var_context& context,
156: Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
157: std::ostream* pstream__) const {
158: std::vector<double> params_r_vec;
159: std::vector<int> params_i_vec;
160: transform_inits(context, params_i_vec, params_r_vec, pstream__);
161: params_r.resize(params_r_vec.size());
162: for (int i = 0; i < params_r.size(); ++i)
163: params_r(i) = params_r_vec[i];
164: }
165:
166:
167: template <bool propto__, bool jacobian__, typename T__>
168: T__ log_prob(vector<T__>& params_r__,
169: vector<int>& params_i__,
170: std::ostream* pstream__ = 0) const {
171:
172: T__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
173: (void) DUMMY_VAR__; // suppress unused var warning
174:
175: T__ lp__(0.0);
176: stan::math::accumulator<T__> lp_accum__;
177:
178: // model parameters
179: stan::io::reader<T__> in__(params_r__,params_i__);
180:
181: T__ mu;
182: (void) mu; // dummy to suppress unused var warning
183: if (jacobian__)
184: mu = in__.scalar_constrain(lp__);
185: else
186: mu = in__.scalar_constrain();
187:
188: T__ tau;
189: (void) tau; // dummy to suppress unused var warning
190: if (jacobian__)
191: tau = in__.scalar_lb_constrain(0,lp__);
192: else
193: tau = in__.scalar_lb_constrain(0);
194:
195: vector<T__> eta;
196: size_t dim_eta_0__ = J;
197: eta.reserve(dim_eta_0__);
198: for (size_t k_0__ = 0; k_0__ < dim_eta_0__; ++k_0__) {
199: if (jacobian__)
200: eta.push_back(in__.scalar_constrain(lp__));
201: else
202: eta.push_back(in__.scalar_constrain());
203: }
204:
205:
206: // transformed parameters
207: vector<T__> theta(J);
208:
209: // initialize transformed variables to avoid seg fault on val access
210: stan::math::fill(theta,DUMMY_VAR__);
211:
212: try {
213: current_statement_begin__ = 13;
214: for (int j = 1; j <= J; ++j) {
215: current_statement_begin__ = 14;
216: stan::math::assign(get_base1_lhs(theta,j,"theta",1), (mu + (tau * get_base1(eta,j,"eta",1))));
217: }
218: } catch (const std::exception& e) {
219: stan::lang::rethrow_located(e,current_statement_begin__);
220: // Next line prevents compiler griping about no return
221: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
222: }
223:
224: // validate transformed parameters
225: for (int i0__ = 0; i0__ < J; ++i0__) {
226: if (stan::math::is_uninitialized(theta[i0__])) {
227: std::stringstream msg__;
228: msg__ << "Undefined transformed parameter: theta" << '[' << i0__ << ']';
229: throw std::runtime_error(msg__.str());
230: }
231: }
232:
233: const char* function__ = "validate transformed params";
234: (void) function__; // dummy to suppress unused var warning
235:
236: // model body
237: try {
238: current_statement_begin__ = 17;
239: lp_accum__.add(normal_log<propto__>(eta, 0, 1));
240: current_statement_begin__ = 18;
241: lp_accum__.add(normal_log<propto__>(y, theta, sigma));
242: } catch (const std::exception& e) {
243: stan::lang::rethrow_located(e,current_statement_begin__);
244: // Next line prevents compiler griping about no return
245: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
246: }
247:
248: lp_accum__.add(lp__);
249: return lp_accum__.sum();
250:
251: } // log_prob()
252:
253: template <bool propto, bool jacobian, typename T_>
254: T_ log_prob(Eigen::Matrix<T_,Eigen::Dynamic,1>& params_r,
255: std::ostream* pstream = 0) const {
256: std::vector<T_> vec_params_r;
257: vec_params_r.reserve(params_r.size());
258: for (int i = 0; i < params_r.size(); ++i)
259: vec_params_r.push_back(params_r(i));
260: std::vector<int> vec_params_i;
261: return log_prob<propto,jacobian,T_>(vec_params_r, vec_params_i, pstream);
262: }
263:
264:
265: void get_param_names(std::vector<std::string>& names__) const {
266: names__.resize(0);
267: names__.push_back("mu");
268: names__.push_back("tau");
269: names__.push_back("eta");
270: names__.push_back("theta");
271: }
272:
273:
274: void get_dims(std::vector<std::vector<size_t> >& dimss__) const {
275: dimss__.resize(0);
276: std::vector<size_t> dims__;
277: dims__.resize(0);
278: dimss__.push_back(dims__);
279: dims__.resize(0);
280: dimss__.push_back(dims__);
281: dims__.resize(0);
282: dims__.push_back(J);
283: dimss__.push_back(dims__);
284: dims__.resize(0);
285: dims__.push_back(J);
286: dimss__.push_back(dims__);
287: }
288:
289: template <typename RNG>
290: void write_array(RNG& base_rng__,
291: std::vector<double>& params_r__,
292: std::vector<int>& params_i__,
293: std::vector<double>& vars__,
294: bool include_tparams__ = true,
295: bool include_gqs__ = true,
296: std::ostream* pstream__ = 0) const {
297: vars__.resize(0);
298: stan::io::reader<double> in__(params_r__,params_i__);
299: static const char* function__ = "model5b4846796203_8schools_namespace::write_array";
300: (void) function__; // dummy call to supress warning
301: // read-transform, write parameters
302: double mu = in__.scalar_constrain();
303: double tau = in__.scalar_lb_constrain(0);
304: vector<double> eta;
305: size_t dim_eta_0__ = J;
306: for (size_t k_0__ = 0; k_0__ < dim_eta_0__; ++k_0__) {
307: eta.push_back(in__.scalar_constrain());
308: }
309: vars__.push_back(mu);
310: vars__.push_back(tau);
311: for (int k_0__ = 0; k_0__ < J; ++k_0__) {
312: vars__.push_back(eta[k_0__]);
313: }
314:
315: if (!include_tparams__) return;
316: // declare and define transformed parameters
317: double lp__ = 0.0;
318: (void) lp__; // dummy call to supress warning
319: stan::math::accumulator<double> lp_accum__;
320:
321: vector<double> theta(J, 0.0);
322:
323: try {
324: current_statement_begin__ = 13;
325: for (int j = 1; j <= J; ++j) {
326: current_statement_begin__ = 14;
327: stan::math::assign(get_base1_lhs(theta,j,"theta",1), (mu + (tau * get_base1(eta,j,"eta",1))));
328: }
329: } catch (const std::exception& e) {
330: stan::lang::rethrow_located(e,current_statement_begin__);
331: // Next line prevents compiler griping about no return
332: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
333: }
334:
335: // validate transformed parameters
336:
337: // write transformed parameters
338: for (int k_0__ = 0; k_0__ < J; ++k_0__) {
339: vars__.push_back(theta[k_0__]);
340: }
341:
342: if (!include_gqs__) return;
343: // declare and define generated quantities
344:
345: double DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
346: (void) DUMMY_VAR__; // suppress unused var warning
347:
348:
349: // initialize transformed variables to avoid seg fault on val access
350:
351: try {
352: } catch (const std::exception& e) {
353: stan::lang::rethrow_located(e,current_statement_begin__);
354: // Next line prevents compiler griping about no return
355: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
356: }
357:
358: // validate generated quantities
359:
360: // write generated quantities
361: }
362:
363: template <typename RNG>
364: void write_array(RNG& base_rng,
365: Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
366: Eigen::Matrix<double,Eigen::Dynamic,1>& vars,
367: bool include_tparams = true,
368: bool include_gqs = true,
369: std::ostream* pstream = 0) const {
370: std::vector<double> params_r_vec(params_r.size());
371: for (int i = 0; i < params_r.size(); ++i)
372: params_r_vec[i] = params_r(i);
373: std::vector<double> vars_vec;
374: std::vector<int> params_i_vec;
375: write_array(base_rng,params_r_vec,params_i_vec,vars_vec,include_tparams,include_gqs,pstream);
376: vars.resize(vars_vec.size());
377: for (int i = 0; i < vars.size(); ++i)
378: vars(i) = vars_vec[i];
379: }
380:
381: static std::string model_name() {
382: return "model5b4846796203_8schools";
383: }
384:
385:
386: void constrained_param_names(std::vector<std::string>& param_names__,
387: bool include_tparams__ = true,
388: bool include_gqs__ = true) const {
389: std::stringstream param_name_stream__;
390: param_name_stream__.str(std::string());
391: param_name_stream__ << "mu";
392: param_names__.push_back(param_name_stream__.str());
393: param_name_stream__.str(std::string());
394: param_name_stream__ << "tau";
395: param_names__.push_back(param_name_stream__.str());
396: for (int k_0__ = 1; k_0__ <= J; ++k_0__) {
397: param_name_stream__.str(std::string());
398: param_name_stream__ << "eta" << '.' << k_0__;
399: param_names__.push_back(param_name_stream__.str());
400: }
401:
402: if (!include_gqs__ && !include_tparams__) return;
403: for (int k_0__ = 1; k_0__ <= J; ++k_0__) {
404: param_name_stream__.str(std::string());
405: param_name_stream__ << "theta" << '.' << k_0__;
406: param_names__.push_back(param_name_stream__.str());
407: }
408:
409: if (!include_gqs__) return;
410: }
411:
412:
413: void unconstrained_param_names(std::vector<std::string>& param_names__,
414: bool include_tparams__ = true,
415: bool include_gqs__ = true) const {
416: std::stringstream param_name_stream__;
417: param_name_stream__.str(std::string());
418: param_name_stream__ << "mu";
419: param_names__.push_back(param_name_stream__.str());
420: param_name_stream__.str(std::string());
421: param_name_stream__ << "tau";
422: param_names__.push_back(param_name_stream__.str());
423: for (int k_0__ = 1; k_0__ <= J; ++k_0__) {
424: param_name_stream__.str(std::string());
425: param_name_stream__ << "eta" << '.' << k_0__;
426: param_names__.push_back(param_name_stream__.str());
427: }
428:
429: if (!include_gqs__ && !include_tparams__) return;
430: for (int k_0__ = 1; k_0__ <= J; ++k_0__) {
431: param_name_stream__.str(std::string());
432: param_name_stream__ << "theta" << '.' << k_0__;
433: param_names__.push_back(param_name_stream__.str());
434: }
435:
436: if (!include_gqs__) return;
437: }
438:
439: }; // model
440:
441: } // namespace
442:
443: typedef model5b4846796203_8schools_namespace::model5b4846796203_8schools stan_model;
444:
445: #include <rstan/rstaninc.hpp>
446: /**
447: * Define Rcpp Module to expose stan_fit's functions to R.
448: */
449: RCPP_MODULE(stan_fit4model5b4846796203_8schools_mod){
450: Rcpp::class_<rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools,
451: boost::random::ecuyer1988> >("stan_fit4model5b4846796203_8schools")
452: // .constructor<Rcpp::List>()
453: .constructor<SEXP, SEXP>()
454: // .constructor<SEXP, SEXP>()
455: .method("call_sampler",
456: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::call_sampler)
457: .method("param_names",
458: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::param_names)
459: .method("param_names_oi",
460: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::param_names_oi)
461: .method("param_fnames_oi",
462: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::param_fnames_oi)
463: .method("param_dims",
464: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::param_dims)
465: .method("param_dims_oi",
466: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::param_dims_oi)
467: .method("update_param_oi",
468: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::update_param_oi)
469: .method("param_oi_tidx",
470: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::param_oi_tidx)
471: .method("grad_log_prob",
472: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::grad_log_prob)
473: .method("log_prob",
474: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::log_prob)
475: .method("unconstrain_pars",
476: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::unconstrain_pars)
477: .method("constrain_pars",
478: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::constrain_pars)
479: .method("num_pars_unconstrained",
480: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::num_pars_unconstrained)
481: .method("unconstrained_param_names",
482: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::unconstrained_param_names)
483: .method("constrained_param_names",
484: &rstan::stan_fit<model5b4846796203_8schools_namespace::model5b4846796203_8schools, boost::random::ecuyer1988>::constrained_param_names)
485: ;
486: }
487:
488: // declarations
489: extern "C" {
490: SEXP file5b482c35e703( ) ;
491: }
492:
493: // definition
494:
495: SEXP file5b482c35e703( ){
496: return Rcpp::wrap("8schools");
497: }
498:
499:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from /users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/arr.hpp:33,
from /users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/mat.hpp:232,
from /users/tblanchard/apps/R/StanHeaders/include/stan/math/rev/mat.hpp:8,
from /users/tblanchard/apps/R/StanHeaders/include/stan/math.hpp:4,
from /users/tblanchard/apps/R/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file5b482c35e703.cpp:8:
/users/tblanchard/apps/R/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp: In function ‘std::vector<std::vector<typename stan::return_type<T_y, T_loc, double, double, double, double>::type, std::allocator<typename stan::return_type<T_y, T_loc, double, double, double, double>::type> >, std::allocator<std::vector<typename stan::return_type<T_y, T_loc, double, double, double, double>::type, std::allo
In addition: Warning message:
running command '/n/sw/fasrcsw/apps/Core/R_core/3.2.0-fasrc01/lib64/R/bin/R CMD SHLIB file5b482c35e703.cpp 2> file5b482c35e703.cpp.err.txt' had status 1
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I was installing my eggCounts package and received the same errors with BH 1.58.x-x, but it worked with BH 1.60.0-2. so a simple update should fix.