2

I only want to install the Rattle package and its dependencies in R, though I got that GTK 2.8 is required. Since I'm not a programmer I went the most simple route and ran homebrew but it installed GTK 2.24.

Now I get this error instead [full code]

> install.packages("rattle")
also installing the dependency ‘RGtk2’

Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘RGtk2’
Do you want to attempt to install these from sources?
y/n: n
installing the source package ‘rattle’

trying URL 'https://cran.rstudio.com/src/contrib/rattle_4.1.0.tar.gz'
Content type 'application/x-gzip' length 2665410 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

ERROR: dependency ‘RGtk2’ is not available for package ‘rattle’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rattle’
Warning in install.packages :
  installation of package ‘rattle’ had non-zero exit status

The downloaded source packages are in
 ‘/private/var/folders/gz/hgc4y87s16gcg7q7b6fgq1hc0000gn/T/RtmpXbOVK8/downloaded_packages’
> install.packages("RGtk2")
Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘RGtk2’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘RGtk2’

trying URL 'https://cran.rstudio.com/src/contrib/RGtk2_2.20.33.tar.gz'
Content type 'application/x-gzip' length 2792938 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

* installing *source* package ‘RGtk2’ ...
** package ‘RGtk2’ successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for INTROSPECTION... no
checking for GTK... yes
checking for GTHREAD... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for uintptr_t... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -D_R_=1 -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.31_1/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.31_1/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/1.4.8_1/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.10/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/atk/2.24.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.14.10/include/cairo -I/usr/local/Cellar/pixman/0.34.0_1/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.12.4/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/gdk-pixbuf/2.36.8/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/glib/2.52.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.52.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.41/include -I.  -DHAVE_UINTPTR_T   -I/usr/... <truncated>
RGtkDataFrame.c:502:1: warning: unused function 'r_gtk_data_frame_remove' [-Wunused-function]
r_gtk_data_frame_remove (RGtkDataFrame *data_frame,
^
1 warning generated.
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -D_R_=1 -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.31_1/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.31_1/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/1.4.8_1/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.10/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/atk/2.24.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.14.10/include/cairo -I/usr/local/Cellar/pixman/0.34.0_1/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.12.4/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/gdk-pixbuf/2.36.8/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/glib/2.52.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.52.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.41/include -I.  -DHAVE_UINTPTR_T   -I/usr/... <truncated>
Rgtk.c:7:10: fatal error: 'gdk/gdkx.h' file not found
#include <gdk/gdkx.h>
         ^
1 error generated.
make: *** [Rgtk.o] Error 1
ERROR: compilation failed for package ‘RGtk2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RGtk2’
Warning in install.packages :
  installation of package ‘RGtk2’ had non-zero exit status

The downloaded source packages are in
 ‘/private/var/folders/gz/hgc4y87s16gcg7q7b6fgq1hc0000gn/T/RtmpXbOVK8/downloaded_packages’

How do i update GTK from 2.24 to 2.8? Homebrew apparently always installs 2.24.

Also, should I install 2.8 or any version above it should work? Usually updated is better - in consumer stuff at least.

Is there a simple guideline for users not very accustomed to terminal on how to do this? I found https://www.hardcoded.net/devlogs/20120426 but simple copy pasting does not work and I'm not comfortable messing around with stuff like this in terminal.

João Ramos
  • 85
  • 2
  • 10
  • I wrote a brief note on how to install `rattle` on macOS: https://gist.github.com/zhiyzuo/a489ffdcc5da87f28f8589a55aa206dd – Zhiya Sep 05 '17 at 23:57

0 Answers0