Compile error


No idea why this is occurring… the same structure is working fine for other dimensions of the model matrices.
edit (sorry) - windows 7, rstan 2.16.2

model.txt (48.1 KB)

6245: ;
6246: }
6248: // declarations
6249: extern “C” {
6250: SEXP file2b0c56e35916( ) ;
6251: }
6253: // definition
6255: SEXP file2b0c56e35916( ){
6256: return Rcpp::wrap(“6c19abcb029c28ff268a00cf122a2032”);
6257: }
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from C:/Users/driver/Documents/R/win-library/3.3/BH/include/boost/config.hpp:39:0,
from C:/Users/driver/Documents/R/win-library/3.3/BH/include/boost/math/tools/config.hpp:13,
from C:/Users/driver/Documents/R/win-library/3.3/StanHeaders/include/stan/math/rev/core/var.hpp:7,
from C:/Users/driver/Documents/R/win-library/3.3/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5,
from C:/Users/driver/Documents/R/win-library/3.3/StanHeaders/include/stan/math/rev/core.hpp:12,
from C:/Users/driver/Documents/R/win-library/3.3/StanHeaders/include/stan/math/rev/mat.hpp:4,
from C:/Users/driver/Documents/R/win-library/3.3/StanHeaders/include/stan/math.hpp:4,
from C:/Users/driver/Documents/R/win-library/3.3/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file2b0c56e3591


Actual error message:

filedba4ab44b6f.cpp:478:1: note: candidate template ignored: substitution failure [with T0__ = double]
covchol2corchol(const Eigen::Matrix<T0__, Eigen::Dynamic,Eigen::Dynamic>& mat,
filedba4ab44b6f.cpp:1568:51: error: no matching function for call to 'covchol2corchol'
                stan::math::assign(hypercorrchol, covchol2corchol(sqrtpcovmat,1, pstream__));

So parser bug, but you can’t just call covchol2corchol(sqrtpcovmat, 1) and have Stan know that the 1 is an integer. You have to declare something like

int one = 1;

and pass one to covchol2corchol.

At that point you run into another compiler error / parser bug because the name of the second argument to the function is inverse and Stan doesn’t know what to do with this line

if(inverse==1) o = inverse(o);

I changed the function argument to be invert, at which point it compiles at least.


Thanks! Though I could have sworn that was already working, and that I’d passed values like that before. Interesting!