gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 12:24:48 25 4
gpt4 key购买 nike

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

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 包,问题解决了!

关于linux - Stan 代码适用于 Windows 但不适用于 Linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45071102/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com