Skip to content

rgl build warnings and loading error on Linux

11 messages · Liviu Andronic, Dirk Eddelbuettel, Paul Smith +2 more

#
Dear useRs,

I have several problems in using rgl-0.77 (and recent earlier
versions) on Gentoo Linux with a custom-built v. 2.6.22 kernel.
Currently I use R-2.6.1.

When I build rgl,
# R CMD INSTALL "/home/liviu/inst/dwn/R/rgl_0.77.tar.gz"
or
install.packages("rgl", dependencies=TRUE, method ="wget"),

I notice the following warning messages:
i686-pc-linux-gnu-g++ -I/usr/lib/R/include -I/usr/lib/R/include
-I/usr/local/include    -fpic  -O2 -march=pentium-m -pipe
-fomit-frame-pointer -std=gnu99 -c api.cpp -o api.o
cc1plus: warning: command line option "-std=gnu99" is valid for C/ObjC
but not for C++

The warning message itself is repeated during the entire build
process. However, the package builds fine, but fails to load:
Error in dyn.load(file, ...) :
  unable to load shared library '/usr/lib/R/library/rgl/libs/rgl.so':
  /usr/lib/R/library/rgl/libs/rgl.so: undefined symbol: glTexCoordPointer
Error : .onLoad failed in 'loadNamespace' for 'rgl'
Error: package/namespace load failed for 'rgl'

I had the exact same error message with rgl_0.76.

Could anyone suggest how to make rgl build correctly?
Liviu
#
On 16/03/2008 3:38 PM, Liviu Andronic wrote:
It sounds as though it is not finding the OpenGL libs when it 
configures.  That function should be in libGL.so.

Duncan Murdoch
#
On 16 March 2008 at 17:00, Duncan Murdoch wrote:
| On 16/03/2008 3:38 PM, Liviu Andronic wrote:
| > Dear useRs,
| > 
| > I have several problems in using rgl-0.77 (and recent earlier
| > versions) on Gentoo Linux with a custom-built v. 2.6.22 kernel.
| > Currently I use R-2.6.1.
| > 
| > When I build rgl,
| > # R CMD INSTALL "/home/liviu/inst/dwn/R/rgl_0.77.tar.gz"
| > or
| > install.packages("rgl", dependencies=TRUE, method ="wget"),
| > 
| > I notice the following warning messages:
| > i686-pc-linux-gnu-g++ -I/usr/lib/R/include -I/usr/lib/R/include
| > -I/usr/local/include    -fpic  -O2 -march=pentium-m -pipe
| > -fomit-frame-pointer -std=gnu99 -c api.cpp -o api.o
| > cc1plus: warning: command line option "-std=gnu99" is valid for C/ObjC
| > but not for C++
| > 
| > The warning message itself is repeated during the entire build
| > process. However, the package builds fine, but fails to load:
| >> library(rgl)
| > Error in dyn.load(file, ...) :
| >   unable to load shared library '/usr/lib/R/library/rgl/libs/rgl.so':
| >   /usr/lib/R/library/rgl/libs/rgl.so: undefined symbol: glTexCoordPointer
| > Error : .onLoad failed in 'loadNamespace' for 'rgl'
| > Error: package/namespace load failed for 'rgl'
| > 
| > I had the exact same error message with rgl_0.76.
| > 
| > Could anyone suggest how to make rgl build correctly?
| 
| It sounds as though it is not finding the OpenGL libs when it 
| configures.  That function should be in libGL.so.

For what it is worth, the Debian r-cran-rgl packages uses these Build-Depends
which may or may not map into similar Gentoo packages:

Build-Depends: debhelper (>= 5.0.0), r-base-dev (>= 2.6.2), cdbs, \
	       libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, \
	       libpng12-dev, libx11-dev, libxt-dev, x-dev

So try looking for libgl and libglu, possibly in their mesa implementations. 

Hth, Dirk
#
On Sun, 16 Mar 2008, Dirk Eddelbuettel wrote:

            
install.packages("rgl") and dyn.load("PATH.TO.rgl.so/rgl.so") work on my 
Gentoo box. (I can't run library(rgl) from home without X so I cannot say 
what else works.)

Along the lines of Dirk's suggestions, recent R-ebuilds use

CDEPEND="dev-lang/perl
         >=dev-libs/libpcre-7.3
         app-arch/bzip2
         virtual/blas
         virtual/ghostscript
         readline? ( sys-libs/readline )
         jpeg? ( media-libs/jpeg )
         png? ( media-libs/libpng )
         lapack? ( virtual/lapack )
         tk? ( dev-lang/tk )
         X? ( x11-libs/libXmu x11-misc/xdg-utils )"

and of course all of THEIR dependencies.

But I'd just try

 	emerge -pD R

to see what would get rebuilt. (This should rebuild out-of-date 
dependencies.)

If you installed R using emerge and anything besides R would get rebuilt, 
then run 'emerge -D R'.

If you followed the R Installation and Admin guide to install R (as I do 
as I hate waiting months for the latest release to be deemed stable enough 
to be unmasked), then emerge everything listed by 'emerge -pD R' up to R 
itself, reinstall R, and try again.

FWIW,

 	equery depgraph R | less

will allow you to check all the R dependencies, but there are over 
1000, so this is probably a bit much.

HTH,

Chuck
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901
#
On Sun, Mar 16, 2008 at 7:38 PM, Liviu Andronic <landronimirc at gmail.com> wrote:
What is your Linux distribution?

Paul
#
On Sun, Mar 16, 2008 at 10:00 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
This is what I have on my system:
localhost liviu # locate libGL.so
/usr/lib/opengl/xorg-x11/lib/libGL.so.1
/usr/lib/opengl/xorg-x11/lib/libGL.so.1.2
/usr/lib/opengl/xorg-x11/lib/libGL.so
/usr/lib/libGL.so

However, the funny thing is that "/usr/lib/libGL.so" belongs to no
package, while the other libGL.so belongs to media-libs/mesa.
localhost liviu # equery b /usr/lib/libGL.so
[ Searching for file(s) /usr/lib/libGL.so in *... ]

localhost liviu # equery b /usr/lib/opengl/xorg-x11/lib/libGL.so
[ Searching for file(s) /usr/lib/opengl/xorg-x11/lib/libGL.so in *... ]
media-libs/mesa-7.0.2 (/usr/lib/opengl/xorg-x11/lib/libGL.so -> libGL.so.1.2)

localhost liviu # eix media-libs/mesa
[I] media-libs/mesa
     Available versions:  6.5.2-r1 (~)7.0.2
     Installed versions:  7.0.2(22:55:32 26/02/08)

Do you think removing /usr/lib/libGL.so is reasonable?
#
On Mon, Mar 17, 2008 at 1:54 AM, Charles C. Berry <cberry at tajo.ucsd.edu> wrote:
emerge -tvaD R proposes me to emerge all out-dated packages found on
my system, from gimp to dbus (currently 292,146 kB). Do you think it
is possible to simply emerge/pinpoint R's out-dated dependencies?  (I
haven't yet found how to do this.)


Thanks,
Liviu
#
Liviu Andronic wrote:
You'd need to ask a Gentoo expert that.  I have very little experience 
with Linux, and none with Gentoo.

But if you can determine which one of those rgl attempts to load, it 
would make sense to temporarily disable that one just to see if it helps.

Duncan Murdoch
#
On Mon, 17 Mar 2008, Liviu Andronic wrote:

            
Are you sure?! Perhaps you slipped in a '-N' without noticing?

On my Gentoo system, 'emerge -tvaD R' gives only the dependencies of R 
even though there are other things needing to be rebuilt.

In any case, emerge -tvaD R should show you what dependencies of R will be 
rebuilt.

But if it doesn't, dig into 'equery depgraph R'.

HTH,

Chuck

p.s. you really should 'emerge system' and 'emerge world' fairly often to 
keep your system up to date. See

 	http://gentoo-wiki.com/HOWTO_Maintain_Gentoo_-_%22Best_Practices%22
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901
#
On Mon, Mar 17, 2008 at 11:07 PM, Liviu Andronic <landronimirc at gmail.com> wrote:
I moved "/usr/lib/libGL.so" to "/usr/lib/libGL.so.bak" (it seemed like
a broken soft link) and recreated a "/usr/lib/libGL.so" that linked to
"/usr/lib/opengl/xorg-x11/lib/libGL.so.1.2".
liviu at localhost ~ $ ls -l /usr/lib/libGL.so
lrwxrwxrwx 1 root root 32 2008-03-18 12:16 /usr/lib/libGL.so ->
opengl/xorg-x11/lib/libGL.so.1.2

However, the problem was not solved. A rebuilt rgl generates the same
error on library load:
Error in dyn.load("/usr/lib/R/library/rgl/libs/rgl.so") :
  unable to load shared library '/usr/lib/R/library/rgl/libs/rgl.so':
  /usr/lib/R/library/rgl/libs/rgl.so: undefined symbol: glTexCoordPointer

Is there anything else that I could try?
#
On Tue, 18 Mar 2008, Liviu Andronic wrote:

            
Below substitute 'nvidia-drivers' or whatever you use for 
<your-video-drivers>

 	emerge -D mesa <your-video-drivers>
 	revdep-rebuild -X
 	R
 	install.packages("rgl")
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901