R中安装bsts包报错
install error of bsts package in R
安装 R 包 bsts on CentOS 6.3 fails with (truncated) error below. I already tried updating GCC to version 4.8.2 as suggested here。还有其他建议吗?
- installing source package ‘Boom’ ...
** package ‘Boom’ successfully unpacked and MD5 sums checked
** libs
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/Bart/Bart.o
Models/Bart/Bart.cpp: In member function ‘void BOOM::Bart::VariableSummary::finalize(int,
BOOM::Bart::ContinuousCutpointStrategy)’:
Models/Bart/Bart.cpp:110:65: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (number_of_unique_values < observed_values_.size()) {
^
Models/Bart/Bart.cpp:117:65: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (number_of_unique_values < observed_values_.size()) {
^
Models/Bart/Bart.cpp:129:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (number_of_unique_values < observed_values_.size()) {
^
很多这样的:
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
在我的案例中,安装新版本 (4.9) 的 C++ 和 Fortran 编译器有所帮助(参见 ,Dirk Eddelbuettel 的帽子提示)。我以前有 4.8 版,但它们没有用。
我不确定如何在 CentOS 上执行此操作,但我确信可以通过某种方式升级编译器。 Ubuntu (14.04) 的步骤是:
- 添加
ubuntu-toolchain-r
PPA 和 add-apt-repository
。我还使用了固定 (https://help.ubuntu.com/community/PinningHowto),以便其他包不会从该 PPA 自动更新。
- 安装软件包
g++-4.9
和 gfortran-4.9
。
- 在
~/.R/Makevars
或您的 /etc/R/Makeconf
中设置环境变量 CXX=g++-4.9
和 CXX1X=g++-4.9
。
- 安装'Boom'.
安装 R 包 bsts on CentOS 6.3 fails with (truncated) error below. I already tried updating GCC to version 4.8.2 as suggested here。还有其他建议吗?
- installing source package ‘Boom’ ... ** package ‘Boom’ successfully unpacked and MD5 sums checked ** libs 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/Bart/Bart.o Models/Bart/Bart.cpp: In member function ‘void BOOM::Bart::VariableSummary::finalize(int, BOOM::Bart::ContinuousCutpointStrategy)’: Models/Bart/Bart.cpp:110:65: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (number_of_unique_values < observed_values_.size()) { ^ Models/Bart/Bart.cpp:117:65: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (number_of_unique_values < observed_values_.size()) { ^ Models/Bart/Bart.cpp:129:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (number_of_unique_values < observed_values_.size()) { ^
很多这样的:
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
在我的案例中,安装新版本 (4.9) 的 C++ 和 Fortran 编译器有所帮助(参见
我不确定如何在 CentOS 上执行此操作,但我确信可以通过某种方式升级编译器。 Ubuntu (14.04) 的步骤是:
- 添加
ubuntu-toolchain-r
PPA 和add-apt-repository
。我还使用了固定 (https://help.ubuntu.com/community/PinningHowto),以便其他包不会从该 PPA 自动更新。 - 安装软件包
g++-4.9
和gfortran-4.9
。 - 在
~/.R/Makevars
或您的/etc/R/Makeconf
中设置环境变量CXX=g++-4.9
和CXX1X=g++-4.9
。 - 安装'Boom'.