Question

I'm researching how to install OpenGL on a Linux machine (RHEL 6.5). This tutorial that I've found seems pretty straightforward, however I'd like to install OpenGL into a directory of my choosing instead of installing it to /usr or /var or /etc.

Can I install OpenGL to a sub directory of my choosing? If so, how do I not break the pathing?

Was it helpful?

Solution

OpenGL is a graphics API interfacing drivers to the GPU. OpenGL is not some arbitrary library you could install in a random place. Yes there are libraries implementing a pure software implementation of OpenGL. But you normally don't want to use that.

When you develop to use OpenGL, the goal is to use the OpenGL interface library that's present on the target system as part of the GPU drivers. For this to work you link against libGL.so. Do not use any absolute paths for the linker to locate the interface library, otherwise your program will not be portable.

Can I install OpenGL to a sub directory of my choosing? If so, how do I not break the pathing?

You don't. Period, no discussion. The OpenGL implementation comes as part of the graphics drivers and your program uses what's there on the target system. If all what you need is some libGL.so you can link against at build time, just install the Mesa libraries. Mesa is not just a OpenGL software implementation, it's also the foundation on which the open source GPU OpenGL drivers are built upon. If you link your programs against Mesa and only use the symbols as defined in the Linux OpenGL ABI your binary will also work with the fglrx and nvidia proprietary drivers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top