Re: [R] RGL on Mac OS X

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Fri 02 Jul 2004 - 03:01:04 EST


Interestingly, on R 1.9.0 and MacOS 10.3.4, I was just able to install rgl without problems this morning. Is this perhaps an issue with movement from 10.2 to 10.3, as I know the X11 stuff changed quite a bit. (I have to admit that I haven't been following this thread closely, but just wanted to point this out.)

On 7/1/04 12:40 PM, "Matthew Cohen" <owl_of_minerva@hotmail.com> wrote:

>
>
> I should have included in my last message a reference to the discussion of
> this issue on the R developers' list:
>
> http://maths.newcastle.edu.au/~rking/R/devel/03a/0982.html
>
> Here, Simon Urbanek says:
>

>> In Mac OS X native version: The R shell wrapper (bin/R) overrides default
>> library search path with DYLD_LIBRARY_PATH and adds (among others)
>> /usr/X11R6/lib. This causes problems when modules need (directly or
>> indirectly) libraries from Apple's frameworks which are masked by X11.
>> Examples for such packages are SJava and RGL. SJava needs JavaVM which in
>> turn loads OpenGL framework. RGL needs the OpenGL framework directly. The
>> problem is that specifying /usr/X11R6/lib in DYLD_LIBRARY_PATH forces the
>> libGL to be loaded from the X11 directory instead of the OpenGL framework
>> library. This crashes R due to missing symbols, since the modules must link
>> to the OpenGL framework. In fact the OpenGL framework libraries load the
>> X11 libraries internally (but not vice versa) - that's why the default load
>> path is frameworks first then X11.

>
> He suggests a temporary workaround:
>
>> Currently a workaround is to remove /usr/X11R6/lib in R from the
>> environment variable prior to loading those packages, but more general
>> solution would be better imho. Is the /usr/X11R6/lib really necessary in
>> the DYLD_LIBRARY_PATH for some older OS X versions? At least for OS X 10.2
>> with Apple's X11 it is not necessary since X11 is already in the default
>> load path.

>
> Clearly the "more general solution" was never arrived at, given that the
> problem still exists. So how, exactly, do I go about implementing this
> workaround? In other words, where is the "usr/X11R6/lib" path included in
> R, and how do I remove it? (and, if necessary, how do I put it back
> afterwards?)
>
> Also, in case it is needed, here is what typing "library(rgl)" returns in R:
>
>> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>>         unable to load shared library
>> "/usr/local/lib/R/library/rgl/libs/rgl.so":
>>   dlcompat: dyld: /usr/local/lib/R/bin/R.bin Undefined symbols:
>> _glArrayElement
>> _glBegin
>> _glBindTexture
>> _glBitmap
>> _glBlendFunc
>> _glCallList
>> _glCallLists
>> _glClear
>> _glClearColor
>> _glClearDepth
>> _glColor3f
>> _glColor4fv
>> _glColor4ubv
>> _glColorMaterial
>> _glColorPointe
>> Error in library(rgl) : .First.lib failed

>
> Any help would be very much appreciated. Also, apologies for sending out
> two messages asking the same question in such a short span of time, but I
> realized after sending that I did not include all of the relevant
> information in the first.
>
> Matt
>
>
> Guide! http://dollar.msn.com
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 02 03:03:12 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:38 EST