Re: [Rd] How to get R to compile with PNG support

From: Karl-Dieter Crisman <>
Date: Thu, 21 Apr 2011 11:47:15 -0400

Thanks for all the feedback. First, our update, then two responses.

>From Jason Grout:

I finally got it working. After mucking around in the R configure file a bit and trying out some of the different tests, as well as comparing a working system with our broken system, I realized that `pkg-config --exists pangocairo` was working on the good system and not working on the broken system. So I installed libpango1.0-dev, and now R picks up the cairo package, which in turn means that my capabilities is now:

> capabilities()

   jpeg      png     tiff    tcltk      X11     aqua http/ftp  sockets
 libxml     fifo   cledit    iconv      NLS  profmem    cairo
   TRUE     TRUE     TRUE     TRUE     TRUE    FALSE     TRUE

So in short, I think what I did was install libcairo-dev and libpango1.0-dev. There might have been other stuff in there that was needed; I'm not sure. When I build a new system again, I'll try just installing those packages and see if it is sufficient. For the record, I had also installed xorg-dev as well.

My comment: As someone who didn't know what configure scripts were a couple years ago, this is maddening; I don't see anything about libpango or whatever in the FAQs. Luckily, Jason knows a lot more than I do!


> | Note that we have installed the cairo devel package on this very
> | machine, but it's not being picked up - maybe it's looking in the
> | wrong place?  That is one of the reasons this is confusing.
> You have to understand that even though this problem may seem urgent and
> novel to you and the Sage team,

Novel, yes; urgent only to us, certainly we don't assume it's urgent to you :)

> it is actually about as old as the web and R
> itself.  In a nutshell, we all (in the people reading r-help and r-devel
> sense) have been explaining to folks since the late 1990s that in order to
> run png() to 'just create some charts for a webserver' ... you need an X11
> server because that is where the font metrics come from. Or else no png for

It's true this is findable, but the difference between having X11 on the system and having the display is arcane for those who just want to use R. But I understand your point.

> is life.  System such as Sage become so large because having things like this
> around on all deployment systems implies (at least to some degree)
> replicating fundamental OS level features because they unfortunately have
> supply things missing or broken across OSs.

Yes, that is true. We know of many people who download Sage because it's the easiest way to install Z, where Z is some specific mathematical program that is impossible to configure properly without special knowledge. Or, until fairly recently, to get Cython.


That's new to me that X11 is installed by default now, but it looks like you are right. However, we don't rely on this for Mac; we make sure to configure for quartz when we build - which I assume is separate from the other stuff? But updating the FAQ about this would be really great for future users :)

Also thanks for the hint on all the other (possibly) needed stuff. Yikes! AFAIK this is an Ubuntu machine we're talking about.

To all - if we come up with any more reliable way to make this work universally, i.e. with *exact* instructions for what to download, we will definitely pass that upstream. Thank you. mailing list Received on Thu 21 Apr 2011 - 16:07:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 21 Apr 2011 - 19:30:52 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive