R 包“Boom"无法在 Ubuntu linux 上安装 [英] R package 'Boom' fails to install on Ubuntu linux

查看:29
本文介绍了R 包“Boom"无法在 Ubuntu linux 上安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,我的系统 (Ubuntu 14.04) 上无法安装 R 包Boom".R 和所有其他软件包都是最新版本(包括BH").由于 'Boom' 在 CRAN 上,应该预期该软件包将安装没有任何问题(例如 在 R 上安装软件包,OSX 需要 C++11 支持).但是,我不知道如何追查原因:我的设置可能与标准"有什么不同,因此无法安装软件包?去哪里看?

For some reason R package 'Boom' fails to install on my system (Ubuntu 14.04). R and all other packages are in their most recent versions (including 'BH'). As 'Boom' is on CRAN it should be expected that the package will install without any problems (e.g. Installing package on R, need C++11 support for OSX). However, I have no idea how to trace the cause: in what way my setup might differ from "the standard" so that the package does not install? Where to look?

这里是安装日志的违规部分:

Here is the offending part of the install log:

g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DNO_BOOST_THREADS -DNO_BOOST_FILESYSTEM -DADD_ -DRLANGUAGE  -I"/home/mbojan/R/library/3.2/BH/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c Models/PosteriorSamplers/DirichletPosteriorSampler.cpp -o Models/PosteriorSamplers/DirichletPosteriorSampler.o
Models/PosteriorSamplers/DirichletPosteriorSampler.cpp: In member function ‘void BOOM::DirichletPosteriorSampler::draw_impl(const std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> >&, const BOOM::Vector&)’:
Models/PosteriorSamplers/DirichletPosteriorSampler.cpp:90:65: error: no matching function for call to ‘std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> >::erase(__gnu_cxx::__normal_iterator<const std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*, std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> > >)’
         other_implementations.erase(impl.begin() + which_sampler);
                                                                 ^
Models/PosteriorSamplers/DirichletPosteriorSampler.cpp:90:65: note: candidates are:
In file included from /usr/include/c++/4.8/vector:69:0,
                 from ../inst/include/Models/DataTypes.hpp:24,
                 from ../inst/include/Models/ParamTypes.hpp:22,
                 from ../inst/include/Models/ModelTypes.hpp:22,
                 from ../inst/include/Models/DirichletModel.hpp:22,
                 from ../inst/include/Models/PosteriorSamplers/DirichletPosteriorSampler.hpp:23,
                 from Models/PosteriorSamplers/DirichletPosteriorSampler.cpp:18:
/usr/include/c++/4.8/bits/vector.tcc:134:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>; _Alloc = std::allocator<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> >; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*, std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> > >; typename std::_Vector_base<_Tp, _Alloc>::pointer = std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*]
     vector<_Tp, _Alloc>::
     ^
/usr/include/c++/4.8/bits/vector.tcc:134:5: note:   no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<const std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*, std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> > >’ to ‘std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> >::iterator {aka __gnu_cxx::__normal_iterator<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*, std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> > >}’
/usr/include/c++/4.8/bits/vector.tcc:146:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::iterator) [with _Tp = std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>; _Alloc = std::allocator<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> >; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*, std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> > >; typename std::_Vector_base<_Tp, _Alloc>::pointer = std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*]
     vector<_Tp, _Alloc>::
     ^
/usr/include/c++/4.8/bits/vector.tcc:146:5: note:   candidate expects 2 arguments, 1 provided
make: *** [Models/PosteriorSamplers/DirichletPosteriorSampler.o] Error 1
ERROR: compilation failed for package ‘Boom’

推荐答案

尝试更新的编译器:安装 g++-4.9 并设置

Try a newer compiler: install g++-4.9 and set

CXX=g++-4.9
CXX1X=g++-4.9

~/.R/Makevars 或您的 /etc/R/Makeconf 中.我昨天刚刚在工作中的机器上重建了 Boom(尽管那是 Ubuntu 15.04 到 15.10 的升级,由于切换到 g++-5 而需要重建).

in either ~/.R/Makevars or your /etc/R/Makeconf. I just rebuilt Boom yesterday on a machine at work (though that was an Ubuntu 15.04 to 15.10 upgrade which required a rebuild because of the switch to g++-5).

这篇关于R 包“Boom"无法在 Ubuntu linux 上安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆