r - 有没有办法解决make rstan的错误

标签 r compiler-errors rstan

当我使用R CMD INSTALL rstan_2.14.1.tar.gz或更高版本进行脱机安装时,我使用CentOS6.8,R版本是3.4.0,gcc版本是4.47,错误是:make *** [chains.o]Error 1,什么是chains.o,我该怎么办?解决它!帮助!

/opt/R-3.4.0/library/BH/include/boost/throw_exception.hpp:In function`void boost::throw_exception(const E&)`:
/opt/R-3.4.0/library/BH/include/boost/throw_exception.hpp:70:error`enable_ both:` is not a member of `boost::exception_detail`
In file included from /opt/R-3.4.0/library/BH/include/boost/random/detail/integer_log2.hpp:19,
from /opt/R-3.4.0/library/BH/include/boost/random/detail/large_arithmetic.hpp:19,
from /opt/R-3.4.0/library/BH/include/boost/random/detail/const_mod.hpp:23,
from /opt/R-3.4.0/library/BH/include/boost/random/linear_congruential.hpp:30,
from /opt/R-3.4.0/library/BH/include/boost/random/additive_combine.hpp:27,
from chains.cpp:29:
/opt/R-3.4.0/library/BH/include/boost/pending/integer_log2.hpp:At global scope:
/opt/R-3.4.0/library/BH/include/boost/pending/integer_log2.hpp:7:note:#pragma message :This header is deprecated .Use <boost/integer/integer_log2.hpp> instead.
make: *** [chains.o] Error 1
Error:compilation failed for package `rstan`

最佳答案

我在Azure上使用虚拟机Standard_F2s_v2,Ubuntu 19.04R 3.4.3g++ (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609遇到了相同的错误,因为我正在使用

devtools::install_deps(dependencies = TRUE)

我的DESCRIPTION有:
Imports:
    rstan (>= 2.18.2),

解决方案是单独安装没有版本的软件包:

.libPaths(c("~/R/x86_64-pc-linux-gnu-library/3.4", .libPaths()))
options(repos=structure(c(CRAN = "https://cran.r-project.org")))
packages <- c("devtools", ..., "rstan")
for (p in packages) {
  install.packages(p)
}

有关成功构建的完整详细信息,请参见this Github branch,提交1b3d1f6。

关于r - 有没有办法解决make rstan的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55840996/

相关文章:

unity3d - Unity3d-构建Player : Win32Exception时出错

compiler-errors - 如何从 Ocaml 编译器中获取更多信息

r - 在 R 中跳过 travis 上的特定测试文件

R 在打开 netcdf 文件时崩溃

r - 如何找到最长的连续数及其位置?

excel - 错误: invalid or unqualified - VBA copy paste

python - 您可以在 pystan 或 pymc3 中使用样本权重吗?

r - 通过分组因子对 data.frame 中的矩阵列表列求和

r - 如何展平具有 NULL 值的列表?

mcmc - 使用 Stan 估计聚类分配