194 sudo apt-get install libopengl-dev
195 apt list |grep -i opengl
196 glxinfo
197 sudo apt install mesa-utils
198 glxinfo
执行cmake过程中出现 Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR OpenGL)
sudo apt install libgl1-mesa-dev
https://www.khronos.org/opengl/wiki/Getting_Started
https://www.khronos.org/opengl/wiki/Platform_specifics:_Windows#Installing_Mesa3D_on_Windows
in qt wiki,MesaLlvmpipe - Qt Wiki
How to build Mesa for software rendering with llvmpipe on Windows with Visual Studio 2017
These are the official instructions for building opengl32sw.dll which is shipped with the binary Qt packages and are also available at http://download.qt.io/development_releases/prebuilt/llvmpipe/windows/
Based on http://qt-project.org/wiki/Cross-compiling-Mesa-for-Windows but without any special requirements for cross-compiling or tools and with some additional patches.
Note that the pre-compiled binaries provided on that wiki page are not able to run many Quick applications due to problems in the LLVM optimization passes. Hence we make our own build. This also gives us the ability to debug and fix/enhance things, if needed.
Prerequisites:
pip install -U setuptools
pip install -U wheel
Note that Bison 2.7 seems to crash. Use 3.0 or the old 2.4.1 instead (available from gnuwin32). The mesa scons script expects winflexbison from here: https://sourceforge.net/projects/winflexbison/ rather then the one from Msys2. You might get Msys2 flavor working by renaming the executables adding win_ at the begging of their names (untested). M4 is available at Msys2 sourceforge repository (Msys2 tools, there is also a Mingw tools section, but we don't need anything from there). Make sure all tools are available in the PATH.
All the steps below assume you are in a Visual Studio command prompt (32 or 64 bit, depending on the target DLL you want, but note that some of the configuration shown below may need adjustments accordingly).
Step 1: Get and build LLVM.
Since Mesa 17.2.2 LLVM 5.0 is supported.
wget http://llvm.org/releases/5.0.0/llvm-5.0.0.src.tar.xz
May need 7zip or a win32 build of xz-utils to decompress it: http://tukaani.org/xz/
Configure it:
cmake -G "Visual Studio 14 Win64" -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_CRT_DEBUG=MTd -DCMAKE_INSTALL_PREFIX=c:/work/mesa/llvm/bin .
This means the static libraries and other tools will be installed to c:\work\mesa\llvm\bin Leave out Win64 from the generator name when making 32-bit builds and having the x86 developer command prompt open.
Build it:
msbuild /p:Configuration=Release INSTALL.vcxproj
Step 2: Get and build Mesa 17.2.2 (or newer)
wget ftp://ftp.freedesktop.org/pub/mesa/mesa-17.2.2.tar.xz
Build it:
set LLVM=c:/work/mesa/llvm/bin scons build=release platform=windows machine=x86_64 libgl-gdi
Change to build=debug to get a debug build, but note that both LLVM and Mesa must be built in the same configuration. Change to machine=x86 to generate 32-bit builds.
The result is an opengl32.dll in build\windows-x86[_64][-debug]\gallium\targets\libgl-gdi. This provides a WGL and desktop OpenGL 3.0 implementation and is a drop-in replacement for the system's own opengl32.dll. There are two ways to use it: Copy it to a Qt executable's directory (since that is searched first when looking for DLLs) and launch the app. - OR - The modern way: ship it as opengl32sw.dll and set QT_OPENGL=software (or setAttribute(AA_UseSoftwareOpenGL in main()) to force it (this needs a -opengl dynamic build of Qt of course).
Identification:
17.1.x and older
GL_VENDOR: VMware, Inc. GL_RENDERER: Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits) GL_VERSION: 3.0 Mesa 11.2.2
17.2.x and newer
GL_VENDOR: VMware, Inc. GL_RENDERER: llvmpipe (LLVM 5.0, 256 bits) GL_VERSION: 3.0 Mesa 17.2.2
Additional notes: