R fails after installing GTK and RGtk2

后端 未结 7 425
忘了有多久
忘了有多久 2020-12-08 06:07

I\'ve installed R3.0 on my Mountain Lion Mac and after some trial and error the version of GTK suggested by http://r.research.att.com/ for R3.0: GTK+ 2.24.17 framework.

7条回答
  •  难免孤独
    2020-12-08 06:25

    I used the Homebrew solution (suggested by masaha03) on Snow Leopard and still had crashing problems with R. It turned out that in such a configuration, gtk is using cairo installed by homebrew whereas RGtk2 and cairoDevice are using the native cairo installation which is a different version. Since cairo and other dependent libraries are "keg-only" I needed to force a symlink for those:

    brew link --force cairo
    brew link --force pixman
    

    These two were sufficient for me but there might be others that need to be linked. The reason is that the Homebrew cairo might be dependent on a specific version of a library, but the system version of that library might be lower. In such a case, the installation of RGtk2 fails with a message that gtk+ is not installed.

    Lastly, the PKG_CONFIG_PATH has to point to the Homebrew packages first and then to the native ones:

    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig:$PKG_CONFIG_PATH
    

    Then install RGtk2 and cairoDevice.

提交回复
热议问题