[R] Cairo on windows

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Sep 27 19:34:41 CEST 2007


On Thu, 27 Sep 2007, Moisan Yves wrote:

>> You could also try the cairoDevice package, which should definitely
>> work with the gtk libraries that you probably have from installing
>> GGobi.
>
> Hi Hadley,
>
> I tried that also before posting on R-help :
>
>> library(cairoDevice)
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>        impossible de charger la bibliothèque partagée 'C:/PROGRA~1/R/R-25~1.1/library/cairoDevice/libs/cairoDevice.dll':
>  LoadLibrary failure:  La procédure spécifiée est introuvable.
>
>
> Erreur : le chargement du package / espace de noms a échoué pour 
> 'cairoDevice'
>
> Translation : impossible to load shared library 
> 'C:/PROGRA~1/R/R-25~1.1/library/cairoDevice/libs/cairoDevice.dll'
>
> The library *is* at C:/Program Files/R/R-2.5.1/library/cairoDevice/libs 
> so I'm wondering if the path mentioned in the error log is where 
> 'library' is looking or if that path gets expanded (e.g. "PROGRA~1" 
> becomes "Program Files").  I looked at library to see if I can supply it 
> with a hard path where to find the dll but playing with libpath and 
> lib.loc won't help.  Is that a matter of Cairo and cairoDevice not 
> installing properly on Windows ?

The message means that the DLL exists but that there is a problem loading 
it.  That usually means that a dependent DLL is not on the path or not 
recent enough, and under XP you usually get a message box to that effect 
(Vista 64 seems to tell you a lot less by default).

Now, Cairo ships with libcairo-2.dll but does not put it on the path, 
whereas cairoDevice needs more, including libpango and libpangocairo.  So 
you will need to install a Windows version of Gtk+ and make sure it is in 
your path.  I have a feeling I needed a later version than I was using for 
GGobi (I have 2.10.11-1).

My experience is that cairoDevice is a lot slower than Cairo, especially 
on Windows, and about equally flaky.  If you see how many layers are 
involved with Cairo on Windows you will not be surprised.

If all you need is semi-transparency support I suggest you try R 2.6.0 RC
which supports it in the windows() device.

-- 
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