> source("04_compileModels.R")
Loading required package: Rcpp
Loading required package: inline
Attaching package: ‘inline’
The following object is masked from ‘package:Rcpp’:
registerPlugin
rstan (Version 2.7.0-1, packaged: 2015-07-17 18:12:01 UTC, GitRev: 05c3d0058b6a)
For execution on a local, multicore CPU with excess RAM we recommend calling
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
TRANSLATING MODEL '03_growthstem' FROM Stan CODE TO C++ CODE NOW.
successful in parsing the Stan model '03_growthstem'.
COMPILING THE C++ CODE FOR MODEL '03_growthstem' NOW.
OS: x86_64, linux-gnu; rstan: 2.7.0.1; Rcpp: 0.12.0; inline: 0.3.14
>> setting environment variables:
PKG_LIBS =
PKG_CPPFLAGS = -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/Rcpp/include/" -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/RcppEigen/include/" -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/RcppEigen/include/unsupported" -isystem"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/rstan/include/boost_not_in_BH" -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/BH/include" -isystem"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/StanHeaders/include/src/" -isystem"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/StanHeaders/include/" -I"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/rstan/include" -O3 -Wno-unused-function -Wno-uninitialized -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG
>> 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.7
7 :
8 : #include <stan/model/model_header.hpp>
9 :
10 : namespace modeld2b770d551c_03_growthstem_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 : class modeld2b770d551c_03_growthstem : public prob_grad {
27 : private:
28 : int N_ind;
29 : int N_sp;
30 : vector<int> species;
31 : double f;
32 : vector_d shade;
33 : vector_d logdbh;
34 : vector_d sigma_1;
35 : vector_d sigma_2;
36 : vector_d datediff;
37 : vector_d abundance;
38 : vector<double> obs;
39 : public:
40 : modeld2b770d551c_03_growthstem(stan::io::var_context& context__,
41 : std::ostream* pstream__ = 0)
42 : : prob_grad(0) {
43 : current_statement_begin__ = -1;
44 :
45 : static const char* function__ = "modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem";
46 : (void) function__; // dummy call to supress warning
47 : size_t pos__;
48 : (void) pos__; // dummy call to supress warning
49 : std::vector<int> vals_i__;
50 : std::vector<double> vals_r__;
51 : context__.validate_dims("data initialization", "N_ind", "int", context__.to_vec());
52 : N_ind = int(0);
53 : vals_i__ = context__.vals_i("N_ind");
54 : pos__ = 0;
55 : N_ind = vals_i__[pos__++];
56 : context__.validate_dims("data initialization", "N_sp", "int", context__.to_vec());
57 : N_sp = int(0);
58 : vals_i__ = context__.vals_i("N_sp");
59 : pos__ = 0;
60 : N_sp = vals_i__[pos__++];
61 : context__.validate_dims("data initialization", "species", "int", context__.to_vec(N_ind));
62 : validate_non_negative_index("species", "N_ind", N_ind);
63 : species = std::vector<int>(N_ind,int(0));
64 : vals_i__ = context__.vals_i("species");
65 : pos__ = 0;
66 : size_t species_limit_#include <rstan/rstaninc.hpp>
67 : /**
68 : * Define Rcpp Module to expose stan_fit's functions to R.
69 : */
70 : RCPP_MODULE(stan_fit4modeld2b770d551c_03_growthstem_mod){
71 : Rcpp::class_<rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem,
72 : boost::random::ecuyer1988> >("stan_fit4modeld2b770d551c_03_growthstem")
73 : // .constructor<Rcpp::List>()
74 : .constructor<SEXP, SEXP>()
75 : // .constructor<SEXP, SEXP>()
76 : .method("call_sampler",
77 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::call_sampler)
78 : .method("param_names",
79 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_names)
80 : .method("param_names_oi",
81 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_names_oi)
82 : .method("param_fnames_oi",
83 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_fnames_oi)
84 : .method("param_dims",
85 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_dims)
86 : .method("param_dims_oi",
87 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_dims_oi)
88 : .method("update_param_oi",
89 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::update_param_oi)
90 : .method("param_oi_tidx",
91 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_oi_tidx)
92 : .method("grad_log_prob",
93 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::grad_log_prob)
94 : .method("log_prob",
95 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::log_prob)
96 : .method("unconstrain_pars",
97 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::unconstrain_pars)
98 : .method("constrain_pars",
99 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::constrain_pars)
100 : .method("num_pars_unconstrained",
101 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::num_pars_unconstrained)
102 : .method("unconstrained_param_names",
103 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::unconstrained_param_names)
104 : .method("constrained_param_names",
105 : &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::constrained_param_names)
106 : ;
107 : }
108 :
109 : // declarations
110 : extern "C" {
111 : SEXP filed2b93ba739( ) ;
112 : }
113 :
114 : // definition
115 :
116 : SEXP filed2b93ba739( ){
117 : return Rcpp::wrap("03_growthstem");
118 : }
119 :
120 :
Compilation argument:
/usr/local/R/3.1.2-3/lib64/R/bin/R CMD SHLIB filed2b93ba739.cpp 2> filed2b93ba739.cpp.err.txt
/usr/local/gcc/5.2.0-1/bin/g++ -I/usr/local/R/3.1.2-3/lib64/R/include -DNDEBUG -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/Rcpp/include/" -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/RcppEigen/include/" -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/RcppEigen/include/unsupported" -isystem"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/rstan/include/boost_not_in_BH" -isystem"/gpfs0/global/local/R/3.1.2-3/lib64/R/library/BH/include" -isystem"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/StanHeaders/include/src/" -isystem"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/StanHeaders/include/" -I"/gpfs0/home/nadja/R/x86_64-unknown-linux-gnu-library/3.1/rstan/include" -O3 -Wno-unused-function -Wno-uninitialized -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I/usr/local/libxrender/0.9.8-2/include -I/usr/local/libxmu/1.1.2-1/include -I/usr/local/libxinerama/1.1.3-1/include -I/usr/local/libxext/1.3.1-1/include -I/usr/local/libxt/1.1.4-1/include -I/usr/local/libx11/1.5.0-1/include -I/usr/local/xextproto/7.2.1-1/include -I/usr/local/inputproto/2.2-1/include -I/usr/local/libxcb/1.9-1/include -I/usr/local/libxdmcp/1.1.1-1/include -I/usr/local/xproto/7.0.23-1/include -I/usr/local/libxau/1.0.7-1/include -I/usr/local/readline/6.3-2/include -I/usr/local/ncurses/5.9-1/include/ncursesw -I/usr/local/ncurses/5.9-1/include -I/usr/local/cairo/1.14.2-1/include -I/usr/local/glib/2.45.4-1/include -I/usr/local/libffi/3.2.1-1/include -I/usr/local/fontconfig/2.11.94-1/include -I/usr/local/expat/2.1.0-4/include -I/usr/local/pixman/0.32.6-1/include -I/usr/local/libxml2/2.9.2-1/include/libxml2 -I/usr/local/libxml2/2.9.2-1/include -I/usr/local/freetype/2.5.5-1/include -I/usr/local/libpng/1.6.16-1/include -I/usr/local/bzip2/1.0.6-3/include -I/usr/local/zlib/1.2.8-4/include -fpic -O3 -c filed2b93ba739.cpp -o filed2b93ba739.o
filed2b93ba739.cpp:66:30: error: stray ‘#’ in program
size_t species_limit_#include <rstan/rstaninc.hpp>
^
filed2b93ba739.cpp:118:1: error: expected ‘}’ at end of input
}
^
filed2b93ba739.cpp: In constructor ‘modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem::modeld2b770d551c_03_growthstem(stan::io::var_context&, std::ostream*)’:
filed2b93ba739.cpp:66:31: error: expected initializer before ‘include’
size_t species_limit_#include <rstan/rstaninc.hpp>
^
filed2b93ba739.cpp:110:8: error: expected unqualified-id before string constant
extern "C" {
^
filed2b93ba739.cpp:116:1: error: ‘SEXP’ was not declared in this scope
SEXP filed2b93ba739( ){
^
filed2b93ba739.cpp:118:1: error: expected ‘}’ at end of input
}
^
filed2b93ba739.cpp: At global scope:
filed2b93ba739.cpp:118:1: error: expected unqualified-id at end of input
filed2b93ba739.cpp:118:1: error: expected ‘}’ at end of input
make: *** [filed2b93ba739.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.7
7:
8: #include <stan/model/model_header.hpp>
9:
10: namespace modeld2b770d551c_03_growthstem_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: class modeld2b770d551c_03_growthstem : public prob_grad {
27: private:
28: int N_ind;
29: int N_sp;
30: vector<int> species;
31: double f;
32: vector_d shade;
33: vector_d logdbh;
34: vector_d sigma_1;
35: vector_d sigma_2;
36: vector_d datediff;
37: vector_d abundance;
38: vector<double> obs;
39: public:
40: modeld2b770d551c_03_growthstem(stan::io::var_context& context__,
41: std::ostream* pstream__ = 0)
42: : prob_grad(0) {
43: current_statement_begin__ = -1;
44:
45: static const char* function__ = "modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem";
46: (void) function__; // dummy call to supress warning
47: size_t pos__;
48: (void) pos__; // dummy call to supress warning
49: std::vector<int> vals_i__;
50: std::vector<double> vals_r__;
51: context__.validate_dims("data initialization", "N_ind", "int", context__.to_vec());
52: N_ind = int(0);
53: vals_i__ = context__.vals_i("N_ind");
54: pos__ = 0;
55: N_ind = vals_i__[pos__++];
56: context__.validate_dims("data initialization", "N_sp", "int", context__.to_vec());
57: N_sp = int(0);
58: vals_i__ = context__.vals_i("N_sp");
59: pos__ = 0;
60: N_sp = vals_i__[pos__++];
61: context__.validate_dims("data initialization", "species", "int", context__.to_vec(N_ind));
62: validate_non_negative_index("species", "N_ind", N_ind);
63: species = std::vector<int>(N_ind,int(0));
64: vals_i__ = context__.vals_i("species");
65: pos__ = 0;
66: size_t species_limit_#include <rstan/rstaninc.hpp>
67: /**
68: * Define Rcpp Module to expose stan_fit's functions to R.
69: */
70: RCPP_MODULE(stan_fit4modeld2b770d551c_03_growthstem_mod){
71: Rcpp::class_<rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem,
72: boost::random::ecuyer1988> >("stan_fit4modeld2b770d551c_03_growthstem")
73: // .constructor<Rcpp::List>()
74: .constructor<SEXP, SEXP>()
75: // .constructor<SEXP, SEXP>()
76: .method("call_sampler",
77: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::call_sampler)
78: .method("param_names",
79: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_names)
80: .method("param_names_oi",
81: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_names_oi)
82: .method("param_fnames_oi",
83: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_fnames_oi)
84: .method("param_dims",
85: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_dims)
86: .method("param_dims_oi",
87: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_dims_oi)
88: .method("update_param_oi",
89: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::update_param_oi)
90: .method("param_oi_tidx",
91: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::param_oi_tidx)
92: .method("grad_log_prob",
93: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::grad_log_prob)
94: .method("log_prob",
95: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::log_prob)
96: .method("unconstrain_pars",
97: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::unconstrain_pars)
98: .method("constrain_pars",
99: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::constrain_pars)
100: .method("num_pars_unconstrained",
101: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::num_pars_unconstrained)
102: .method("unconstrained_param_names",
103: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::unconstrained_param_names)
104: .method("constrained_param_names",
105: &rstan::stan_fit<modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem, boost::random::ecuyer1988>::constrained_param_names)
106: ;
107: }
108:
109: // declarations
110: extern "C" {
111: SEXP filed2b93ba739( ) ;
112: }
113:
114: // definition
115:
116: SEXP filed2b93ba739( ){
117: return Rcpp::wrap("03_growthstem");
118: }
119:
120:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! filed2b93ba739.cpp:66:30: error: stray ‘#’ in program
size_t species_limit_#include <rstan/rstaninc.hpp>
^
filed2b93ba739.cpp:118:1: error: expected ‘}’ at end of input
}
^
filed2b93ba739.cpp: In constructor ‘modeld2b770d551c_03_growthstem_namespace::modeld2b770d551c_03_growthstem::modeld2b770d551c_03_growthstem(stan::io::var_context&, std::ostream*)’:
filed2b93ba739.cpp:66:31: error: expected initializer before ‘include’
size_t species_limit_#include <rstan/rstaninc.hpp>
^
filed2b93ba739.cpp:110:8: error: expected unqualified-id before string constant
extern "C" {
^
filed2b93ba739.cpp:116:1: error: ‘SEXP’ was not declared in this scope
SEXP filed2b93ba739( ){
^
filed2b93ba739.cpp:118:1: error: expected ‘}’ at end of input
}
^
filed2b93ba739.cpp: At global scope:
filed2b93ba739.cpp:118:1: error: expected u
In addition: Warning message:
In set_cppo("fast") :
'set_cppo' is defunct; manually edit your Makevars file if necessary