[R-SIG-Mac] rgl revisions to allow dual install

Duncan Murdoch murdoch at stats.uwo.ca
Mon Dec 11 12:49:54 CET 2006

On 12/10/2006 8:51 PM, stefano iacus wrote:
> It builds fine on PCC and apparently the two libs are in the  
> installed directory.
> The only problem is that both on X11 term and on R.app always the  
> X11 .dll is taken, so no AGL for me any more.
> I don't see any conditionals on .Platform$GUI in the loading of the  
> library though.

It's in the .onLoad function in zzz.R:

   if ( .Platform$OS.type == "unix" ) {
     unixos <- system("uname",intern=TRUE)
     if ( unixos == "Darwin" ) {
       # For MacOS X we have to remove /usr/X11R6/lib from the 
       # because it would override Apple's OpenGL framework
       if ( .Platform$GUI == "AQUA" &&
            file.exists(system.file("libs", "aglrgl.so", package = 
"rgl"))) {
         initValue <- 1
         rgl <<- "aglrgl"

Does the lib get a different name or sit somewhere else on that system? 
  I have the file.exists test in case someone has configured not to 
build the AGL version, but maybe the filename is wrong.  Do you know a 
safe test to see if the lib exists?

On 12/10/2006 8:56 PM, stefano iacus wrote:
 > and, for the standard  shell (i.e. not under xterm), I can open and
 > plot on a  x11() device but during  demo(rgl)
 >  > rgl.open()
 > Error in rgl.open() : rgl.open failed
 >  > rgl.open

The initialization is currently done in .onLoad, and if it fails, no 
additional attempts are made.  I'll see if it's safe to try again.

By the way, did you manually set DISPLAY before you opened the x11 
device?  I get an error in the standard shell when I try that, but 
Sys.putenv fixes it.

Duncan Murdoch

More information about the R-SIG-Mac mailing list