[vtkusers] undefined reference to `vtkOSOpenGLRenderWindow::New()

Dominik Szczerba dominik at itis.ethz.ch
Sat May 21 13:12:03 EDT 2011


Hi David,

Many thanks for your input.

I confirm that having all the packages that you mentioned I never
manage to pray VTK_OPENGL_HAS_OSMESA off. Subsequently, I get the
originally reported compilation error.
The only way I found to resolve this problem is to additionally
install libosmesa6-dev and allow VTK_OPENGL_HAS_OSMESA ON. Compiles
correctly and seems to link to nvidia drivers. Works, but quite
unexpectedly, and I do feel unrest for the future,

Interestingly, on my other Ubuntu 11.04/64 installation this is not
necessary. /usr/lib/libGL.so points to the same (mesa) lib. It has the
same version of nvidia driver. The only difference the other machine
is an upgrade from Ubuntu 10.10, the problematic one is a fresh
installation. Another difference is that the former machine as an
older nvidia graphics card (~2 years) known to be supported under
linux, the problematic one is  much newer (nVidia Corporation G94
[Quadro FX 1800]).

So in an essence, you may want to debug why/if libosmesa6 is needed. I
am glad to test any patches.

Regards,
Dominik

On Sat, May 21, 2011 at 2:49 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Dominik,
>
> The directory /usr/lib/nvidia-current is added to run-time library
> path by the following file:
>
> /etc/ld.so.conf.d/GL.conf
>
> This file is part of the nvidia driver installation on 10.04.  So
> ubuntu uses /usr/lib/libGL.so (which points to mesa) at compile
> time, but uses /lusr/lib/nvidia-current/libGL.so.1 at run-time.
>
> It worried me a bit at first, but this setup seems to work fine.
> It has never caused me problems when compiling VTK.
>
> So my guess is that you are seeing problems because you are
> missing an OpenGL devel packages.  Make sure that you have
> the following installed:
>
> mesa-common-dev
> libgl1-mesa-dev
> libglu1-mesa-dev
> xlibmesa-gl-dev
>
> Don't worry that these aren't "nvidia".  The nvidia libs are only
> used at run-time, not at compile-time.
>
> Also, just as you have been doing so far, make sure that
> VTK_OPENGL_HAS_OSMESA is OFF.
>
>  - David
>
>
> On Sat, May 21, 2011 at 6:22 AM, Dominik Szczerba <dominik at itis.ethz.ch> wrote:
>> Thanks for your email.
>>
>> Indeed, initially, I was pointing to the 32 bit nvidia, but pointing
>> to 64 does not work either.
>> It keeps saying it switches to OSMESA because no OPENGL_gl_LIBRARY was
>> found. /usr/lib/libGL.so is there, but points to mesa/libGL.so, not
>> nvidia. Changing symlink by hand changes nothing.
>> Just trying things out blind I have installed libosmesa6 (it was not
>> installed) and then proceeded with the compilation as if using
>> software rendering. Compilation was successful, but then:
>>
>> $ ldd libvtkRendering.so | grep GL
>>        libGL.so.1 => /usr/lib/nvidia-current/libGL.so.1 (0x00007f7986653000)
>>
>> comes quite unexpectedly! Great, but there is certainly something wrong.
>>
>> My preliminary theory is that cmake fails to detect the otherwise
>> correct vendor libGL library properly. Does it sound reasonable or you
>> have another idea? I feel quite a bit of unrest because of it.
>>
>> Thanks
>> Dominik
>>
>> On Fri, May 20, 2011 at 2:07 PM, Kevin H. Hobbs <hobbsk at ohio.edu> wrote:
>>> On 05/20/2011 07:41 AM, Dominik Szczerba wrote:
>>>> I further looked into the problem and I see that cmake is stubborn on
>>>> this variable: VTK_OPENGL_HAS_OSMESA. It always switches it back on,
>>>> even if I set it to off. I do have my nvidia driver under
>>>> /usr/lib32/nvidia-current/libGL.so which I pass as OPENGL_gl_LIBRARY.
>>>> But it still seems unable to find it. Any ideas?
>>>>
>>>
>>> Gaaa not enough nervous in caffeine system. I basically ignored
>>> the second half of your e-mail.
>>>
>>> "/usr/lib32"  you said you were on 64 bit Ubuntu the linker may
>>> not be able to use this as the rest of the app. will be 64 bit
>>> unless you're cross compiling.  Does "-m 32" in CMAKE_CXX_FLAGS
>>> and CMAKE_C_FLAGS do this?
>
>



More information about the vtkusers mailing list