无法安装包“RcppArmadillo”在 ubuntu 20.04 R 版本 4.1.3 上

发布于 2025-01-18 07:02:44 字数 2375 浏览 2 评论 0原文

我正在尝试在Ubuntu上为我的闪亮服务器安装“预测”软件包。 我的终端上的这个过程只是被卡住了,一旦停止安装 - 它说:

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.

有什么建议吗? 提前致谢

I am trying to install the 'forecast' package for my shiny server on ubuntu.
that process on my terminal is just getting stuck and once stopping the installation- it says:

ERROR: compilation failed for package ‘RcppArmadillo’

so i tried but failed to install 'RcppArmadillo' in two different ways:

first way through R (got stuck again):

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’

second way:
$ 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.

any suggestions?
thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傾城如夢未必闌珊 2025-01-25 07:02:44

那也就是(有效地)一个常见问题解答。最好的选择是查看 for Ubuntu for Ubuntu在Cran上,约5K包,您可以添加PPA。之后,sudo apt安装r-cran-rcpparmadillo将为您提供当前版本。

这是我在一个摇滚项目容器中所做的:

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软件包所需的。

That is (effectively) a FAQ as well. Your best bet is to look at the README for Ubuntu at CRAN about 5k packages so that you can add the PPA. After than, sudo apt install r-cran-rcpparmadillo will get you the current version.

Here is what I do in one of the Rocker Projects containers:

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+"

You may or may not need to install to install dirmngr and software-properties-common so maybe try just

sudo add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0" 
sudo add-apt-repository --enable-source --yes "ppa:c2d4u.team/c2d4u4.0+"

and you do not need the first if you already get current R from CRAN, its the source repo for what is mirrored at CRAN. But c2d4u4.0+ is what you want for 5000+ binary CRAN packages for focal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文