Sunday, August 8, 2010

X11, xvfb and R problems.

August 9


In the good old days, my solvers were hosted in a site managed by my Uber geek former Linux system administrator and I have not much of problems running our online solvers. Now that we are standing alone, I find it hard to juggle a lot of system maintenance, design of new solver pages and debugging current solvers.

Oh, yes, the Xvfb server is for those web based apps which insist on having an X11 server. This is a virtual headless X server where you basically define memory screens like in my /etc/init.d/xvfb script with the following contents:


#! /bin/sh

Xvfb :1 -screen 0 1280x1024x16 -fbdir /tmp -fp /usr/share/fonts/X11/misc


It requires font library to be installed also. The script is run only once on startup. However I have problems runnint R:

> x11()
Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype,  : 
  unable to start device X11
In addition: Warning messages:
1: In x11() :
  locale not supported by Xlib: some X ops will operate in C locale
2: In x11() : X cannot set locale modifiers
3: In x11() : unable to open connection to X11 display ''
> 

I notice that the Rweb server, a Perl-R interface is properly working but its default graphics device is postscript. We can go that route later too. But we shall insist that png device be supported to avoid an expensive rewrite of our solver pages with graphics output. Here is the output with the png device:


> png()
Error in X11(paste("png::", filename, sep = ""), width, height, pointsize, :
unable to start device PNG
In addition: Warning messages:
1: In png() :
locale not supported by Xlib: some X ops will operate in C locale
2: In png() : X cannot set locale modifiers
3: In png() : no png support in this version of R
>


We will try to see if we can fix this in a week. Otherwise we shall rewrite our solvers using the ps device.

Here is our last set of installation commands
522 sudo apt-get install libpng12-0 libpng12-devel
523 sudo apt-get install imagemagic
545 sudo apt-get install libcairo
546 sudo apt-get install libcairo-devel
547 sudo apt-get install pango
548 sudo apt-get install libpango
550 sudo apt-get install libpango1.0-dev
551 sudo apt-get install libcairo2-dev

After installation we got upon running R console:
> capabilities()
    jpeg      png     tiff    tcltk      X11     aqua http/ftp  sockets 
    TRUE     TRUE    FALSE    FALSE     TRUE    FALSE     TRUE     TRUE 
  libxml     fifo   cledit    iconv      NLS  profmem    cairo 
    TRUE     TRUE     TRUE     TRUE     TRUE    FALSE     TRUE 
> 
Where is bmp? Ah well, we will always try to improve this article.

No comments:

Post a Comment