无法从源代码安装R软件包在Mac OSX Maverick中

时间:2013-10-23 05:07:35

标签: r gcc osx-mavericks

我今天将Mac OS X从ML升级为Maverick,并安装了RStudio的预览版。我想我也将Xcode更新到5.0.1并在我的MacBook Pro上安装了命令行工具。但是,当我从源代码安装自己的软件包时,出现以下错误:

* installing *source* package ‘PKG’ ...
** libs
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include    -fPIC  -mtune=core2 -g -O2  -c lm.c -o lm.o
make: llvm-gcc-4.2: No such file or directory
make: *** [lm.o] Error 1
ERROR: compilation failed for package ‘PKG’
* removing ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/PKG’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/PKG’
Warning in install.packages :
  installation of package ‘../PKG_0.2.7.tar.gz’ had non-zero exit status

我能否知道是否有任何解决方案可以解决此问题?谢谢!我sessionInfo的一部分:

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

1 个答案:

答案 0 :(得分:14)

请参阅此链接:https://stackoverflow.com/a/19505252/1510531。修改Makeconf中的/Library/Frameworks/R.framework/Resources/etc文件中的以下行:

CC=clang
CXX=clang++
CXXFLAGS= -O3 -pedantic

我现在可以安装R源包:)

<强>更新

根据@asieira的说法,不建议使用最后一个CXXFLAGS,所以只需进行以下更改:

CC=clang
CXX=clang++