问题描述
我使用brew在OSX 10.7.5服务器上安装了R:
I installed R on an OSX 10.7.5 server using brew:
brew install R
一切似乎都还可以,但是开罗无法正常工作:
Everything seems so OK far, however Cairo is not working:
> svg(tempfile())
Warning messages:
1: In svg(tempfile()) :
unable to load shared object '/usr/local/Cellar/r/2.15.2/R.framework/Resources/library/grDevices/libs//cairo.so':
dlopen(/usr/local/Cellar/r/2.15.2/R.framework/Resources/library/grDevices/libs//cairo.so, 6): image not found
2: In svg(tempfile()) : failed to load cairo DLL
共享对象文件似乎完全丢失:
The shared object file seems to be missing completely:
id-86-243:Resources jeroen$ ls -ltr library/grDevices/libs/
total 488
-rwxrwxr-x 1 jeroen admin 245764 Dec 22 17:03 grDevices.so
我很少使用OSX,所以我不太确定这是否是R的特定发行版中的错误,还是在构建它时做错了什么?
I rarely use OSX, so I am not quite sure if this is a bug in this particular distribution of R, or if I have done something wrong when building it?
推荐答案
我只是遇到了这个问题.在R configure阶段,pkg-config
定位cairo
似乎是一个问题.解决方法似乎是:
I just ran into this problem. It seems to be a problem with pkg-config
locating cairo
during the R configure stage. The workaround seems to be:
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
以便R可以正确使用cairo
.
我直接从源代码而不是通过homebrew
来安装R,但是我确实使用homebrew
来使其他库保持最新.这样可以为我解决问题.
I install R directly from source, rather than with homebrew
, but I do use homebrew
to keep other libraries up to date. This resolves the problem for me.
作为参考,我正在运行OSX Mavericks.
For reference, I am running OSX Mavericks.
这篇关于Homebrew R建立缺少开罗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!