【发布时间】:2020-05-02 20:10:37
【问题描述】:
我在 R 3.6.3 和最近在 R 4.0 中尝试了以下内容。
运行 Mac OSX Catalina。我有 Xcode 11.4.1 版本并且做了
xcode-select --install 确保我有命令行工具。
当必须在 Rstudio 中从源代码编译 R 包时,我收到 config.h 的错误 没有找到。尝试 Rcpp 时出现类似错误(未找到某些 .h。例如 math.h)。
如果有人有解决方法,请告诉我。谢谢。我在这个问题上搜索了很多 但一直无法解决。
* installing *source* package ‘pkgbuild’ ...
** package ‘pkgbuild’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pkgbuild)
* installing *source* package ‘rlang’ ...
** package ‘rlang’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I./lib/ -I/usr/local/include -fPIC -Wall -g -O2 -c capture.c -o capture.o
In file included from capture.c:1:
In file included from /Library/Frameworks/R.framework/Resources/include/Rinternals.h:44:
In file included from /Library/Frameworks/R.framework/Resources/include/R_ext/Arith.h:41:
In file included from /usr/local/include/math.h:8:
In file included from /usr/local/include/features.h:10:
/usr/local/include/forwards.h:10:10: fatal error: 'config.h' file not found
#include "config.h"
^~~~~~~~~~
1 error generated.
make: *** [capture.o] Error 1
ERROR: compilation failed for package ‘rlang’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rlang’
Warning in install.packages :
installation of package ‘rlang’ had non-zero exit status
【问题讨论】: