From w.northcott at unsw.edu.au  Wed Jul 20 01:25:36 2005
From: w.northcott at unsw.edu.au (Bill Northcott)
Date: Wed, 20 Jul 2005 09:25:36 +1000
Subject: [Rd] Problems in rgl on MacOS X
In-Reply-To: <mailman.5.1121767200.6361.r-devel@r-project.org>
References: <mailman.5.1121767200.6361.r-devel@r-project.org>
Message-ID: <ECD43FC0-6133-4F92-9687-BEFFBA96208B@unsw.edu.au>

I have recently been trying to build rgl on MacOS X 10.4 using  
R-2.1.1 with gcc-4.0 5026 and gfortran.

The R binary I built without problems and it includes libpng and Tcl/ 
Tk on X11.  Rcmdr works correctly.

The rgl build produces a large number of warnings like:
g++ -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/ 
include -I/System/Library/Frameworks/OpenGL.framework/Headers  -I/usr/ 
X11R6/include -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/usr/ 
local/include  -Wall -pedantic -fno-exceptions -fno-rtti -fno-common   
-g -O2 -c fps.cpp -o fps.o
types.h:76: warning: 'class DestroyHandler' has virtual functions but  
non-virtual destructor
gui.h:55: warning: 'class gui::WindowImpl' has virtual functions but  
non-virtual destructor
gui.h:89: warning: 'class gui::GUIFactory' has virtual functions but  
non-virtual destructor
pixmap.h:39: warning: 'class PixmapFormat' has virtual functions but  
non-virtual destructor

More seriously it breaks in scene.cpp thus:
g++ -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/ 
include -I/System/Library/Frameworks/OpenGL.framework/Headers  -I/usr/ 
X11R6/include -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/usr/ 
local/include  -Wall -pedantic -fno-exceptions -fno-rtti -fno-common   
-g -O2 -c scene.cpp -o scene.o
types.h:76: warning: 'class DestroyHandler' has virtual functions but  
non-virtual destructor
gui.h:55: warning: 'class gui::WindowImpl' has virtual functions but  
non-virtual destructor
gui.h:89: warning: 'class gui::GUIFactory' has virtual functions but  
non-virtual destructor
pixmap.h:39: warning: 'class PixmapFormat' has virtual functions but  
non-virtual destructor
scene.cpp: In member function 'void Texture::beginUse(RenderContext*)':
scene.cpp:1994: error: invalid conversion from 'int*' to 'GLint*'
make: *** [scene.o] Error 1
ERROR: compilation failed for package 'rgl'

The compilers complaint appears to be legitimate in gl.h there is:
......
typedef short GLshort;
typedef long GLint;
typedef long GLsizei;
........
extern void glGetHistogramParameteriv (GLenum target, GLenum pname,  
GLint *params);
extern void glGetIntegerv (GLenum pname, GLint *params);
extern void glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
.............

and in scene.cpp the relevant lines read:
..........
     unsigned int maxSize;
     glGetIntegerv(GL_MAX_TEXTURE_SIZE, (int*) &maxSize);
.......
which seems to give the compiler due cause to barf given the header.

I got it to build by changing the code to:
     GLint maxSize;
     glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &maxSize);
but this generates warnings about signed and unsigned further down  
scene.cpp.  The resulting code works but  it is clearly not right.

I can't find an email address for the maintainer and his web site  
seems to be off the air just now.

Bill Northcott



[Rd] Problems in rgl on MacOS X
Bill Northcott