9

最近我在我的 MacBook Pro (El Capitan 10.11.6) 上安装了 Microsoft R Open 3.3.1。当我打开 RStudio 或使用 R 控制台时,我收到以下警告消息:

Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
  dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Symbol not found: _CGBitmapContextCreate
  Referenced from: /Library/Frameworks/R.framework/Resources/modules//R_X11.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Resources/modules//R_X11.so

您知道防止打印消息(或解决问题)的方法吗?

谢谢!

4

2 回答 2

5

对于 CRAN R 安装,我看到它R_X11.so引用了以下库:

kevin@MBP:/Library/Frameworks/R.framework/Resources/modules
$ otool -L R_X11.so
R_X11.so:
        R_X11.so (compatibility version 0.0.0, current version 0.0.0)
        /opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
        /opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
        /opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
        /opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
        /opt/X11/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
        /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
        /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
        /opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /opt/X11/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
        /Library/Frameworks/R.framework/Versions/3.3/Resources/lib/libR.dylib (compatibility version 3.3.0, current version 3.3.1)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.17.0)

该库没有引用您建议的符号:

kevin@MBP:/Library/Frameworks/R.framework/Resources/modules
$ nm R_X11.so | grep CGBitmap

但是,对于 MRO 安装,我看到以下库 + 符号:

kevin@MBP:/Volumes/Samsung 850 EVO/Library/Frameworks/R.framework/Resources/modules
$ otool -L R_X11.so
R_X11.so:
        R_X11.so (compatibility version 0.0.0, current version 0.0.0)
        /opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
        /opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
        /opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
        /opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
        /opt/X11/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
        /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
        /opt/X11/lib/libXt.7.dylib (compatibility version 8.0.0, current version 8.0.0)
        /opt/X11/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
        /Library/Frameworks/R.framework/Versions/3.3.1-MRO/Resources/lib/libR.dylib (compatibility version 3.3.0, current version 3.3.1)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1255.1.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)

带参考符号:

kevin@MBP:/Volumes/Samsung 850 EVO/Library/Frameworks/R.framework/Resources/modules
$ nm R_X11.so | grep CGBitmap
                 U _CGBitmapContextCreate

这些符号通常由 提供CoreGraphics.framework

kevin@MBP:/System/Library/Frameworks/CoreGraphics.framework/Versions/A
$ nm CoreGraphics | grep CGBitmapContext
0000000000046321 T _CGBitmapContextCreate
< ... other symbols ... >

但是,MRO 生成的R_X11.so并没有链接到那个,因此这些符号的查找失败。

tl;dr:Microsoft 正在向您发送损坏的软件,其中不包含提供所需符号的库的链接。请改用CRAN 提供的 R 二进制文件

于 2016-09-23T19:17:56.243 回答
0

我也有这个问题。安装 XQuartz 并重新登录系统后问题已解决。

注意:使用 X11(包括 tcltk)需要安装XQuartz,因为它不再是 OS X 的一部分。在将 OS X 升级到新的主要版本时,请务必重新安装 XQuartz。

于 2017-02-24T14:41:02.397 回答