<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
<br>
I have build XCrySDen for openSUSE/SLES; feel free to use/link to<br>
See:
<a class="moz-txt-link-freetext" href="http://software.opensuse.org/search?baseproject=ALL&p=1&q=xcrysden">http://software.opensuse.org/search?baseproject=ALL&p=1&q=xcrysden</a><br>
<br>
Those builds work like a charm under x86(-32, i686) but they crash
under x86-64, which seems to be a bug in XCrySDen (which by chance
works under i686): There seems to be no OpenGL rendering context when
calling C/lightning.c's LoadLights. The crash happens for the first
call to glLightfv, namely:<br>
<br>
/* take care of lights */<br>
for ( il=0; il<GLPAR_MAXLIGHT; il++) {<br>
if ( light[il].isenabled ) {<br>
glLightfv(_LIGHT[il], GL_AMBIENT, light[il].ambient);<br>
<br>
The issue can be reproduced when creating a program (cf. below) which
just contains the call to glLightfv. If I use GLUT to create a
rendering context before calling glLightfv, it works on x86-64 without
crashing.<br>
<br>
I have been told that calling glLightfv without first creating a
rendering context is a bug, cf.<a
href="http://sourceforge.net/mailarchive/message.php?msg_name=4B55D3B5.9010506%40vmware.com">
http://sourceforge.net/mailarchive/message.php?msg_name=4B55D3B5.9010506%40vmware.com</a><br>
<br>
Could you please fix XCrySDen in this regard. Thanks!<br>
<br>
I have also filled a bugreport for Mesa to fix the NULL pointer issue,
cf. <a class="moz-txt-link-freetext" href="https://bugs.freedesktop.org/show_bug.cgi?id=26121">https://bugs.freedesktop.org/show_bug.cgi?id=26121</a><br>
<br>
Tobias<br>
<br>
PS: The issue is not new, there was before a report of this crash, cf.
<a class="moz-txt-link-freetext" href="http://www.democritos.it/pipermail/xcrysden/2007-May/000375.html">http://www.democritos.it/pipermail/xcrysden/2007-May/000375.html</a><br>
<br>
PPS: The minimal working/failing example is:<br>
<br>
#include <GL/gl.h><br>
#include <GL/glut.h><br>
<br>
int main (int argc, char** argv)<br>
{<br>
GLfloat ambient[4] = {0.2, 0.2, 0.2, 1.0};<br>
<br>
/* It crashes on x86-64 when one comments all glut* lines. */<br>
glutInit(&argc, argv);<br>
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);<br>
glutInitWindowSize (250, 250);<br>
glutInitWindowPosition (100, 100);<br>
glutCreateWindow ("hello");<br>
<br>
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);<br>
<br>
glutMainLoop();<br>
return 0;<br>
}<br>
<br>
PPPS: In order to build XCrySDen, I had to patch C/readstrf.c to use
"size_t linesize" rather than "int". Additionally, I had to disable the
internal implementation of getline/getdelim in favour of the glibc
version (i.e. #define _GNU_SOURCE; #include <stdio.h> in
C/getline.h).<br>
Additionally, I had to add a missing protype for
cryGeneralGridRegPeriodInterpolator_f_LCASI3D:<br>
<br>
--- C/crySurf.c.orig 2009-12-09 19:29:25.000000000 +0100<br>
+++ C/crySurf.c 2009-12-09 19:35:07.000000000 +0100<br>
@@ -46,6 +46,7 @@<br>
extern void xcSurfSmoothing( ISOSURFACE *iso, float isolevel );<br>
<br>
extern float ***cryRegPeriodInterpolator_f_LCASI3D(int n[3], int
degree[3], float ***src);<br>
+extern float ***cryGeneralGridRegPeriodInterpolator_f_LCASI3D(int[3],
int[3], float***);<br>
<br>
<br>
static void Set_Orig_and_Size( NEW_WIN_CONTEXT *wc, MOL_SURF *m,<br>
</body>
</html>