<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>

<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7232.77">
<TITLE>Re: [vtk-developers] extension wrangler</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText55442 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Whether or not VTK is 
compiled static or dynamic is immaterial.&nbsp; A static build can still link 
against a shared OpenGL library (and call dlopen on it) and a dynamic link might 
still be using a static OpenGL library.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>The problem is, it is hard to accurately 
pick exactly which library file a linker is going to link against.&nbsp; We were 
running into problems where we identified a shared OpenGL library that probably 
should have been used, but the linker was using a different library.&nbsp; And 
if the binaries are moved to a different machine, the whole thing can break 
down.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>If there was a way to query at runtime what 
shared objects were loaded, identify which one was OpenGL, and then call dlopen 
on that, that would probably work.&nbsp; However, I don't know of any way to do 
that query.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>-Ken</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Jeff Lee 
[mailto:jeff@cdnorthamerica.com]<BR><B>Sent:</B> Tue 11/15/2005 2:17 
PM<BR><B>To:</B> Moreland, Kenneth<BR><B>Cc:</B> 
vtk-developers<BR><B>Subject:</B> Re: [vtk-developers] extension 
wrangler<BR></FONT><BR></DIV>
<DIV><BR><BR>
<P><FONT size=2>Moreland, Kenneth wrote:<BR><BR>&gt; The dlopen technique was 
dissabled because it was proving to be<BR>&gt; unreliable.&nbsp; Some of VTK's 
dashboard tests were continually failing<BR>&gt; because VTK was being compiled 
against one OpenGL library (which<BR>&gt; happened to be static) and the dlopen 
was openening a shared object<BR>&gt; library elsewhere.&nbsp; Thus, it would 
look like the extension was loaded<BR>&gt; correctly, but the application would 
crash if you tried to use any of<BR>&gt; the functions.<BR>&gt;<BR>What if the 
dlopen method were only enabled when vtk is built shared?&nbsp; I<BR>saw that 
vtkOpenGLExtensionManagerConfigure.h that does<BR>#define 
OPENGL_LIBRARIES<BR>"/usr/lib/libGL.so;-lSM;-lICE;-lSM;-lICE;/usr/X11R6/lib/libX11.so;/usr/X11R6/lib/libXext.so;/usr/X11R6/lib/libX11.so;/usr/X11R6/lib/libXext.so"<BR><BR>If 
you do dlopen with a null in the first argument, the loader will<BR>search the 
libpath (you don't really need to specify).&nbsp; Is this the kind<BR>of 
behavior we should support?&nbsp; Are there cases when this approach<BR>yields 
undesirable results?&nbsp; This appears to be what glew 
does.<BR>Regards,<BR>-J<BR><BR>&gt;<BR>&gt; Ultimately we could not figure out a 
way to ensure that the dlopen<BR>&gt; tried to open the same library that was 
already being used. (The<BR>&gt; problem gets more compilicated when you compile 
on one machine and run<BR>&gt; on another.) If someone could solve this problem, 
then the dlopen<BR>&gt; method would work just fine.<BR>&gt;<BR>&gt; 
-Ken<BR>&gt;<BR>&gt;<BR>&gt; -----Original Message-----<BR>&gt; From: 
vtk-developers-bounces+kmorel=sandia.gov@vtk.org on behalf of<BR>&gt; Jeff 
Lee<BR>&gt; Sent: Tue 11/15/2005 12:31 PM<BR>&gt; To: vtk-developers<BR>&gt; 
Subject: [vtk-developers] extension wrangler<BR>&gt;<BR>&gt; Hi,<BR>&gt; Does 
anyone know why the extension wrangler in vtk has the fallback<BR>&gt; dlopen 
technique disabled?&nbsp; Is there some way this could be fixed for<BR>&gt; 
systems without glxProcAddressARB functionality?&nbsp; Is the wrangler 
meant<BR>&gt; to be a runtime wrangler, or just compile-time?<BR>&gt; 
Regards,<BR>&gt; Jeff<BR>&gt; 
_______________________________________________<BR>&gt; vtk-developers mailing 
list<BR>&gt; vtk-developers@vtk.org<BR>&gt; <A 
href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</A><BR>&gt;<BR>&gt;<BR><BR>--<BR>Jeff 
Lee<BR>Senior Software Engineer<BR>Computational Dynamics North America 
Ltd<BR>21 Lafayette Street, Suite 230<BR>Lebanon NH 03766 
USA<BR>fax:&nbsp;&nbsp; 603 643 9994<BR>phone: 603 643 9993 x109<BR><A 
href="http://www.cd-adapco.com">http://www.cd-adapco.com</A><BR><BR><BR></FONT></P></DIV>

</BODY>
</HTML>