简体   繁体   English

在 R 中安装“RcppArmadillo”包时出错

[英]Error while installing "RcppArmadillo" package in R

I am using macOS High Sierra version 10.13.4.我使用的是 macOS High Sierra 版本 10.13.4。 While installing "RcppArmadillo"package, I get the following two WARNING messages :在安装“RcppArmadillo”包时,我收到以下两条警告消息:

   checking whether /usr/local/clang6/bin/clang++ -Wall accepts -g... (cached) yes
   checking whether g++ version is sufficient... almost
   configure: WARNING: Compiler self-identifies as being compliant with GNUC extensions but is not g++.
   checking for macOS... found
   checking for macOS Apple compiler... not found
   checking for clang compiler... found
   checking for OpenMP compatible version of clang... found and suitable
   checking LAPACK_LIBS... R-supplied partial LAPACK found
   configure: WARNING: Some complex-valued LAPACK functions may not be available

When I type "gcc --version" on my terminal, I get当我在终端上输入“gcc --version”时,我得到

 Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
 Apple LLVM version 9.1.0 (clang-902.0.39.2)
 Target: x86_64-apple-darwin17.5.0
 Thread model: posix
 InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

And my Makevars file in R looks like:我在 R 中的 Makevars 文件看起来像:

FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin16/6.3.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
F77 = /usr/local/bin/gfortran
FC = $F77
CXX =  /usr/local/clang6/bin/clang++  -Wall
LDFLAGS=-L/usr/local/clang6/lib
CC=  /usr/local/clang6/bin/clang
SHLIB_CXXLD=ccache /usr/local/clang6/bin/clang++
CXX11 =  /usr/local/clang6/bin/clang++
CXX98 =  /usr/local/clang6/bin/clang++
CXX14 =  /usr/local/clang6/bin/clang++

How can I remove these two WARNING signs?如何去除这两个警告标志?

In short, these are warnings and not errors.简而言之,这些是警告不是错误。 Moreover, these warnings do not matter.此外,这些警告并不重要。


Let's talk about what each warning means...让我们来谈谈每个警告的含义......

First Warning第一次警告

configure: WARNING: Compiler self-identifies as being compliant with GNUC extensions but is not g++.配置:警告:编译器自我识别为与 GNUC 扩展兼容,但不是 g++。

This is stating that the compiler defined in the Makevars file's CXX variable is identifying as gcc but is not the gcc compiler.这说明在Makevars文件的CXX变量中定义的编译器识别gcc不是gcc编译器。 In essence, each compiler has its own predefined header, see Section 3.7.2 Common Predefined Macros of The C Preprocessor , and this check is focused on verifying that a modern gcc compiler is selected.本质上,每个编译器都有自己的预定义头文件,请参阅第 3.7.2 节C 预处理器的通用预定义宏,该检查的重点是验证是否选择了现代gcc编译器。 However, it's hard to check the presence of a compiler if the compiler is lying about who it is.但是,如果编译器对它的身份撒谎,则很难检查编译器是否存在。

For details on the origin, see discussion in the issue Add a check message success in config after g++version check #183 and the commit the default message on the g++ test ).有关来源的详细信息,请参阅问题在g++version check #183 之后在配置中添加检查消息成功在 g++ 测试上提交默认消息中的讨论)。

Second Warning第二次警告

configure: WARNING: Some complex-valued LAPACK functions may not be available配置:警告:某些复数值 LAPACK 函数可能不可用

Within this warning, there is a complaint that the underlying Linear Algebra PACKage is the same one that is shipped with R .在这个警告中,有人抱怨底层的线性代数包R附带的相同。 Unfortunately, the LAPACK that is shipped with R is severely limited and a bit out of date.不幸的是, R附带的 LAPACK受到严重限制并且有点过时。 So, the check here is hoping for an external LAPACK being present via either OpenBLAS, Intel MKL, or ATLAS.因此,此处的检查希望通过 OpenBLAS、Intel MKL 或 ATLAS 存在外部LAPACK。 Due to the way this check is structured, unless you are compiling R from source -- that is you opt not to use the binary provided by CRAN -- there is no way to avoid the hiccup.由于此检查的结构方式,除非您从源代码编译R——即您选择不使用 CRAN 提供的二进制文件——否则无法避免打嗝。

Simply put, the CRAN binary looks for the LAPACK in a specific location.简而言之,CRAN 二进制文件在特定位置查找 LAPACK。 Switching to another LAPACK would require the establishment of a symbolic link to the existing lRlapack location, which is what the check searches for .切换到另一个 LAPACK 将需要建立到现有 lRlapack 位置的符号链接,这是检查搜索的内容 Though, it isn't advisable doing such a symbolic link.但是,不建议进行这样的符号链接。 (Sorry vecLib lovers!) (对不起 vecLib 爱好者!)

If you are interested in compiling from source, consider viewing Section A.3 Linear algebra of R Installation and Administration , which describes the procedure for using external LAPACKs.如果您对从源代码编译感兴趣,请考虑查看R 安装和管理的A.3 线性代数部分,其中描述了使用外部 LAPACK 的过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM