首页 文章

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

提问于
浏览
0

当我在Windows上使用rstan时,我有以下Stan代码可以正常工作 . 但是,当在具有Linux(CentOS 6)的集群上运行时,它会抛出一个非常长的错误,包括~500行,我猜,Rcpp代码,最后一个块如下:

compileCode中的错误(f,代码,语言=语言,详细=详细):编译错误,未创建的函数/方法!在/scratch/user/siamak/R_libs/StanHeaders/include/stan/math/rev/mat.hpp(15)中包含的文件中,来自/scratch/user/siamak/R_libs/StanHeaders/include/stan/math.hpp( 4),来自/scratch/user/siamak/R_libs/StanHeaders/include/src/stan/model/model_header.hpp(4),来自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):错误:类“Eigen :: Ref>”没有成员“选项“Options = MatrixType :: Options,^在类实例化期间检测到”Eigen :: LLT <_MatrixType,_UpLo> [with MatrixType = Eigen :: Ref>, UpLo = 1]“在”/ scratch / user /“的第247行siamak / R_libs / StanHeaders / include / stan / math / rev / mat / fun / cholesky_decompose.hpp“包含在文件中另外:警告信息:运行命令'/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'状态为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]]]]);
    }
 }

1 回答

  • 0

    问题是gcc6编译器 . 我从源头重新安装了rstan和Rcpp软件包并解决了问题!

相关问题