Introduction to libglvnd
The libglvnd package dispatches API calls to a given driver vendor
at runtime. Some of the libraries are simply wrappers to the main
dispatcher. Drivers that are built with libglvnd in mind provide
their own OpenGL implementations. For Mesa-25.1.5, it will install
libEGL_mesa
and libGLX_mesa
. For NVIDIA-575.64.05, it
will provide libEGL_nvidia
,
libGLESv2_nvidia
, and libGLX_nvidia
. Each implementation is specific to
the driver it comes from.
The benefit of doing it that way is that a driver doesn't have to
obey to the architecture an OpenGL vendor applies nor being
absorbed by the vendor.
Important
Read About OpenGL to decide if you want to install
OpenGL implementations from this provider.
libglvnd Dependencies
Recommended
Xorg
Libraries
Installation of libglvnd
Install libglvnd by running the following commands:
mkdir build &&
cd build &&
meson setup --prefix=/usr \
--buildtype=release \
-D gles1=false \
-D hgl=false \
.. &&
ninja
Now as the root
user:
ninja install
lib32 Installation of libglvnd
Install lib32-libglvnd by running the following commands:
rm -rf * &&
CC="gcc -m32" CXX="g++ -m32" \
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
meson setup --prefix=/usr \
--libdir=/usr/lib32 \
--buildtype=release \
-D gles1=false \
-D hgl=false \
.. &&
ninja
Now as the root
user:
DESTDIR=$PWD/DESTDIR ninja install &&
cp -vr DESTDIR/usr/lib32/* /usr/lib32 &&
rm -rf DESTDIR &&
ldconfig
Command Explanations
Note
Inspect meson_options.txt
or
meson.options
for a full list of
options.
--buildtype=release
:
Specify a buildtype suitable for stable releases of the package, as
the default may produce unoptimized binaries.
-D gles1=false
: This
disables an obsolete version of OpenGL ES.
-D hgl=false
: This disables
targeting Haiku by default as this guide is for Linux, not Haiku.
-D gles2=false
: If you don't need
OpenGL ES, use this option. Be sure to read the section
called “About GLES (OpenGL ES)”.
List of packages With Issues
While installing this package can help prevent a lot of issues down
the road, this package can come with some caveats and all of them
are in relation to BLFS. BLFS naturally expects that the only
OpenGL vendor is Mesa, so the instructions will thus assume that
this package has not been installed. The following have known
issues, and solutions:
-
Mesa: In BLFS, a patch is listed in the
Mesa page and will instruct you to apply it. This will
cause an issue unless you explicitly tell the build system
not to link against this package's libraries, which means
having it build its own OpenGL implementations, which will
cause issues of its own. The exact error the patch causes is
a linking error in the final set of steps when building the
demos as it expects functions that are not found in the
specific libraries from this package it tries to link
against.
Either don't apply that patch or follow this book's Mesa-25.1.5
page instead. Thanks to Mesa's build system auto-detecting if
libglvnd is installed, the installation instructions don't
change that much between this book and BLFS. The main
differences are lib32 support and not listing the demos
patch.
-
GLU: In BLFS, the GLU
page explicitly sets the GL vendor to be Mesa as the build
system will otherwise expect libglvnd and libOpenGL
to be installed. While the BLFS
page instructions lead to a successful compilation, the
resulting library does not function properly. You should
follow the SLFS
GLU page instead. It also does check if the vendor is
Mesa.
Contents
Installed Programs:
None
Installed Libraries:
libEGL, libGL, libGLESv2, libGLX,
libGLdispatch, and libOpenGL
Installed Directories:
/usr/include/{EGL,GLES{2,3},glvnd,KHR}
Short Descriptions
libEGL
|
contains EGL window-system API functions
|
libGL
|
is the “legacy” OpenGL library; wrapper
library calling libGLdispatch and libGLX
|
libGLESv2
|
exposes OpenGL ES 2.x and 3.x entrypoints; wrapper
library calling libGLdispatch
|
libGLX
|
dispatches GLX extensions to the right vendor
|
libGLdispatch
|
dispatches OpenGL and TLS to the right vendor
|
libOpenGL
|
is the “new” OpenGL library and exposes
OpenGL entrypoints; wrapper library calling libGLdispatch
|