stan-dev / stan-dev/rstan

RStan fails to C++ compile a valid Stan program

Open
#474 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

RStan fails to C++ compile a valid Stan program.
CmdStan compiles the Stan program fine.

Description:

This was originally reported on Discourse.

Reproducible Steps:

Stan program:

data {
  real y; 
}
parameters {
  real a;
  real b;
}
model {
  target += (y==0) ? a : b; 
}
Current Output:
> fit <- stan("tmp.stan")
In file included from filea40e398720f5.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:12:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/core/var.hpp:7:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include/boost/math/tools/config.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include/boost/config.hpp:39:
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include/boost/config/compiler/clang.hpp:200:11: warning: 'BOOST_NO_CXX11_RVALUE_REFERENCES' macro redefined [-Wmacro-redefined]
#  define BOOST_NO_CXX11_RVALUE_REFERENCES
          ^
<command line>:6:9: note: previous definition is here
#define BOOST_NO_CXX11_RVALUE_REFERENCES 1
        ^
In file included from filea40e398720f5.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:174:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/promote_scalar.hpp:4:
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/prim/scal/fun/promote_scalar.hpp:32:16: error: cannot convert 'stan::math::var' to 'double' without a conversion operator
        return T(x);
               ^~~
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/prim/scal/fun/promote_scalar.hpp:68:43: note: in instantiation of member function 'stan::math::promote_scalar_struct<double, stan::math::var>::apply' requested here
      return promote_scalar_struct<T, S>::apply(x);
                                          ^
filea40e398720f5.cpp:196:59: note: in instantiation of function template specialization 'stan::math::promote_scalar<double, stan::math::var>' requested here
            lp_accum__.add((logical_eq(y,0) ? stan::math::promote_scalar<double>(a) : stan::math::promote_scalar<double>(b) ));
                                                          ^
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:44:28: note: in instantiation of function template specialization 'modela40e2c770381_tmp_namespace::modela40e2c770381_tmp::log_prob<true, true, stan::math::var>' requested here
          = model.template log_prob<propto, jacobian_adjust_transform>
                           ^
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/src/stan/services/util/initialize.hpp:147:37: note: in instantiation of function template specialization 'stan::model::log_prob_grad<true, true, modela40e2c770381_tmp_namespace::modela40e2c770381_tmp>' requested here
            log_prob = stan::model::log_prob_grad<true, true>
                                    ^
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:54:19: note: in instantiation of function template specialization 'stan::services::util::initialize<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, 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> > >' requested here
          = util::initialize(model, init, rng, init_radius,
                  ^
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rstan/include/rstan/stan_fit.hpp:459:45: note: in instantiation of function template specialization 'stan::services::diagnose::diagnose<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp>' requested here
    return_code = stan::services::diagnose::diagnose(model,
                                            ^
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rstan/include/rstan/stan_fit.hpp:1196:11: note: in instantiation of function template specialization 'rstan::(anonymous namespace)::command<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, 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> > >' requested here
    ret = command(args, model_, holder, names_oi_tidx_,
          ^
filea40e398720f5.cpp:360:114: note: in instantiation of member function 'rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, 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> > >::call_sampler' requested here
            &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::call_sampler)
                                                                                                                 ^
1 warning and 1 error generated.
make: *** [filea40e398720f5.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.17.0
  7: 
  8: #include <stan/model/model_header.hpp>
  9: 
 10: namespace modela40e2c770381_tmp_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: stan::io::program_reader prog_reader__() {
 28:     stan::io::program_reader reader;
 29:     reader.add_event(0, 0, "start", "modela40e2c770381_tmp");
 30:     reader.add_event(10, 10, "end", "modela40e2c770381_tmp");
 31:     return reader;
 32: }
 33: 
 34: class modela40e2c770381_tmp : public prob_grad {
 35: private:
 36:     double y;
 37: public:
 38:     modela40e2c770381_tmp(stan::io::var_context& context__,
 39:         std::ostream* pstream__ = 0)
 40:         : prob_grad(0) {
 41:         ctor_body(context__, 0, pstream__);
 42:     }
 43: 
 44:     modela40e2c770381_tmp(stan::io::var_context& context__,
 45:         unsigned int random_seed__,
 46:         std::ostream* pstream__ = 0)
 47:         : prob_grad(0) {
 48:         ctor_body(context__, random_seed__, pstream__);
 49:     }
 50: 
 51:     void ctor_body(stan::io::var_context& context__,
 52:                    unsigned int random_seed__,
 53:                    std::ostream* pstream__) {
 54:         boost::ecuyer1988 base_rng__ =
 55:           stan::services::util::create_rng(random_seed__, 0);
 56:         (void) base_rng__;  // suppress unused var warning
 57: 
 58:         current_statement_begin__ = -1;
 59: 
 60:         static const char* function__ = "modela40e2c770381_tmp_namespace::modela40e2c770381_tmp";
 61:         (void) function__;  // dummy to suppress unused var warning
 62:         size_t pos__;
 63:         (void) pos__;  // dummy to suppress unused var warning
 64:         std::vector<int> vals_i__;
 65:         std::vector<double> vals_r__;
 66:         double DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
 67:         (void) DUMMY_VAR__;  // suppress unused var warning
 68: 
 69:         // initialize member variables
 70:         try {
 71:             current_statement_begin__ = 2;
 72:             context__.validate_dims("data initialization", "y", "double", context__.to_vec());
 73:             y = double(0);
 74:             vals_r__ = context__.vals_r("y");
 75:             pos__ = 0;
 76:             y = vals_r__[pos__++];
 77: 
 78:             // validate, data variables
 79:             current_statement_begin__ = 2;
 80:             // initialize data variables
 81: 
 82: 
 83:             // validate transformed data
 84: 
 85:             // validate, set parameter ranges
 86:             num_params_r__ = 0U;
 87:             param_ranges_i__.clear();
 88:             current_statement_begin__ = 5;
 89:             ++num_params_r__;
 90:             current_statement_begin__ = 6;
 91:             ++num_params_r__;
 92:         } catch (const std::exception& e) {
 93:             stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
 94:             // Next line prevents compiler griping about no return
 95:             throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
 96:         }
 97:     }
 98: 
 99:     ~modela40e2c770381_tmp() { }
100: 
101: 
102:     void transform_inits(const stan::io::var_context& context__,
103:                          std::vector<int>& params_i__,
104:                          std::vector<double>& params_r__,
105:                          std::ostream* pstream__) const {
106:         stan::io::writer<double> writer__(params_r__,params_i__);
107:         size_t pos__;
108:         (void) pos__; // dummy call to supress warning
109:         std::vector<double> vals_r__;
110:         std::vector<int> vals_i__;
111: 
112:         if (!(context__.contains_r("a")))
113:             throw std::runtime_error("variable a missing");
114:         vals_r__ = context__.vals_r("a");
115:         pos__ = 0U;
116:         context__.validate_dims("initialization", "a", "double", context__.to_vec());
117:         double a(0);
118:         a = vals_r__[pos__++];
119:         try {
120:             writer__.scalar_unconstrain(a);
121:         } catch (const std::exception& e) { 
122:             throw std::runtime_error(std::string("Error transforming variable a: ") + e.what());
123:         }
124: 
125:         if (!(context__.contains_r("b")))
126:             throw std::runtime_error("variable b missing");
127:         vals_r__ = context__.vals_r("b");
128:         pos__ = 0U;
129:         context__.validate_dims("initialization", "b", "double", context__.to_vec());
130:         double b(0);
131:         b = vals_r__[pos__++];
132:         try {
133:             writer__.scalar_unconstrain(b);
134:         } catch (const std::exception& e) { 
135:             throw std::runtime_error(std::string("Error transforming variable b: ") + e.what());
136:         }
137: 
138:         params_r__ = writer__.data_r();
139:         params_i__ = writer__.data_i();
140:     }
141: 
142:     void transform_inits(const stan::io::var_context& context,
143:                          Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
144:                          std::ostream* pstream__) const {
145:       std::vector<double> params_r_vec;
146:       std::vector<int> params_i_vec;
147:       transform_inits(context, params_i_vec, params_r_vec, pstream__);
148:       params_r.resize(params_r_vec.size());
149:       for (int i = 0; i < params_r.size(); ++i)
150:         params_r(i) = params_r_vec[i];
151:     }
152: 
153: 
154:     template <bool propto__, bool jacobian__, typename T__>
155:     T__ log_prob(vector<T__>& params_r__,
156:                  vector<int>& params_i__,
157:                  std::ostream* pstream__ = 0) const {
158: 
159:         T__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
160:         (void) DUMMY_VAR__;  // suppress unused var warning
161: 
162:         T__ lp__(0.0);
163:         stan::math::accumulator<T__> lp_accum__;
164: 
165:         try {
166:             // model parameters
167:             stan::io::reader<T__> in__(params_r__,params_i__);
168: 
169:             T__ a;
170:             (void) a;  // dummy to suppress unused var warning
171:             if (jacobian__)
172:                 a = in__.scalar_constrain(lp__);
173:             else
174:                 a = in__.scalar_constrain();
175: 
176:             T__ b;
177:             (void) b;  // dummy to suppress unused var warning
178:             if (jacobian__)
179:                 b = in__.scalar_constrain(lp__);
180:             else
181:                 b = in__.scalar_constrain();
182: 
183: 
184:             // transformed parameters
185: 
186: 
187: 
188:             // validate transformed parameters
189: 
190:             const char* function__ = "validate transformed params";
191:             (void) function__;  // dummy to suppress unused var warning
192: 
193:             // model body
194: 
195:             current_statement_begin__ = 9;
196:             lp_accum__.add((logical_eq(y,0) ? stan::math::promote_scalar<double>(a) : stan::math::promote_scalar<double>(b) ));
197: 
198:         } catch (const std::exception& e) {
199:             stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
200:             // Next line prevents compiler griping about no return
201:             throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
202:         }
203: 
204:         lp_accum__.add(lp__);
205:         return lp_accum__.sum();
206: 
207:     } // log_prob()
208: 
209:     template <bool propto, bool jacobian, typename T_>
210:     T_ log_prob(Eigen::Matrix<T_,Eigen::Dynamic,1>& params_r,
211:                std::ostream* pstream = 0) const {
212:       std::vector<T_> vec_params_r;
213:       vec_params_r.reserve(params_r.size());
214:       for (int i = 0; i < params_r.size(); ++i)
215:         vec_params_r.push_back(params_r(i));
216:       std::vector<int> vec_params_i;
217:       return log_prob<propto,jacobian,T_>(vec_params_r, vec_params_i, pstream);
218:     }
219: 
220: 
221:     void get_param_names(std::vector<std::string>& names__) const {
222:         names__.resize(0);
223:         names__.push_back("a");
224:         names__.push_back("b");
225:     }
226: 
227: 
228:     void get_dims(std::vector<std::vector<size_t> >& dimss__) const {
229:         dimss__.resize(0);
230:         std::vector<size_t> dims__;
231:         dims__.resize(0);
232:         dimss__.push_back(dims__);
233:         dims__.resize(0);
234:         dimss__.push_back(dims__);
235:     }
236: 
237:     template <typename RNG>
238:     void write_array(RNG& base_rng__,
239:                      std::vector<double>& params_r__,
240:                      std::vector<int>& params_i__,
241:                      std::vector<double>& vars__,
242:                      bool include_tparams__ = true,
243:                      bool include_gqs__ = true,
244:                      std::ostream* pstream__ = 0) const {
245:         vars__.resize(0);
246:         stan::io::reader<double> in__(params_r__,params_i__);
247:         static const char* function__ = "modela40e2c770381_tmp_namespace::write_array";
248:         (void) function__;  // dummy to suppress unused var warning
249:         // read-transform, write parameters
250:         double a = in__.scalar_constrain();
251:         double b = in__.scalar_constrain();
252:         vars__.push_back(a);
253:         vars__.push_back(b);
254: 
255:         if (!include_tparams__) return;
256:         // declare and define transformed parameters
257:         double lp__ = 0.0;
258:         (void) lp__;  // dummy to suppress unused var warning
259:         stan::math::accumulator<double> lp_accum__;
260: 
261:         double DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
262:         (void) DUMMY_VAR__;  // suppress unused var warning
263: 
264:         try {
265: 
266: 
267: 
268:             // validate transformed parameters
269: 
270:             // write transformed parameters
271: 
272:             if (!include_gqs__) return;
273:             // declare and define generated quantities
274: 
275: 
276: 
277:             // validate generated quantities
278: 
279:             // write generated quantities
280:         } catch (const std::exception& e) {
281:             stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
282:             // Next line prevents compiler griping about no return
283:             throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
284:         }
285:     }
286: 
287:     template <typename RNG>
288:     void write_array(RNG& base_rng,
289:                      Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
290:                      Eigen::Matrix<double,Eigen::Dynamic,1>& vars,
291:                      bool include_tparams = true,
292:                      bool include_gqs = true,
293:                      std::ostream* pstream = 0) const {
294:       std::vector<double> params_r_vec(params_r.size());
295:       for (int i = 0; i < params_r.size(); ++i)
296:         params_r_vec[i] = params_r(i);
297:       std::vector<double> vars_vec;
298:       std::vector<int> params_i_vec;
299:       write_array(base_rng,params_r_vec,params_i_vec,vars_vec,include_tparams,include_gqs,pstream);
300:       vars.resize(vars_vec.size());
301:       for (int i = 0; i < vars.size(); ++i)
302:         vars(i) = vars_vec[i];
303:     }
304: 
305:     static std::string model_name() {
306:         return "modela40e2c770381_tmp";
307:     }
308: 
309: 
310:     void constrained_param_names(std::vector<std::string>& param_names__,
311:                                  bool include_tparams__ = true,
312:                                  bool include_gqs__ = true) const {
313:         std::stringstream param_name_stream__;
314:         param_name_stream__.str(std::string());
315:         param_name_stream__ << "a";
316:         param_names__.push_back(param_name_stream__.str());
317:         param_name_stream__.str(std::string());
318:         param_name_stream__ << "b";
319:         param_names__.push_back(param_name_stream__.str());
320: 
321:         if (!include_gqs__ && !include_tparams__) return;
322: 
323:         if (!include_gqs__) return;
324:     }
325: 
326: 
327:     void unconstrained_param_names(std::vector<std::string>& param_names__,
328:                                    bool include_tparams__ = true,
329:                                    bool include_gqs__ = true) const {
330:         std::stringstream param_name_stream__;
331:         param_name_stream__.str(std::string());
332:         param_name_stream__ << "a";
333:         param_names__.push_back(param_name_stream__.str());
334:         param_name_stream__.str(std::string());
335:         param_name_stream__ << "b";
336:         param_names__.push_back(param_name_stream__.str());
337: 
338:         if (!include_gqs__ && !include_tparams__) return;
339: 
340:         if (!include_gqs__) return;
341:     }
342: 
343: }; // model
344: 
345: }
346: 
347: typedef modela40e2c770381_tmp_namespace::modela40e2c770381_tmp stan_model;
348: 
349: #include <rstan/rstaninc.hpp>
350: /**
351:  * Define Rcpp Module to expose stan_fit's functions to R.
352:  */
353: RCPP_MODULE(stan_fit4modela40e2c770381_tmp_mod){
354:   Rcpp::class_<rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp,
355:                boost::random::ecuyer1988> >("stan_fit4modela40e2c770381_tmp")
356:     // .constructor<Rcpp::List>()
357:     .constructor<SEXP, SEXP, SEXP>()
358:     // .constructor<SEXP, SEXP>()
359:     .method("call_sampler",
360:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::call_sampler)
361:     .method("param_names",
362:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::param_names)
363:     .method("param_names_oi",
364:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::param_names_oi)
365:     .method("param_fnames_oi",
366:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::param_fnames_oi)
367:     .method("param_dims",
368:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::param_dims)
369:     .method("param_dims_oi",
370:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::param_dims_oi)
371:     .method("update_param_oi",
372:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::update_param_oi)
373:     .method("param_oi_tidx",
374:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::param_oi_tidx)
375:     .method("grad_log_prob",
376:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::grad_log_prob)
377:     .method("log_prob",
378:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::log_prob)
379:     .method("unconstrain_pars",
380:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::unconstrain_pars)
381:     .method("constrain_pars",
382:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::constrain_pars)
383:     .method("num_pars_unconstrained",
384:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::num_pars_unconstrained)
385:     .method("unconstrained_param_names",
386:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::unconstrained_param_names)
387:     .method("constrained_param_names",
388:             &rstan::stan_fit<modela40e2c770381_tmp_namespace::modela40e2c770381_tmp, boost::random::ecuyer1988>::constrained_param_names)
389:     ;
390: }
391: 
392: // declarations
393: extern "C" {
394: SEXP filea40e398720f5( ) ;
395: }
396: 
397: // definition
398: 
399: SEXP filea40e398720f5(  ){
400:  return Rcpp::wrap("tmp");
401: }
402: 
403: 
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from filea40e398720f5.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:12:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include/stan/math/rev/core/var.hpp:7:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/B
In addition: Warning message:
running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB filea40e398720f5.cpp 2> filea40e398720f5.cpp.err.txt' had status 1 
RStan Version:
> packageVersion("rstan")
[1] ‘2.17.2’
R Version:
> R.version.string
[1] "R version 3.4.0 (2017-04-21)"
Operating System:

Mac OS X.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the supplied Stan program and the RStan call stan("tmp.stan"). Start by inspecting the generated C++ around line 196 and the referenced StanHeaders promote_scalar.hpp instantiation, then compare the RStan and CmdStan compilation paths. Done means this valid program compiles successfully through RStan.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, r
Domain
backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.