【问题标题】:install error of bsts package in R在 R 中安装 bsts 包的错误
【发布时间】:2015-06-26 15:27:36
【问题描述】:

在 CentOS 6.3 上安装 R 包 bsts 失败并出现以下(截断)错误。我已经尝试按照here 的建议将 GCC 更新到版本 4.8.2。还有其他建议吗?

  • 正在安装 source 包“Boom”... ** 成功解包“Boom”包并检查 MD5 和 ** 库 g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I。 -I../inst/include -IBmath -Imath/cephes -Icblas -DNO_BOOST_THREADS -DNO_BOOST_FILESYSTEM -DADD_ -DRLANGUAGE -I/usr/local/include -I"/usr/lib64/R/library/BH/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Models/Bart/Bart.cpp -o Models /巴特/巴特.o Models/Bart/Bart.cpp: 在成员函数'void BOOM::Bart::VariableSummary::finalize(int, BOOM::Bart::ContinuousCutpointStrategy)’: Models/Bart/Bart.cpp:110:65:警告:有符号和无符号整数表达式之间的比较 [-Wsign-compare] if (number_of_unique_values

很多这样的:

 Models/Bart/Bart.cpp:1393:50: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      if (number_of_trees_to_remove >= trees_.size()) {
                                                   ^
 {standard input}: Assembler messages:
 {standard input}:71: Error: expecting string instruction after `rep'
 {standard input}:617: Error: expecting string instruction after `rep'
 {standard input}:664: Error: expecting string instruction after `rep'
 {standard input}:727: Error: expecting string instruction after `rep'
 {standard input}:790: Error: expecting string instruction after `rep'
 {standard input}:1171: Error: expecting string instruction after `rep'
 {standard input}:1180: Error: expecting string instruction after `rep'
 {standard input}:1231: Error: expecting string instruction after `rep'
 {standard input}:2704: Error: expecting string instruction after `rep'
 {standard input}:2796: Error: expecting string instruction after `rep'
 {standard input}:7412: Error: expecting string instruction after `rep'
 {standard input}:7504: Error: expecting string instruction after `rep'
 {standard input}:19481: Error: expecting string instruction after `rep'
 {standard input}:23959: Error: expecting string instruction after `rep'
 make: *** [Models/Bart/Bart.o] Error 1
 ERROR: compilation failed for package ‘Boom’
 * removing ‘/usr/lib64/R/library/Boom’
 ERROR: dependency ‘Boom’ is not available for package ‘BoomSpikeSlab’
 * removing ‘/usr/lib64/R/library/BoomSpikeSlab’
 ERROR: dependencies ‘BoomSpikeSlab’, ‘Boom’ are not available for package ‘bsts’
 * removing ‘/usr/lib64/R/library/bsts’

 The downloaded source packages are in
    ‘/tmp/Rtmpf9YQJJ/downloaded_packages’
 Updating HTML index of packages in '.Library'
 Making 'packages.html' ... done
 '/usr/lib64/R/bin/R' --vanilla CMD INSTALL  \
   '/tmp/Rtmpf9YQJJ/devtoolsa12a5ce5a465/google-CausalImpact-9c9286f'  \
   --library='/usr/lib64/R/library' --install-tests 

 ERROR: dependency ‘bsts’ is not available for package ‘CausalImpact’
 * removing ‘/usr/lib64/R/library/CausalImpact’
 Error: Command failed (1)
 In addition: Warning messages:
 1: In utils::install.packages(deps, dependencies = NA, Ncpus = threads) :
   installation of package ‘Boom’ had non-zero exit status
 2: In utils::install.packages(deps, dependencies = NA, Ncpus = threads) :
   installation of package ‘BoomSpikeSlab’ had non-zero exit status
 3: In utils::install.packages(deps, dependencies = NA, Ncpus = threads) :
   installation of package ‘bsts’ had non-zero exit status

【问题讨论】:

  • 您的问题似乎与 Boom 软件包有关。您是否检查过您下载的是最新版本?
  • 是的 - 尝试加载依赖项 Boom 和 Boom SpikeSlab 时会发生类似错误。我正在从 CRAN 获得最新版本。我应该寻找其他地方吗?
  • 您好,安装Boom的问题解决了吗?如果是,请问怎么做?
  • @Googme 遗憾的是我没有。我在 Mac 和 Windows 上安装没有问题,所以只使用了这些替代品。
  • 我遇到了与“Boom”类似的问题。任何想法如何解决它?这个stackoverflow.com/questions/33858596/… 没有帮助。

标签: r gcc centos


【解决方案1】:

在我的情况下,安装 C++ 和 Fortran 编译器的新版本 (4.9) 会有所帮助(请参阅 R package 'Boom' fails to install on Ubuntu linux,向 Dirk Eddelbuettel 致敬)。我之前有 4.8 版,但它们不起作用。

我不确定如何在 CentOS 上执行此操作,但我确信可以以一种或另一种方式升级编译器。 Ubuntu (14.04) 的步骤是:

  1. ubuntu-toolchain-r PPA 添加到add-apt-repository。我还使用了 pinning (https://help.ubuntu.com/community/PinningHowto),这样其他包就不会从该 PPA 自动更新。
  2. 安装包g++-4.9gfortran-4.9
  3. ~/.R/Makevars/etc/R/Makeconf 中设置环境变量CXX=g++-4.9CXX1X=g++-4.9
  4. 安装“Boom”。

【讨论】:

  • 错过了这是在 Ubuntu 上——在 CentOS 上没有帮助。尽管我确认使用 gcc v4.8 和 gfortran v4.8,但我确实尝试了类似的方法但没有成功。我在想我的系统有些奇怪。无论如何都会接受,因为它可能会帮助其他人
  • 我已经更新了答案。我之前有 4.8 版本,但它们不起作用,所以尝试 4.9。不幸的是,我不确定如何在 CentOS 上做到这一点。
  • 查看这里以获得一些“部分”帮助如何升级 CentOS 上的编译器superuser.com/questions/834862/…
猜你喜欢
  • 2016-09-11
  • 1970-01-01
  • 2021-08-28
  • 2018-04-24
  • 2021-10-14
  • 2018-03-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多