Skip to content

Installing rgl package under Ubuntu

11 messages · Van Campenhout Bjorn, Peter Dalgaard, Duncan Murdoch +2 more

#
Dear Rexperts,

lately I'm having troubles installing the rgl package via
install.packages("rgl", dependencies=T) in the R 2.4.0 backport running
under Ubuntu 6.06 LTS. I get the following error messages, despite
having installed libx11-dev (as recommended in a similar post about SUSE
10.1):

trying URL 'http://cran.xedio.de/src/contrib/rgl_0.68.tar.gz'
Content type 'application/x-gzip' length 701566 bytes
opened URL
==================================================
downloaded 685Kb

* Installing *source* package 'rgl' ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... no
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package 'rgl'
** Removing '/usr/local/lib/R/site-library/rgl'

The downloaded packages are in
        /tmp/Rtmpni68vG/downloaded_packages
Warning message:
installation of package 'rgl' had non-zero exit status in:
install.packages("rgl", dependencies = T)
+---------------------------------------+

Has anyone experienced a similar problem, and what would be the
resolution of the "X11 not found" message?

Thank you in advance!

Greets,
Ivailo
#
On my ubuntu 6.06 LTS, I pass the test (tho I do get errors later during
compilation).  When checking for X, it says:
 
...
Checking for X... Libraries /usr/X11R6/lib, headers
...

I compiled R 2.4.0 from source, which also gave me some trouble when
checking for X.  I think I solved it by installing xserver-xorg-dev.
Hope this gives you some pointers


Bjorn
#
On Fri, 2006-12-15 at 13:44 +0100, Van Campenhout Bjorn wrote:
[snip]
I installed xserver-xorg-dev, but the problem persists :(

Any other hints?

Ivailo
#
Ivailo Stoyanov wrote:
I don't think that is the right package (xserver...dev sounds like
something  for developing X11 servers). Look for something like
xorg-x11-devel  or thereabouts. You likely also need some packages with
"GL" or "Mesa" in the name plus their "dev" versions.
#
On Fri, 2006-12-15 at 14:14 +0100, Peter Dalgaard wrote:
I have located x11-proto-gl-dev and libgl-mesa-dev via synaptic as
containing "gl" "mesa" and "dev", but installing them doesn't get the
problem resoved...

Ivailo
#
On 12/15/2006 8:35 AM, Ivailo Stoyanov wrote:
rgl needs to know where the X11 headers and libs are, and it appears 
that the configure script (which was written by autoconfig) isn't 
finding them.  You probably need to specify them manually, when you run 
configure:

   --x-includes=DIR    X include files are in DIR
   --x-libraries=DIR   X library files are in DIR

If you built R, you can find where R found these by looking at the 
config.log:  search for X_CFLAGS and X_LIBS, and you'll see something like

X_CFLAGS=' -I/usr/X11R6/include'
X_LIBS=' -L/usr/X11R6/lib -lX11 -lXt -lXmu'

which should mean that this would install rgl on this system:

R CMD INSTALL rgl --configure-args="--x-includes=/usr/X11R6/include 
--x-libraries=/usr/X11R6/lib"

(In fact, the configure script found them in those locations by itself.)

Duncan Murdoch
#
On Fri, 2006-12-15 at 14:14 +0100, Peter Dalgaard wrote:
Installing libxt-dev (mentioned in the R-admin manual) helped somewhat
further, but the I've got:

 trying URL 'http://cran.xedio.de/src/contrib/rgl_0.68.tar.gz'
Content type 'application/x-gzip' length 701566 bytes
opened URL
==================================================
downloaded 685Kb

* Installing *source* package 'rgl' ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -I/usr/share/R/include -I/usr/share/R/include -I -DHAVE_PNG_H
-I/usr/include/libpng12 -Iext     -fpic  -g -O2 -c api.cpp -o api.o
In file included from glgui.hpp:9,
                 from gui.hpp:11,
                 from rglview.h:10,
                 from Device.hpp:11,
                 from DeviceManager.hpp:9,
                 from api.cpp:14:
opengl.hpp:24:20: error: GL/glu.h: No such file or directory
api.cpp: In function ?void rgl_user2window(int*, int*, double*, double*,
double*, double*, int*)?:
api.cpp:761: error: ?gluProject? was not declared in this scope
api.cpp: In function ?void rgl_window2user(int*, int*, double*, double*,
double*, double*, int*)?:
api.cpp:789: error: ?gluUnProject? was not declared in this scope
make: *** [api.o] Error 1
chmod: cannot access `/usr/local/lib/R/site-library/rgl/libs/*': No such
file or directory
ERROR: compilation failed for package 'rgl'
** Removing '/usr/local/lib/R/site-library/rgl'
+---------------------------------------------+

Now, knowing the missing file (i.e. glu.h, from the more informative
feedback) I searched http://packages.ubuntu.com for the package
containing glu.h. This turned out to be libglu1-mesa-dev -- installing
it resolved the problem, but now I have to clear up the mess with the
unnecessarily installed *dev packages;)

Thanks for the helpful pointers!

Ivailo
#
On Fri, 2006-12-15 at 08:55 -0500, Duncan Murdoch wrote:
[snip]
Thanks for the response, but meanwhile I figured the solution and have
just posted it to the list!

It seems that the r-base-dev package from the Ubuntu R backport doesn't
provide *all* the packages necessary to build add-on libraries.

Greets,
Ivailo
#
On 12/15/2006 9:01 AM, Ivailo Stoyanov wrote:
I don't think it could:  package writers are free to require anything 
they like.  rgl may be the only package requiring the OpenGL 
headers/libs, for instance.

Duncan Murdoch
#
On Fri, 2006-12-15 at 09:03 -0500, Duncan Murdoch wrote:
[snip]
You're right, but until I had libxt-dev on my system I couldn't find out
what else I need to build rgl successfully.

Ivailo
#
On 15 December 2006 at 16:01, Ivailo Stoyanov wrote:
| It seems that the r-base-dev package from the Ubuntu R backport doesn't
| provide *all* the packages necessary to build add-on libraries.

Re-read and re-think what you wrote there: you expect the r-base-dev package
to provide _all_ possible dependencies for _all_ possible packages. The
Oracle of Delphi in a few lines of a meta file?

That obviously can't work.  r-base-dev tries to give you all you need to
compile the _most common_ packages by providing essentially what R itself
needs.  Specialised packages that use other, more arcane libraries and
headers such as OpenGL are obviously not included.

Lastly, I can only urge users of Debian and Ubuntu to remember that because
we have _native_ packages on Debian and Ubuntu, we also have _native_
Build-Depends information.  Had you tried

	$ sudo apt-get build-dep r-cran-rgl

you might have gotten to the finish line much quicker.

Regards, Dirk