[R] How can I run package ca (correspondence analysis), which needs rgl, without X11?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Apr 23 18:49:28 CEST 2012
On 23/04/2012 17:33, Duncan Murdoch wrote:
> On 23/04/2012 12:05 PM, Jocelyn Ireson-Paine wrote:
>> I want to invoke R on a Linux Web server from Java, in order to analyse
>> data in ways that would take too long to code, and run too slowly, in
>> Java. In particular, to do correspondence analyses. To this end, I've
>> installed R version 2.15.0 on my Web host's x86_64 GNU/Linux machine, and
>> tried using package "ca" to run the "author" example of correspondence
>> analysis on page 3 of http://cran.r-project.org/web/packages/ca/ca.pdf .
>>
>> But there's a problem anent X11. My Web host's Linux doesn't have X11,
>> and
>> its administrator says that it would be hairy for him to install, because
>> of its dependencies. So when I installed R, I did so without X11. Since
>> I'm not going to plot graphs interactively, I wasn't expecting to need it
>> anyway.
>>
>> However, I find that ca requires it. When I did
>> install.packages("ca")
>> (from Bristol mirror), it downloaded rgl_0.92.879.tar.gz and
>> ca_0.33.tar.gz, then started its checks, and then complained:
>> checking for X... no
>> configure: error: X11 not found but required, configure aborted.
>> ERROR: configuration failed for package 'rgl'
>> * removing '/home/jp/r/R-2.15.0/library/rgl'
>> ERROR: dependency 'rgl' is not available for package 'ca'
>> * removing '/home/jp/r/R-2.15.0/library/ca'
>>
>> Why? Not all uses of ca require X11. For example, if you merely call the
>> ca function without plotting anything, that surely can't need it.
>> Moreover, one can plot to PDF without needing X11. I managed to do so
>> from
>> another correspondence-analysis package, ade4, by redirecting my plot to
>> PDF and then running the Bordeaux example near the top of
>> http://pbil.univ-lyon1.fr/ade4/ade4-html/bordeaux.html . (I then
>> converted
>> the PDF to PNG using ImageMagick.) So if ade4 can do this, ca ought to be
>> able to. How can I make it? I don't mind ca complaining when it indeed
>> does need X11, but couldn't the dependency check be postponed until
>> runtime, so as not to spoil things for people to whom it's irrelevant?
>
> That sounds reasonable -- you should ask the maintainer of ca to
> consider listing rgl only as a suggestion, not a dependency. It may
> require some other changes (e.g. checks for the presence of rgl before
> trying to use it).
>
> Or perhaps you could ask for a minimal installation of X11. rgl will be
> happy with the Xvfb "virtual" server. It won't display anything, but the
> calls into X11 work. I don't know if it's any easier to install than all
> of X11, though.
Unfortunately, it is usually harder. Not least because rgl does not
need just Xvfb, but Xvfb with GL (and some extensions) support in the
server. We have this problem on the Solaris Sparc check machine: it is
a server with no GL hardware support, so rgl will not run on it (we ssh
-X from a server with fuller X11 to work around this). And I had a
similar issue with Ubuntu pre-12.04 on a prototype server: no GL drivers
yet.
I do think 'ca' should 'Suggests: rgl' only.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list