[R-SIG-Mac] GTK+ libraries can't be found

Simon Urbanek simon.urbanek at r-project.org
Mon Jan 5 17:36:25 CET 2009

On Jan 5, 2009, at 10:37 , Ivan Alves wrote:

> Dear Simon,
> First of all many thanks for the guidance and more generally for the  
> great stuff you do for the R Mac community.
> On the environment, I have added the line you suggested to  
> both .bash_profile and .profile, but R does not seem to be looking  
> there (bash certainly does).  Where does the GUI R get the  
> environment definitions from?

See below.

>  And more generally where can I look more closely to the startup  
> process for R GUI as I have not yet managed to get it to read the  
> ~/.Rprofile file (and the definitions therein) properly [I have  
> tinkered with the preferences with no success]

R GUI has nothing to do with the shell - that's a whole another story.  
I wasn't suggesting you set that PATH permanently at all - it is only  
meant for compiling things against GTK+ if you want to (it overrides  
some system commands, so it's not a good idea to do that permanently).  
Also I was referring to R CMD INSTALL or similar method (you didn't  
mention you are using the GUI at all). If you want to use the R.app  
GUI for this, clearly, you have to set it in R, e.g.:


Now, this has nothing to do with your original question, but R.app is  
a Cocoa application so it is started by  launchd (via LaunchServices)  
- it is not started from the shell, so all .profile/.bash/etc. are  
irrelevant here. You can, however, set custom environment variables  
using Environment.plist (see Apple QA1067 - it was also discussed on  
this list several times as you'll see if you look at the archives).

> On the availability of the binary for RGtk2 on CRAN and its mirrors,  
> I am afraid that it does not appear in the ones I have tried  
> (Munchen and the first US).  Should I be using another mirror that  
> is more "complete"?

I don't know what you are referring to, all US mirrors have RGtk2  
AFAICS and in fact they have rattle as well, see

You'll have to supply more details (at the very least sessionInfo() as  
we kindly ask you in the posting guide) if you want more help.

> If I may, could I suggest an addition and one modification to the  
> keyboard shortcuts for R GUI?  The addition would be to add "run  
> function definition", possibly as shift-cmd-return, to take  
> multiline commands in R, something usually done for more involved  
> call (such as aggregate, merge, etc.).  Also, could the default cmd- 
> return (or a variation of it) then move the cursor to the next  
> command/uncommented line?  This would reduce the required keystrokes  
> of my tipical sessions by half.  Many thanks in advance for  
> considering this.

It is a good practice to not merge multiple entirely unrelated issues  
into one post. See archives for the discussion on <Cmd><Enter> and  
newline (feel free to comment) and for the former, please be more  
specific as of what it should do - "function definition" as a very  
vague term and if you want the GUI to find the function definition in  
the sources, then sure, contributed patches are highly welcome (in a  
separate thread, please).


> ivan
> On 5 Jan 2009, at 15:33, Simon Urbanek wrote:
>> On Jan 5, 2009, at 5:36 , Ivan Alves wrote:
>>> Dear all,
>>> Installing the dependencies of rattle (http://datamining.togaware.com/survivor/Install_Macintosh.html 
>>> ), I encountered a problem installing the RGtk2 library from  
>>> source.  It appears that the  GTK+ libraries can't be found by R  
>>> (I had successfully installed the runtime libraries from  http://r.research.att.com/) 
>>> .
>>> I would much appreciate some guidance as to how to get R to look  
>>> in the right place (/Library/Frameworks/) for the the GTK+ shared  
>>> objects.  Many thanks in advance.
>> If you have your environment set correctly this is automatic.  
>> However, from your output it seems you don't so make sure you set  
>> something like:
>> export PATH=/Library/Frameworks/GTK+.framework/Resources/bin:$PATH
>> Also make sure you're not setting PKG_CONFIG_PATH anywhere (this is  
>> usually not the case, but it appears you have another pkg-config  
>> installed) and if you do (and want to use it), you must make sure  
>> the framework path to .pc is first.
>> Cheers,
>> Simon
>> (BTW: normally you should not need to install RGtk2 from sources  
>> since it's available on CRAN).
>>> Kind regards,
>>> Ivan
>>> > install.packages("RGtk2",type="source")
>>> trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/RGtk2_2.12.7.tar.gz'
>>> Content type 'application/x-gzip' length 2168446 bytes (2.1 Mb)
>>> opened URL
>>> ==================================================
>>> downloaded 2.1 Mb
>>> * Installing *source* package 'RGtk2' ...
>>> checking for pkg-config... /usr/local/bin/pkg-config
>>> checking pkg-config is at least version 0.9.0... yes
>>> checking for LIBGLADE... no
>>> configure: WARNING: libglade not found
>>> checking for INTROSPECTION... no
>>> checking for GTK... no
>>> configure: error: GTK version 2.8.0 required
>>> ERROR: configuration failed for package 'RGtk2'
>>> ** Removing '/Library/Frameworks/R.framework/Resources/library/ 
>>> RGtk2'
>>> The downloaded packages are in
>>> 	/private/var/folders/CI/CIUrzruqFvKG37WOj2xd6E+++TI/-Tmp-/ 
>>> RtmpqK95DC/downloaded_packages
>>> Updating HTML index of packages in '.Library'
>>> Warning message:
>>> In install.packages("RGtk2", type = "source") :
>>> installation of package 'RGtk2' had non-zero exit status
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list