ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

tl;dr: I don't think this is a ROS issue. It is more a platform / Linux distro packaging and configuration issue. Package your lib properly, make that package properly register itself as a(n) (alternative) OpenGL library (either with Mesa or some other piece of infrastructure, I don't know), and maybe also make the package pretend it provides whatever dependency other pkgs might depend on (using the Debian provides key fi).

For inspiration: look at how the NVidia or AMD drivers register their OpenGL implementations. NVidia doesn't go around asking how they should change everyone else's packages to use their OpenGL libs, do they?


Linux binaries really don't care which particular package a library they are using came from. All they 'care' about (and that is in quotes because obviously these are lifeless collections of electrons with no sentience whatsoever) is that specific pieces of code can be found at specific addresses whenever they are needed. Whether that code is stored in libsomething.so.1.2.3.4.5 from libsomething-1.2_amd64.deb or in libmy_own_version_I_just_compiled.so built from sources does not matter.

In your specific situation: as long as your alternative OpenGL implementation is found before any others (or: is the only one registered in the system) it will be used. This is all completely orthogonal to whatever dependencies (debian) packages have specified.

To get your library used instead of another one I believe you have to do two things:

  1. put your library on the dyn lib loader search path so it gets loaded whenever a process needs libGL.so.1 (or whatever)
  2. make sure that the package manager understands that your package also provides whatever it is that is the 'normal' OpenGL providing package (Debian control files allow you to specify a provides field for this).

This way, whenever an OpenGL implementation (read: dynamic library) needs to be loaded, yours is selected.

I'm not sure whether #2 is actually needed, but it could be necessary, depending on how OpenGL libs are registered with the system (and possibly to placate tools like rosdep and apt).

To implement this, I would try to find out how to register OpenGL implementations on Linux systems (probably only Ubuntu, as that is what most of your questions have been about). Once you solve that bit, I expect the rest (and not just ROS) to start using that automatically.

tl;dr: I don't think this is a ROS issue. It is issue and I also don't think that changing the dependency declarations for each and every ROS package that might use OpenGL is the way to approach this.

This seems more like a platform / Linux distro packaging and configuration issue. issue.

Package your lib properly, make that package properly register itself as a(n) (alternative) OpenGL library (either with Mesa or some other piece of infrastructure, I don't know), and maybe also make the package pretend it provides whatever dependency other pkgs might depend on (using the Debian provides key fi).

For inspiration: look at how the NVidia or AMD drivers register their OpenGL implementations. NVidia doesn't go around asking how they should change everyone else's packages to use their OpenGL libs, do they?


Linux binaries really don't care which particular package a library they are using came from. All they 'care' about (and that is in quotes because obviously these are lifeless collections of electrons with no sentience whatsoever) is that specific pieces of code can be found at specific addresses whenever they are needed. Whether that code is stored in libsomething.so.1.2.3.4.5 from libsomething-1.2_amd64.deb or in libmy_own_version_I_just_compiled.so built from sources does not matter.

In your specific situation: as long as your alternative OpenGL implementation is found before any others (or: is the only one registered in the system) it will be used. This is all completely orthogonal to whatever dependencies (debian) packages have specified.

To get your library used instead of another one I believe you have to do two things:

  1. put your library on the dyn lib loader search path so it gets loaded whenever a process needs libGL.so.1 (or whatever)
  2. make sure that the package manager understands that your package also provides whatever it is that is the 'normal' OpenGL providing package (Debian control files allow you to specify a provides field for this).

This way, whenever an OpenGL implementation (read: dynamic library) needs to be loaded, yours is selected.

I'm not sure whether #2 is actually needed, but it could be necessary, depending on how OpenGL libs are registered with the system (and possibly to placate tools like rosdep and apt).

To implement this, I would try to find out how to register OpenGL implementations on Linux systems (probably only Ubuntu, as that is what most of your questions have been about). Once you solve that bit, I expect the rest (and not just ROS) to start using that automatically.

tl;dr: I don't think this is a ROS issue and I also don't think that changing the dependency declarations for each and every ROS package that might use OpenGL is the way to approach this.

This seems more like a platform / Linux distro packaging and configuration issue.

Package your lib properly, make that package properly register itself as a(n) (alternative) OpenGL library (either with Mesa or some other piece of infrastructure, I don't know), and maybe also make the package pretend it provides whatever dependency other pkgs might depend on (using the Debian provides key fi).

For inspiration: look at how the NVidia or AMD drivers register their OpenGL implementations. NVidia doesn't go around asking how they should change everyone else's packages to use their OpenGL libs, do they?


Linux binaries really don't care which particular package a library they are using came from. All they 'care' about (and that is in quotes because obviously these are lifeless collections of electrons with no sentience whatsoever) is that specific pieces of code can be found at specific addresses whenever they are needed. Whether that code is stored in libsomething.so.1.2.3.4.5 from libsomething-1.2_amd64.deb or in libmy_own_version_I_just_compiled.so built from sources does not matter.

In your specific situation: as long as your alternative OpenGL implementation is found before any others (or: is the only one registered in the system) it will be used. This is all completely orthogonal to whatever dependencies (debian) packages have specified.

To get your library used instead of another one I believe you have to do two things:

  1. put your library on the dyn lib loader search path so it gets loaded whenever a process needs libGL.so.1 (or whatever)
  2. make sure that the package manager understands that your package also provides whatever it is that is the 'normal' OpenGL providing package packages contain (Debian control files allow you to specify a provides field for this).

This way, whenever an OpenGL implementation (read: dynamic library) needs to be loaded, yours is selected.

I'm not sure whether #2 is actually needed, but it could be necessary, depending on how OpenGL libs are registered with the system (and possibly to placate tools like rosdep and apt).

To implement this, I would try to find out how to register OpenGL implementations on Linux systems (probably only Ubuntu, as that is what most of your questions have been about). Once you solve that bit, I expect the rest (and not just ROS) to start using that automatically.