无法编译 RcppArmadillo
Cannot compile RcppArmadillo
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
这是在 R 3.6.0 的 Singuarity 容器内构建的,在 CentOS 7 上使用 GCC 4.8.5。我可以使用“install_version”安装 RcppArmadillo 的 0.9.900.3.0 版。来自 devtools 的命令(并且此版本在使用相同的其他软件包之前完全正常工作,这就是为什么它是我要安装的软件包),但是,R 立即将其更新为版本0.10.1.0.0 每当我安装的另一个包需要 RcppArmadillo 作为依赖项时,这就会导致上述错误并且我的构建失败。除了告诉它根本不安装某些包的依赖项之外,我一直无法找到阻止 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'
之前在 GitHub 回购、邮件列表或此处讨论过几次。
您最简单的选择是通过
选择更新版本
install.packages("RcppArmadillo", repos="https://rcppcore.github.io/drat")
由于这不会影响 CRAN(或大多数用户)部署的任何系统,因此可能不值得重新上传(以及所有相关的麻烦)。如果您可以选择的话,您可能会考虑从 CentOS 7 继续。
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
这是在 R 3.6.0 的 Singuarity 容器内构建的,在 CentOS 7 上使用 GCC 4.8.5。我可以使用“install_version”安装 RcppArmadillo 的 0.9.900.3.0 版。来自 devtools 的命令(并且此版本在使用相同的其他软件包之前完全正常工作,这就是为什么它是我要安装的软件包),但是,R 立即将其更新为版本0.10.1.0.0 每当我安装的另一个包需要 RcppArmadillo 作为依赖项时,这就会导致上述错误并且我的构建失败。除了告诉它根本不安装某些包的依赖项之外,我一直无法找到阻止 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'
之前在 GitHub 回购、邮件列表或此处讨论过几次。
您最简单的选择是通过
选择更新版本install.packages("RcppArmadillo", repos="https://rcppcore.github.io/drat")
由于这不会影响 CRAN(或大多数用户)部署的任何系统,因此可能不值得重新上传(以及所有相关的麻烦)。如果您可以选择的话,您可能会考虑从 CentOS 7 继续。