# How does one specify Mesa's GL should be used when compiling VTK (9.0.0.rc2)

**URL:** https://discourse.vtk.org/t/how-does-one-specify-mesas-gl-should-be-used-when-compiling-vtk-9-0-0-rc2/3114
**Category:** Support
**Created:** [April 20, 2020, 9:17pm UTC](https://discourse.vtk.org/t/how-does-one-specify-mesas-gl-should-be-used-when-compiling-vtk-9-0-0-rc2/3114 "2020-04-20T21:17:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![biagas](https://discourse.vtk.org/user_avatar/discourse.vtk.org/biagas/32/7380_2.png) [@biagas](https://discourse.vtk.org/u/biagas)
#### Post date: [April 20, 2020, 9:17pm UTC](https://discourse.vtk.org/t/how-does-one-specify-mesas-gl-should-be-used-when-compiling-vtk-9-0-0-rc2/3114/1 "2020-04-20T21:17:26Z")

</div>

I am on a linux system whose system GL version is insufficient for VTK.  
I have compiled Mesa-17.2.8 (with LLVM 5.0.0)

I have tried adding to the cmake command when building VTK:  
-DOPENGL\_INCLUDE\_DIR=/path/to/mesa/include  
-DOPEN\_gl\_LIBRARY=/path/to/mesa/lib/libGL.so

This is how I compiled VTK-8 in the past for this system (for on screen rendering).

I see this during cmake’s configure:

- Found OpenGL: /usr/lib64/libOpenGL.so found components: OpenGL GLX  
so it appears that Mesa GL won’t be used.

How can I compile VTK-9 with Mesa as GL for onscreen rendering?

I am using CMake 3.12.4.

---

<div class="post-metadata">

### Author: ![biagas](https://discourse.vtk.org/user_avatar/discourse.vtk.org/biagas/32/7380_2.png) [@biagas](https://discourse.vtk.org/u/biagas)
#### Post date: [April 20, 2020, 10:40pm UTC](https://discourse.vtk.org/t/how-does-one-specify-mesas-gl-should-be-used-when-compiling-vtk-9-0-0-rc2/3114/2 "2020-04-20T22:40:08Z")

</div>

I may have figured it out:  
Also use  
-DOPENGL\_opengl\_LIBRARY=  
and change  
-DOPENGL\_gl\_LIBRARY to also list the path to libLLVM.so

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 21, 2020, 1:22pm UTC](https://discourse.vtk.org/t/how-does-one-specify-mesas-gl-should-be-used-when-compiling-vtk-9-0-0-rc2/3114/3 "2020-04-21T13:22:35Z")

</div>

The component names in `FindOpenGL` don’t reflect the implementation used, so using Mesa won’t really mention that at all. On our Mesa tester, `OPENGL_opengl_LIBRARY` is also set to the same as `OPENGL_gl_LIBRARY`, but that may be vestigal and probably should be empty as you have seen.
