无法从源代码安装R软件包在Mac OSX Maverick中 [英] cannot install R package from source In Mac OSX Maverick

查看:152
本文介绍了无法从源代码安装R软件包在Mac OSX Maverick中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  * installed * 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:没有这样的文件或目录
make:*** [lm.o ]错误1
错误:编译包'PKG'失败
*删除'/Library/Frameworks/R.framework/Versions/3.0/Resources/library/PKG'
*恢复以前的' /Library/Frameworks/R.framework/Versions/3.0/Resources/library/PKG'
install.packages中的警告:
安装包'../PKG_0.2.7.ta​​r.gz'没有-zero退出状态

我知道是否有解决方案来解决这个问题?谢谢!部分我的 sessionInfo

  R版本3.0.1(2013- 05-16)
平台:x86_64-apple-darwin10.8.0(64位)

语言环境:
[1] en_US.UTF-8 / zh_CN.UTF-8 /en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8


解决方案

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

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

我现在可以安装R源代码包:)
$ b

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

  CC = clang 
CXX = clang ++


I upgraded my Mac OS X from ML to Maverick today, and installed the preview version of RStudio. I think I also updated Xcode to 5.0.1 and installed Command Line Tools on my MacBook Pro. However, when I install my own package from source, I got the following error:

* 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

Can I know if there is any solution to solve this issue? Thanks! Part of my 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

Please refer to this link: https://stackoverflow.com/a/19505252/1510531. After modifying the following lines in the Makeconf file in /Library/Frameworks/R.framework/Resources/etc:

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

I can now install R source packages :)

Update

According to @asieira, the last CXXFLAGS is not recommended, so just make the following changes:

CC=clang
CXX=clang++

这篇关于无法从源代码安装R软件包在Mac OSX Maverick中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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