Skip to content

Instantly share code, notes, and snippets.

@jrnold
Last active December 12, 2015 10:39
Show Gist options
  • Save jrnold/4760388 to your computer and use it in GitHub Desktop.
Save jrnold/4760388 to your computer and use it in GitHub Desktop.
github bug report stan-dev/stan
data {
int n;
int m;
row_vector[m] alpha;
}
parameters {
row_vector[m] beta[n-1];
}
transformed parameters {
matrix[n, m] alpha_beta;
alpha_beta[1] <- alpha;
for (i in 2:(n-1)) {
alpha_beta[i] <- beta[i];
}
}
model {
for (i in 1:m) {
beta[i] ~ normal(0, 1);
}
}
-*- mode: compilation; default-directory: "~/Documents/research/acw_markets_2/stan/models/" -*-
Compilation started at Tue Feb 12 00:16:40
make -k
--- Translating Stan graphical model to C++ code ---
/home/jrnold/remotes/stan/stan-src-1.1.1/bin//stanc --name=foo --o=foo.cpp foo.stan
Model name=foo
Input file=foo.stan
Output file=foo.cpp
--- Compiling C++ code ---
g++ -I /home/jrnold/remotes/stan/stan-src-1.1.1/src/ -I /home/jrnold/remotes/stan/stan-src-1.1.1/lib//eigen_3.1.2 -I /home/jrnold/remotes/stan/stan-src-1.1.1/lib//eigen_3.1.2/unsupported -I /home/jrnold/remotes/stan/stan-src-1.1.1/lib//boost_1.52.0 -O1 -fPIC -c -o foo.o foo.cpp
foo.cpp: In member function ‘virtual stan::agrad::var foo_namespace::foo::log_prob(std::vector<stan::agrad::var>&, std::vector<int>&, std::ostream*)’:
foo.cpp:127:61: error: invalid initialization of non-const reference of type ‘Eigen::Matrix<stan::agrad::var, 1, -1>&’ from an rvalue of type ‘Eigen::Matrix<stan::agrad::var, 1, -1>’
In file included from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/model/model_header.hpp:17:0,
from foo.cpp:3:
/home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/agrad/matrix.hpp:1908:17: error: in passing argument 1 of ‘void stan::agrad::assign(LHS&, const RHS&) [with LHS = Eigen::Matrix<stan::agrad::var, 1, -1>; RHS = Eigen::Matrix<double, 1, -1>]’
foo.cpp:129:92: error: invalid initialization of non-const reference of type ‘Eigen::Matrix<stan::agrad::var, 1, -1>&’ from an rvalue of type ‘Eigen::Matrix<stan::agrad::var, 1, -1>’
In file included from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/model/model_header.hpp:17:0,
from foo.cpp:3:
/home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/agrad/matrix.hpp:1908:17: error: in passing argument 1 of ‘void stan::agrad::assign(LHS&, const RHS&) [with LHS = Eigen::Matrix<stan::agrad::var, 1, -1>; RHS = Eigen::Matrix<stan::agrad::var, 1, -1>]’
foo.cpp: In member function ‘void foo_namespace::foo::write_array(std::vector<double>&, std::vector<int>&, std::vector<double>&, std::ostream*)’:
foo.cpp:200:61: error: invalid initialization of non-const reference of type ‘Eigen::Matrix<double, 1, -1>&’ from an rvalue of type ‘Eigen::Matrix<double, 1, -1>’
In file included from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/model/model_header.hpp:17:0,
from foo.cpp:3:
/home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/agrad/matrix.hpp:1908:17: error: in passing argument 1 of ‘void stan::agrad::assign(LHS&, const RHS&) [with LHS = Eigen::Matrix<double, 1, -1>; RHS = Eigen::Matrix<double, 1, -1>]’
foo.cpp:202:92: error: invalid initialization of non-const reference of type ‘Eigen::Matrix<double, 1, -1>&’ from an rvalue of type ‘Eigen::Matrix<double, 1, -1>’
In file included from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/model/model_header.hpp:17:0,
from foo.cpp:3:
/home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/agrad/matrix.hpp:1908:17: error: in passing argument 1 of ‘void stan::agrad::assign(LHS&, const RHS&) [with LHS = Eigen::Matrix<double, 1, -1>; RHS = Eigen::Matrix<double, 1, -1>]’
foo.cpp: In member function ‘virtual void foo_namespace::foo::write_csv(std::vector<double>&, std::vector<int>&, std::ostream&, std::ostream*)’:
foo.cpp:261:61: error: invalid initialization of non-const reference of type ‘Eigen::Matrix<double, 1, -1>&’ from an rvalue of type ‘Eigen::Matrix<double, 1, -1>’
In file included from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/model/model_header.hpp:17:0,
from foo.cpp:3:
/home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/agrad/matrix.hpp:1908:17: error: in passing argument 1 of ‘void stan::agrad::assign(LHS&, const RHS&) [with LHS = Eigen::Matrix<double, 1, -1>; RHS = Eigen::Matrix<double, 1, -1>]’
foo.cpp:263:92: error: invalid initialization of non-const reference of type ‘Eigen::Matrix<double, 1, -1>&’ from an rvalue of type ‘Eigen::Matrix<double, 1, -1>’
In file included from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/model/model_header.hpp:17:0,
from foo.cpp:3:
/home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/agrad/matrix.hpp:1908:17: error: in passing argument 1 of ‘void stan::agrad::assign(LHS&, const RHS&) [with LHS = Eigen::Matrix<double, 1, -1>; RHS = Eigen::Matrix<double, 1, -1>]’
In file included from /home/jrnold/remotes/stan/stan-src-1.1.1/lib//boost_1.52.0/boost/random/detail/large_arithmetic.hpp:19:0,
from /home/jrnold/remotes/stan/stan-src-1.1.1/lib//boost_1.52.0/boost/random/detail/const_mod.hpp:23,
from /home/jrnold/remotes/stan/stan-src-1.1.1/lib//boost_1.52.0/boost/random/linear_congruential.hpp:30,
from /home/jrnold/remotes/stan/stan-src-1.1.1/lib//boost_1.52.0/boost/random/additive_combine.hpp:27,
from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/gm/command.hpp:13,
from /home/jrnold/remotes/stan/stan-src-1.1.1/src/stan/model/model_header.hpp:20,
from foo.cpp:3:
/home/jrnold/remotes/stan/stan-src-1.1.1/lib//boost_1.52.0/boost/random/detail/integer_log2.hpp: At global scope:
/home/jrnold/remotes/stan/stan-src-1.1.1/lib//boost_1.52.0/boost/random/detail/integer_log2.hpp:71:35: warning: always_inline function might not be inlinable [-Wattributes]
make: *** [foo.o] Error 1
make: Target `all' not remade because of errors.
Compilation exited abnormally with code 2 at Tue Feb 12 00:16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment