R:无法更新包clang找不到头文件 [英] R: can't update packages clang can't find head files

查看:77
本文介绍了R:无法更新包clang找不到头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个R软件包无法从源代码更新/完成.以下是错误消息的摘要;

I have several R packages failed to be updated/complied from the source. Followings are snippets of error messages;

clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.5.2_2/lib/R/include" -DNDEBUG  -I"/Volumes/Documents/Users/akihoji/Library/R/3.x/library/Rcpp/include" -I"/Volumes/Documents/Users/akihoji/Library/R/3.x/library/RcppArmadillo/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include   -fPIC  -g -O2 -c RcppExports.cpp -o RcppExports.o
    In file included from RcppExports.cpp:4:
    In file included from /Volumes/Documents/Users/akihoji/Library/R/3.x/library/RcppArmadillo/include/RcppArmadillo.h:31:
    In file included from /Volumes/Documents/Users/akihoji/Library/R/3.x/library/RcppArmadillo/include/RcppArmadilloForward.h:26:
    In file included from /Volumes/Documents/Users/akihoji/Library/R/3.x/library/Rcpp/include/RcppCommon.h:29:
    In file included from /Volumes/Documents/Users/akihoji/Library/R/3.x/library/Rcpp/include/Rcpp/r/headers.h:59:
    In file included from /Volumes/Documents/Users/akihoji/Library/R/3.x/library/Rcpp/include/Rcpp/platform/compiler.h:100:
    In file included from /usr/local/Cellar/llvm/7.0.1/include/c++/v1/cmath:305:
    /usr/local/Cellar/llvm/7.0.1/include/c++/v1/math.h:301:15: **fatal error: 'math.h' file not found**

另一个;

> ** libs clang -I"/usr/local/Cellar/r/3.5.2_2/lib/R/include" -DNDEBUG  -I"/Volumes/Documents/Users/akihoji/Library/R/3.x/library/Matrix/include"
> -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include   -fPIC  -g -O2  -c irlb.c -o irlb.o irlb.c:19:10: fatal error: 'stdlib.h' file not found
> #include <stdlib.h>

错误消息指向几个缺少的标题,但它们都在我的

Error messages point to several missing headers but they are all there in my

/usr/local/Cellar/llvm/7.0.1/include/c ++/v1

/usr/local/Cellar/llvm/7.0.1/include/c++/v1

对于解决此问题的任何帮助,我们将不胜感激.

I'd appreciate any help solving this issue.

sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.3
BuildVersion:   18D4

clang -v
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

gcc --version
gcc (Homebrew GCC 8.2.0) 8.2.0



setting  value                       
 version  R version 3.5.2 (2018-12-20)
 os       macOS Mojave 10.14.3        
 system   x86_64, darwin17.7.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2019-02-06 

推荐答案

更新;

我只记得在其他Mac上安装OSX Mojave时遇到了完全相同的问题.事实证明,即使您安装命令工具,也没有/usr/include,特别是对于 Xcode-select install 的最新版本.

I just remembered that I had the exact same issue when I installed OSX Mojave in my other Mac. It turns out that /usr/include is absent even when you install command tools, particularly for the latest version by Xcode-select install.

我安装的Xcode是

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 10.1.0.0.1.1539992718
volume: /
location: /
install-time: 1549499389
groups: com.apple.FindSystemFiles.pkg-group

此CLT pkg将安装/include

This CLT pkg will install /include in

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include

因此,您所需要做的就是将其中一个包含文件夹复制或链接到/usr,但要执行此操作,必须通过在恢复模式下激发crstutil来禁用系统完整性保护.

So all you have to do is either copy or link one of these include folders to /usr but in order to do this, you have to take disable System Integrity Protection by provoking crstutil in the recovery mode.

这篇关于R:无法更新包clang找不到头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆