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

Simon Urbanek simon.urbanek at r-project.org
Thu Apr 21 16:46:56 CEST 2011


On Apr 21, 2011, at 9:51 AM, Karl-Dieter Crisman wrote:

> Thanks for your replies, Dirk and Matt.
> 
> On Thu, Apr 21, 2011 at 7:49 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
>> 
>> On 20 April 2011 at 12:16, Karl-Dieter Crisman wrote:
>> | ++++
>> |
>> | R is now configured for i686-pc-linux-gnu
>> |  Source directory:          .
>> |  Installation directory:    /home/sageserver/sage/local
>> |  C compiler:                gcc -std=gnu99
>> | -I/home/sageserver/sage/local/include
>> | -L/home/sageserver/sage/local/lib/   Fortran 77 compiler:
>> | sage_fortran  -g -O2
>> |  C++ compiler:              g++  -g -O2
>> |  Fortran 90/95 compiler:    sage_fortran -g -O2  Obj-C compiler:
>> |  Interfaces supported:      X11
>> |  External libraries:        readline, BLAS(ATLAS), LAPACK(generic)
>> | Additional capabilities:   PNG, NLS
>> |  Options enabled:           shared R library, R profiling
>> |  Recommended packages:      yes
>> |
>> |
>> | However:
>> |
>> |
>> | > capabilities()
>> |    jpeg      png     tiff    tcltk      X11     aqua http/ftp  sockets
>> |   FALSE    FALSE    FALSE    FALSE    FALSE    FALSE     TRUE     TRUE
>> |
>> |  libxml     fifo   cledit    iconv      NLS  profmem    cairo
>> |    TRUE     TRUE     TRUE     TRUE     TRUE    FALSE    FALSE
>> 
>> Random guess: did you connect via ssh without x11 forwarding?
> 
> Almost certainly, yes.  (I am an interlocutor right now for someone
> who is actually doing this, my apologies.)
> But it's a machine we just ssh into, I'm pretty sure, though it does
> serve up web pages.
> 
>> I cannot see how configure find png.h and libpng but the binary fails. As all
>> other X11 related formats are also shown false, methinks you are without a
>> valid DISPLAY.
> 
> That is quite likely.  So it sounds like for png() to be set to use
> the X11 device, there has to (somewhere) be a visual output -
> presumably that is the part LOGICAL(ans)[i++] = X11; in Matt's answer.
> 
>> That is actually an issue related to your headless use---which is what Sage
>> may default too; see the R FAQ on this and the prior discussion on the
>> xvfb-run wrapper which 'simulates' an x11 environment (which you need for
>> png).  So maybe you should revisit the Cairo devices---they allow you
>> plotting without an x11 device (and also give you SVG).
>> 
> 
> Yeah, and I saw your SO answer on this (after the fact) as well.
> 
> In some sense, we are just trying to get graphics on one machine.
> 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.
> 
> But in a larger sense, because of Sage's "batteries included"
> philosophy (which we know not everyone agrees with!), we would like to
> have a one-shot way so that *everyone* will see R graphics, not just
> people whose binary happens to have been compiled on a machine that
> has X and a display.  If that means adding 22.5 MB to our tarball for
> Cairo... maybe, maybe not.
> 

Maybe yes in that case - that's what we do in Mac binaries -- and on Mac users always expect  "batteries included" so we include libcairo statically. (The same applies for R packages like Cairo which provides png support independent of X11).

Cheers,
Simon


> I won't copy Matt's message here, but I appreciate the pointers to
> exactly where these things are defined very much - without knowing
> where to look, it would be a long slog.   Hopefully we'll have some
> success!  Thanks for the replies, and for any other ideas.
> 
> Karl-Dieter
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 



More information about the R-devel mailing list