2017-07-13 100 views
0

在Windows上与rstan一起使用时,我有以下Stan代码工作得非常好。然而,使用Linux(CentOS 6的)集群上运行时,它引发了一个很长的错误,其中包括〜500行的,我想,RCPP码和最后一个块如下:斯坦代码适用于Windows,但不适用于Linux

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]]]]); 
    } 
} 
+0

什么编译器?什么版本? –

+0

编译器是gcc6,是的,它是问题的根源。我从源头重新安装了rstan和Rcpp,并解决了问题。谢谢! – Siamak

回答

0

问题是gcc6编译器。我重新安装了源和问题解决rstan和Rcpp包!

相关问题