Mesa-18.3.3

#### Beyond Linux® From Scratch - Version 2019-02-27

### Chapter 24. X Window System Environment

- Prev

  xcb-util-cursor-0.1.3

- Next

  xbitmaps-1.1.2

- Up
- Home

# Mesa-18.3.3

## Introduction to Mesa

Mesa is an OpenGL compatible 3D graphics library.

### Note

Mesa is updated relatively often. You may want to use the latest available 18.3.x mesa version.

This package is known to build and work properly using an LFS-8.4 platform.

### Package Information

- Download (HTTP): https://mesa.freedesktop.org/archive/mesa-18.3.3.tar.xz

- Download (FTP): ftp://ftp.freedesktop.org/pub/mesa/mesa-18.3.3.tar.xz

- Download MD5 sum: e9d1a24dbd5ca20efa75b9a29eb4566f

- Download size: 11 MB

- Estimated disk space required: 361 MB (with demos and docs, add 89 MB for tests)

- Estimated build time: 2.3 SBU (with parallelism=4, demos, and docs; add 1.1 SBU for tests)

### Additional Downloads

- Recommended patch: http://www.linuxfromscratch.org/patches/blfs/svn/mesa-18.3.3-add_xdemos-1.patch (installs 2 demo programs for testing Mesa - not needed if you install the mesa-demos package)

### Mesa Dependencies

#### Required

Xorg Libraries, libdrm-2.4.97, and Mako-1.0.7

#### Recommended

libvdpau-1.1.1 (to build VDPAU drivers), LLVM-7.0.1 (required for Gallium3D, r300, and radeonsi drivers and for the llvmpipe software rasterizer. See http://www.mesa3d.org/systems.html for more information), and wayland-protocols-1.17 (required for Plasma-5.15.0, GNOME, and recommended for GTK+-3.24.5)

#### Optional

libgcrypt-1.8.4, Nettle-3.4.1, Python-2.7.15 (not used if Python3 is present), mesa-demos (provides more than 300 extra demos to test Mesa; this includes the same programs added by the patch above), and Bellagio OpenMAX Integration Layer (for mobile platforms)

### Note

The instructions below assume that LLVM with the r600/amdgpu and host backends are installed. You will need to modify the instructions if you choose not to install it. For an explanation of Gallium3D see https://en.wikipedia.org/wiki/Gallium3D.

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/mesa

## Installation of Mesa

If you have downloaded the xdemos patch (needed if testing the Xorg installation per BLFS instructions), apply it by running the following command:

    patch -Np1 -i ../mesa-18.3.3-add_xdemos-1.patch

Now, select the drivers you wish to install. The available drivers are i915, nouveau, r300, r600, radeonsi, freedreno, pl111, svga, swrast, swr, tegra, v3d, vc4, virgl, etnaviv, and imx. If the Gallium drivers are not specified, the default is 'r300,r600,svga,swrast'. Modify the command below for any desired drivers. The listed drivers below will cover most modern video cards. For help in selecting drivers see http://www.mesa3d.org/systems.html.

    GLL_DRV="i915,nouveau,radeonsi,svga,swrast"

Install Mesa by running the following commands:

    ./configure CFLAGS='-O2' CXXFLAGS='-O2' LDFLAGS=-lLLVM \
                --prefix=$XORG_PREFIX              \
                --sysconfdir=/etc                  \
                --enable-osmesa                    \
                --enable-xa                        \
                --enable-glx-tls                   \
                --with-platforms="drm,x11,wayland" \
                --with-gallium-drivers=$GLL_DRV    &&

    unset GLL_DRV &&

    make

If you have applied the xdemos patch, build the demo programs by running the following command:

    make -C xdemos DEMOS_PREFIX=$XORG_PREFIX

To test the results, issue: make -k check.

Now, as the `root` user:

    make install

If you have built the demo programs, install them by running the following command as the `root` user:

    make -C xdemos DEMOS_PREFIX=$XORG_PREFIX install

If desired, install the optional documentation by running the following commands as the `root` user:

    install -v -dm755 /usr/share/doc/mesa-18.3.3 &&
    cp -rfv docs/* /usr/share/doc/mesa-18.3.3

## Command Explanations

`CFLAGS="-O2" CXXFLAGS="-O2"`: By default, Autoconf sets CFLAGS and CXXFLAGS to "-g -O2". That results in binaries and libraries being built with debugging symbols which make them bigger. Override the default flags to omit the -g compiler flag so the final libraries are smaller.

`LDFLAGS=-lLLVM`: This environment variable specifies the LLVM libraries that are not automatically included for some of the package components.

`--enable-osmesa`: This switch enables building the `libOSMesa` library.

`--enable-xa`: This switch enables building the XA X Acceleration API (Required for VMware 3D Driver).

`--enable-gbm`: This switch enables building the Mesa Graphics Buffer Manager library.

`--enable-glx-tls`: This switch enables TLS (Thread Local Storage) support in GLX.

`--with-platforms="..."`: This parameter controls which platforms EGL will be built for. Available platforms are drm, x11 and wayland.

`--with-gallium-drivers="..."`: This parameter controls which Gallium3D drivers should be built.

`--enable-sysfs`: Use this switch to enable simple PCI identification method, required for building DRI on systems without udev.

## Contents

Installed Programs: glxgears and glxinfo
Installed Libraries: libEGL.so, libgbm.so, libglapi.so, libGLESv1_CM.so, libGLESv2.so, libGL.so, libOSMesa.so, libwayland-egl.so (if built with Wayland) libxatracker.so, libXvMCnouveau.so, and libXvMCr600.so
Installed Directories: $XORG_PREFIX/{include/{EGL,GL,GLES,GLES2,GLES3,KHR},lib/{dri,vdpau}} and /usr/share/doc/mesa-18.3.3 (optional)

### Short Descriptions

glxgears | is a GL demo useful for troubleshooting graphics problems.
glxinfo | is a diagnostic program that displays information about the graphics hardware and installed GL libraries.
`libEGL.so` | provides a native platform graphics interface as defined by the EGL-1.4 specification.
`libgbm.so` | is the Mesa Graphics Buffer Manager library.
`libGLESv1_CM.so` | is the Mesa OpenGL ES 1.1 library.
`libGLES2.so` | is the Mesa OpenGL ES 2.0 library.
`libGL.so` | is the main Mesa OpenGL library.
`libOSMesa.so` | is the Mesa Off-screen Rendering library.
`libxatracker.so` | is the Xorg Gallium3D acceleration library.

Last updated on 2019-02-15 15:01:29 -0600

- Prev

  xcb-util-cursor-0.1.3

- Next

  xbitmaps-1.1.2

- Up
- Home