[R] Error with rgl loading in BATCH mode

Umberto Amato u.amato at iac.cnr.it
Tue Dec 11 10:39:47 CET 2007

Dear all,
I'm trying to run a script that requires KernSmooth in BATCH mode but I get 
an error while loading rgl library that is needed by KernSmooth. Actually I 
have to run several batch files through a queue of a cluster, so I wouldn't 
need graphics at all.
I installed the latest releases of R (2.6.1) and rgl on my CentOS 4.2 Linux 
(clone of Red Hat EL) endowed with Rocks 4.2.1 suite for clusters.
If I run the R script from a ssh session on my PC equipped with X Server (I 
use Xming), everithing goes smoothly, rgl package is loaded correctly and 
the script runs smoothly. However when run in batch mode (that is through a 
submission to the cluster batch queue, where X Server evidently is not 
available) I have the following error when loading rgl:

Loading required package: KernSmooth
KernSmooth 2.22 installed
Copyright M. P. Wand 1997
Loading required package: mvtnorm
Loading required package: rgl
Error in dyn.load(file, ...) :
  unable to load shared library '/opt/R-2.6.1/library/rgl/libs/rgl.so':
  libGLU.so.1: cannot open shared object file: No such file or directory
Error : .onLoad failed in 'loadNamespace' for 'rgl'
Error: package 'rgl' could not be loaded
Execution halted

I am issuing the follwing R bach command:
R CMD BATCH --vanilla --slave KS_S1.R

This kind of error appeared 3 years ago on this same list in a different 
contest: no final solution was given, but apparently newer versions of rgl 
fixed the problem. Does anyone have a clue about how to manage this problem 
for BATCH mode? Alternatively, since rgl shouldn't be needed at all becasue 
running in BATCH mode, does someone know how to prevent KernSmooth loading 

Thanks so much

Umberto Amato
Istituto per le Applicazioni del Calcolo 'Mauro Picone' CNR
Sede di Napoli
Via Pietro Castellino 111
I-80131 Napoli, Italy

Tel. +39 0816132377
Fax +39 0816132597
E-mail: u.amato at iac.cnr.it

More information about the R-help mailing list