RcppArmadillo是我试图安装的几个软件包的依赖项。在编译RcppArmadillo版本0.10.1.0.0时,我得到了这个错误(当R发现RcppArmadillo是dep时,它会自动从CRAN中提取):
RcppArmadillo.cpp:26:40: error: redeclaration 'arma::arma_version::major' differs in 'constexpr'
const unsigned int arma::arma_version::major;
^
In file included from ../inst/include/armadillo:91:0,
from ../inst/include/RcppArmadilloForward.h:49,
from ../inst/include/RcppArmadillo.h:31,
from RcppArmadillo.cpp:22:
../inst/include/armadillo_bits/arma_version.hpp:31:33: error: from previous declaration 'arma::arma_version::major'
static constexpr unsigned int major = ARMA_VERSION_MAJOR;
^
RcppArmadillo.cpp:26:40: error: declaration of 'constexpr const unsigned int arma::arma_version::major' outside of class is not definition [-fpermissive]
const unsigned int arma::arma_version::major;
^
RcppArmadillo.cpp:27:40: error: redeclaration 'arma::arma_version::minor' differs in 'constexpr'
const unsigned int arma::arma_version::minor;
^
In file included from ../inst/include/armadillo:91:0,
from ../inst/include/RcppArmadilloForward.h:49,
from ../inst/include/RcppArmadillo.h:31,
from RcppArmadillo.cpp:22:
../inst/include/armadillo_bits/arma_version.hpp:32:33: error: from previous declaration 'arma::arma_version::minor'
static constexpr unsigned int minor = ARMA_VERSION_MINOR;
^
RcppArmadillo.cpp:27:40: error: declaration of 'constexpr const unsigned int arma::arma_version::minor' outside of class is not definition [-fpermissive]
const unsigned int arma::arma_version::minor;
^
RcppArmadillo.cpp:28:40: error: redeclaration 'arma::arma_version::patch' differs in 'constexpr'
const unsigned int arma::arma_version::patch;
^
In file included from ../inst/include/armadillo:91:0,
from ../inst/include/RcppArmadilloForward.h:49,
from ../inst/include/RcppArmadillo.h:31,
from RcppArmadillo.cpp:22:
../inst/include/armadillo_bits/arma_version.hpp:33:33: error: from previous declaration 'arma::arma_version::patch'
static constexpr unsigned int patch = ARMA_VERSION_PATCH;
^
RcppArmadillo.cpp:28:40: error: declaration of 'constexpr const unsigned int arma::arma_version::patch' outside of class is not definition [-fpermissive]
const unsigned int arma::arma_version::patch;
^
make: *** [RcppArmadillo.o] Error 1
make: *** Waiting for unfinished jobs....
ERROR: compilation failed for package 'RcppArmadillo'
* removing '/usr/local/lib64/R/library/RcppArmadillo'
* restoring previous '/usr/local/lib64/R/library/RcppArmadillo'
Error: Failed to install 'unknown package' from URL:
(converted from warning) installation of package 'RcppArmadillo' had non-zero exit status
Execution halted
FATAL: post proc: exit status 1
FATAL: While performing build: while running engine: exit status 255这是在R3.6.0中的Singuarity容器中构建的,在CentOS 7上使用GCC 4.8.5构建。我可以使用devtools中的"install_version“命令安装RcppArmadillo的0.9.900.3.0版本(和这个版本以前与其他软件包完全兼容,这就是为什么我正在尝试安装),但是,每当我安装的另一个软件包需要依赖时,R立即将其更新为0.10.1.0.0,这会导致上面的错误和我的构建失败。我一直无法找到阻止R这样做的方法,只是告诉它不要为某些软件包安装依赖关系,但这让我头疼,我想看看这里是否有一个更简单的解决方案。有人知道如何修复这个编译错误,或者如何防止R在安装另一个需要它的包时自动更新软件包吗?
下面是显示RcppArmadillo版本0.9.900.3.0成功安装后立即进行更新的输出部分:
* DONE (RcppArmadillo)
Downloading package from url: https://ftp.osuosl.org/pub/cran/src/contrib/gratia_0.4.1.tar.gz
RcppArmad... (0.9.900.3.0 -> 0.10.1.0.0) [CRAN]
mvnfast (NA -> 0.2.5.1 ) [CRAN]
patchwork (NA -> 1.0.1 ) [CRAN]
Installing 3 packages: RcppArmadillo, mvnfast, patchwork
trying URL 'https://ftp.osuosl.org/pub/cran/src/contrib/RcppArmadillo_0.10.1.0.0.tar.gz'发布于 2020-11-02 23:31:16
这一点以前在GitHub回购、邮件列表或这里已经讨论过几次。
您最简单的选择是通过
install.packages("RcppArmadillo", repos="https://rcppcore.github.io/drat")由于这不影响任何系统CRAN (或大多数用户)部署,因此可能不值得进行新的上载(以及所有相关的麻烦)。如果您在这方面有选择的话,您最好考虑从CentOS 7继续前进。
https://stackoverflow.com/questions/64652764
复制相似问题