Skip to content
Advertisement

Installing VTK: matching usr/lib/libGL.so path to the one in build system config

I’ve been trying to install VTK on my Ubuntu 14.04. I had some trouble getting things to configure since it couldn’t find OpenGL, but I (thought I) fixed that by using

sudo apt-get install freeglut3-dev

and

sudo apt-get install build-essential

as was suggested in this question. However, now I can’t run make because the path to libGL.so isn’t correct. I’ve been searching and finding all sorts of strange solutions but can’t seem to understand any of them, and I’d like to have a clue what I’m doing before I go typing strange commands into terminal. Here are some ideas:

When I type “locate libGL.so”, I get the following:

/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0

Is the problem here that it’s getting it from mesa, and those are dangling symlinks as explained here? In which case, how do I remove them? just rm? I don’t know how to verify that I for sure don’t need those links and I’d rather not delete anything important. Or is the problem related to the .so.1 at the end instead of just .so? Or both?

Another idea: On this website, someone suggested using

sudo ln -s -f -i /usr/lib/libGL.so.1.2 /usr/lib/x86_64-linux-gnu/libGL.so

which I guess in my case would be

sudo ln -s -f -i /usr/lib/libGL.so /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1

right? But regardless, I can’t find this approach anywhere else, and they don’t give any reason or explanation, so I’m a bit reluctant to use it since I really don’t understand what I’d be doing.

One more note: if I type ccmake . and go to the sections labeled “OPENGL_gl_LIBRARY” and “OPENGL_glu_LIBRARY”, the paths (respectively) are /usr/lib/libGL and /usr/lib/x86_64-linux-gnu/libGLU.so.

So perhaps another solution would simply be to replace those with the mesa paths–however, it seems as though I might have to do this over and over again since mesa shouldn’t be default, if I’m not mistaken–so I don’t know whether that’s the best solution.

Advertisement

Answer

When I type “locate libGL.so”, I get the following:

/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0

That’s where they belong. Everything in order.

Is the problem here that it’s getting it from mesa

No

and those are dangling symlinks as explained here?

No

In which case, how do I remove them?

Don’t!

just rm?

Why would you do that? Those are essential libraries part of your system.

Or is the problem related to the .so.1 at the end instead of just .so? Or both?

No. Those belong there, you should read up on sonames


If you can run OpenGL programs then libGL.so is properly installed. The most likely reason is, that the CMake FindOpenGL module doesn’t look in all of the linker cache directories for libGL.so (but I’d be surprised by that). I’d start by properly installing the OpenGL development packages (libgl1-mesa-dev) and try again. And if that doesn’t suffice you can create a symlink /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 → /usr/lib/libGL.so (but that should be the last resort).

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement