gpt4 book ai didi

r - 无法在 ubuntu 20.04 R 版本 4.1.3 上安装包 ‘RcppArmadillo’

转载 作者:行者123 更新时间:2023-12-04 19:05:15 34 4
gpt4 key购买 nike

我正在尝试在 ubuntu 上为我的 Shiny 服务器安装“预测”包。
我的终端上的那个过程只是卡住了,一旦停止安装-它说:

ERROR: compilation failed for package ‘RcppArmadillo’
所以我尝试但未能以两种不同的方式安装“RcppArmadillo”:
第一种方式通过 R (再次卡住): install.packages("RcppArmadillo")
and again it get stuck:
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppArmadillo.cpp -o RcppArmadillo.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fastLm.cpp -o fastLm.o
^Cmake: *** [/usr/lib/R/etc/Makeconf:177: fastLm.o] Interrupt
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/shiny/R/x86_64-pc-linux-gnu-library/4.1/RcppArmadillo’
第二种方式: $ sudo apt install r-cran-rcpparmadillo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
r-cran-rcpparmadillo : Depends: r-api-3.5
Depends: r-cran-rcpp (>= 0.11.0) but it is not going to be installed
Depends: r-cran-pkgkitten but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
有什么建议么?
提前致谢

最佳答案

这(实际上)也是一个常见问题解答。最好的办法是查看 README for Ubuntu at CRAN about 5k packages以便您可以添加 PPA。之后,sudo apt install r-cran-rcpparmadillo将为您提供当前版本。
这是我在其中一个 Rocker Projects 容器中所做的事情:

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
software-properties-common \
dirmngr \
ed \
less \
locales \
vim-tiny \
wget \
ca-certificates \
&& add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0" \
&& add-apt-repository --enable-source --yes "ppa:c2d4u.team/c2d4u4.0+"
您可能需要安装也可能不需要安装 dirmngrsoftware-properties-common所以也许试试
sudo add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0" 
sudo add-apt-repository --enable-source --yes "ppa:c2d4u.team/c2d4u4.0+"
如果您已经从 CRAN 获得了当前的 R,则不需要第一个,它是 CRAN 镜像的源代码库。但是 c2d4u4.0+是您想要的 focal 的 5000 多个二进制 CRAN 包.

关于r - 无法在 ubuntu 20.04 R 版本 4.1.3 上安装包 ‘RcppArmadillo’,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71696731/

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