CentOS 6.5: Howto install GTK version 2.8.0?

dokondr picture dokondr · Apr 3, 2014 · Viewed 50.8k times · Source

I am running CentOS 6.5, kernel2.6.32-431.5.1.el6.x86_64 #1 SMP. I am trying to install Rattle - data mining tool for R programming language. Rattle is installed from R shell. Notwithstanding I have latest GTK installed, when trying to install Rattle I get configure: error: GTK version 2.8.0 required (see below). How to solve this?

R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

...
> library(rattle)
Rattle: A free graphical interface for data mining with R.
Version 3.0.4 r177 Copyright (c) 2006-2014 Togaware Pty Ltd.
Type 'rattle()' to shake, rattle, and roll your data.
> rattle()
The package 'RGtk2' is required to display the Rattle GUI. It does not
appear to be installed. This package (and its dependencies) can be
installed using the following R command:

install.packages('RGtk2')

This one-time install will allow access to the full functionality of
Rattle.

Would you like Rattle to install the package now? (yes/NO) yes
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/RGtk2_2.20.27.tar.gz'
Content type 'application/x-gzip' length 2785305 bytes (2.7 Mb)
opened URL
==================================================
downloaded 2.7 Mb

* installing *source* package ‘RGtk2’ ...
** package ‘RGtk2’ successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for INTROSPECTION... no
checking for GTK... no
configure: error: GTK version 2.8.0 required
ERROR: configuration failed for package ‘RGtk2’
* removing ‘/usr/lib64/R/library/RGtk2’

The downloaded source packages are in
    ‘/tmp/RtmpJWMH35/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Error in rattle() : could not find function "gtkBuilderNew"
In addition: Warning messages:
1: In install.packages(pkg) :
  installation of package ‘RGtk2’ had non-zero exit status
2: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘RGtk2’
> 

Answer

dokondr picture dokondr · Apr 4, 2014

To solve the problem gtk2 development library must be installed. Under CentOS this can be done with:

yum groupinstall "Development Tools"
yum install gtk+-devel gtk2-devel