Stan 代码适用于 Windows 但不适用于 Linux

Stan code works on Windows but not Linux

我有以下 Stan 代码在 Windows 上与 rstan 一起使用时工作得很好。然而,当 运行 在 Linux (CentOS 6) 的集群上时,它会抛出一个很长的错误,其中包括大约 500 行,我猜,Rcpp 代码和最后一个块如下:

Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! In file included from /scratch/user/siamak/R_libs/StanHeaders/include/stan/math/rev/mat.hpp(15), from /scratch/user/siamak/R_libs/StanHeaders/include/stan/math.hpp(4), from /scratch/user/siamak/R_libs/StanHeaders/include/src/stan/model/model_header.hpp(4), from file6ff02c925624.cpp(8): /general/software/x86_64/tamusc/R_tamu/R_LIBS/3.3.2-iomkl-2017A-Python-2.7.12-default-mt/RcppEigen/include/Eigen/src/Cholesky/LLT.h(57): error: class "Eigen::Ref>" has no member "Options" Options = MatrixType::Options, ^ detected during instantiation of class "Eigen::LLT<_MatrixType, _UpLo> [with _MatrixType=Eigen::Ref>, _UpLo=1]" at line 247 of "/scratch/user/siamak/R_libs/StanHeaders/include/stan/math/rev/mat/fun/cholesky_decompose.hpp" In file included fro In addition: Warning message: running command '/sw/eb/software/R/3.3.2-iomkl-2017A-Python-2.7.12-default-mt/lib64/R/bin/R CMD SHLIB file6ff02c925624.cpp 2> file6ff02c925624.cpp.err.txt' had status 1

有什么意见吗?

data{
int<lower=0> n;          //number of points
int<lower=1> d;          //dimension
int<lower=1> G;          //number of groups
int<lower=0> M;
int<lower=1> Jg[M];
int<lower=1> Start[G];
int<lower=1> End[G];
int<lower=1,upper=G> Ig[n];
matrix[d,n] X;
cov_matrix[d] Lambda;
real<lower=d-1> nu;
cov_matrix[d] B;
vector[d] m;
}

parameters{
vector[d] mu;            //mean
cov_matrix[d] Sigma;   //covariance
}


model{
//prior
Sigma ~ inv_wishart(nu,Lambda);
mu ~ multi_normal(m,B);
//likelihood
for (i in 1:n){
    X[Jg[Start[Ig[i]]:End[Ig[i]]],i] ~ 
 multi_normal(mu[Jg[Start[Ig[i]]:End[Ig[i]]]],
    Sigma[Jg[Start[Ig[i]]:End[Ig[i]]],Jg[Start[Ig[i]]:End[Ig[i]]]]);
    }
 }

问题出在 gcc6 编译器上。我从源代码重新安装了 rstan 和 Rcpp 包,问题解决了!