# OSMesa linking problems compiling ParaView on openSUSE Leap 15.1

**URL:** https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124
**Category:** ParaView Support
**Tags:** opengl, vtk
**Created:** [April 20, 2020, 2:26pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124 "2020-04-20T14:26:11Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![gskillas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/dfb087/32.png) [@gskillas](https://discourse.paraview.org/u/gskillas)
#### Post date: [April 20, 2020, 2:26pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/1 "2020-04-20T14:26:11Z")

</div>

Hello together,

I am trying to compile ParaView 5.8.0 on OpenSUSE Leap 15.1.  
The last ParaView version compiled was 5.6.0 and it compiled ok.  
with 5.8.0 I am getting the following errors, while linking:

> Scanning dependencies of target ChartsCore  
> [79%] Linking CXX executable …/…/…/bin/vtkProbeOpenGLVersion-pv5.8  
> [79%] Building CXX object VTK/Interaction/Widgets/CMakeFiles/InteractionWidgets.dir/vtkPointPlacer.cxx.o  
> [79%] Building CXX object VTK/Charts/Core/CMakeFiles/ChartsCore.dir/vtkAxis.cxx.o  
> /usr/lib64/gcc/x86\_64-suse-linux/7/…/…/…/…/x86\_64-suse-linux/bin/ld: …/…/…/lib64/libvtkRenderingOpenGL2-pv5.8.so.5.8: undefined reference to `OSMesaDestroyContext' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../../lib64/libvtkRenderingOpenGL2-pv5.8.so.5.8: undefined reference to `OSMesaMakeCurrent’  
> /usr/lib64/gcc/x86\_64-suse-linux/7/…/…/…/…/x86\_64-suse-linux/bin/ld: …/…/…/lib64/libvtkRenderingOpenGL2-pv5.8.so.5.8: undefined reference to `OSMesaGetCurrentContext' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../../lib64/libvtkRenderingOpenGL2-pv5.8.so.5.8: undefined reference to `OSMesaCreateContext’  
> /usr/lib64/gcc/x86\_64-suse-linux/7/…/…/…/…/x86\_64-suse-linux/bin/ld: …/…/…/lib64/libvtkRenderingOpenGL2-pv5.8.so.5.8: undefined reference to `OSMesaGetProcAddress’  
> collect2: error: ld returned 1 exit status  
> make[2]: \*\*\* [VTK/Rendering/OpenGL2/CMakeFiles/vtkProbeOpenGLVersion.dir/build.make:112: bin/vtkProbeOpenGLVersion-pv5.8] Error 1  
> make[1]: \*\*\* [CMakeFiles/Makefile2:12375: VTK/Rendering/OpenGL2/CMakeFiles/vtkProbeOpenGLVersion.dir/all] Error 2  
> make[1]: \*\*\* Waiting for unfinished jobs…

The OSMesa library is installed:

```
> zypper se libOSMesa
Loading repository data...
Reading installed packages...

S | Name | Summary | Type   
---+-----------------------+--------------------------------------------------------------+--------
i+ | libOSMesa-devel | Development files for the Mesa Offscreen Rendering extension | package
   | libOSMesa-devel-32bit | Development files for the Mesa Offscreen Rendering extension | package
i+ | libOSMesa8 | Mesa Off-screen rendering extension | package
i+ | libOSMesa8-32bit | Mesa Off-screen rendering extension | package

```

I have not found anything about such an error online or on this forum. I am at a loss what the reason for the error, how should I proceed?

Take care,

George

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [April 20, 2020, 3:40pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/2 "2020-04-20T15:40:28Z")

</div>

Note that OSMesa and X support are mutually exclusive. The old build system probably just silently disabled one of them. rc3 will have a condition letting you know that you’ve requested an impossible configuration.

Basically, if you want OSMesa support, X support has to be disabled.

---

<div class="post-metadata">

### Author: ![gskillas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/dfb087/32.png) [@gskillas](https://discourse.paraview.org/u/gskillas)
#### Post date: [April 20, 2020, 3:56pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/3 "2020-04-20T15:56:05Z")

</div>

Dear Ben

how do I do that? I am setting

```
VTK_OPENGL_HAS_OSMESA=ON 
OSMESA_INCLUDE_DIR=/usr/include/GL
OSMESA_LIBRARY=/usr/lib64/libOSMesa.so

```

in the CMAKE configuration and the files referenced are there:

```
> dir /usr/lib64/libOSMesa.so*
lrwxrwxrwx 1 root root 18 Jan 16 10:09 /usr/lib64/libOSMesa.so -> libOSMesa.so.8.0.0
lrwxrwxrwx 1 root root 18 Jan 16 10:09 /usr/lib64/libOSMesa.so.8 -> libOSMesa.so.8.0.0
-rwxr-xr-x 1 root root 4864008 Jan 16 10:09 /usr/lib64/libOSMesa.so.8.0.0
> dir /usr/include/GL
total 3012
-rw-r--r-- 1 root root 10411 Oct 17 2014 freeglut_ext.h
-rw-r--r-- 1 root root 681 Oct 21 2003 freeglut.h
-rw-r--r-- 1 root root 27097 Oct 17 2014 freeglut_std.h
-rw-r--r-- 1 root root 410096 Jan 16 10:09 glcorearb.h
-rw-r--r-- 1 root root 1186601 Dec 17 2018 glew.h
-rw-r--r-- 1 root root 832367 Jan 16 10:09 glext.h
-rw-r--r-- 1 root root 80631 Jan 16 10:09 gl.h
-rw-r--r-- 1 root root 158833 Jan 16 10:09 gl_mangle.h
-rw-r--r-- 1 root root 17255 Dec 17 2018 glu.h
-rw-r--r-- 1 root root 3315 Dec 17 2018 glu_mangle.h
-rw-r--r-- 1 root root 639 Oct 21 2003 glut.h
-rw-r--r-- 1 root root 73435 Dec 17 2018 glxew.h
-rw-r--r-- 1 root root 48082 Jan 16 10:09 glxext.h
-rw-r--r-- 1 root root 14642 Jan 16 10:09 glx.h
-rw-r--r-- 1 root root 4706 Jun 7 2018 glxint.h
-rw-r--r-- 1 root root 3471 Jan 16 10:09 glx_mangle.h
-rw-r--r-- 1 root root 2086 Jun 7 2018 glxmd.h
-rw-r--r-- 1 root root 80979 Jun 7 2018 glxproto.h
-rw-r--r-- 1 root root 11436 Jun 7 2018 glxtokens.h
drwxr-xr-x 2 root root 4096 Jan 25 08:50 internal
-rw-r--r-- 1 root root 10360 Jan 16 10:09 osmesa.h
-rw-r--r-- 1 root root 63314 Dec 17 2018 wglew.h

```

Best regards,

George

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [April 20, 2020, 3:59pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/4 "2020-04-20T15:59:01Z")

</div>

`VTK_USE_X` is `ON` by default on Linux, so you’ll need to disable it explicitly.

---

<div class="post-metadata">

### Author: ![gskillas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/dfb087/32.png) [@gskillas](https://discourse.paraview.org/u/gskillas)
#### Post date: [April 20, 2020, 7:03pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/5 "2020-04-20T19:03:07Z")

</div>

Dear Ben,

that did the trick. It compiled without a glitch.

Take care,

George

---

<div class="post-metadata">

### Author: ![cbutcher](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cbutcher/32/2013_2.png) [@cbutcher](https://discourse.paraview.org/u/cbutcher)
#### Post date: [July 14, 2020, 5:08pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/6 "2020-07-14T17:08:06Z")

</div>

Dear Ben,

I had the same issue today (or at least, a very similar looking one).

I’m hopeful that my current compilation (with -DVTK\_USE\_X=OFF) will complete, but I was seemingly mislead by documentation here: [https://kitware.github.io/paraview-docs/v5.8.0/cxx/Offscreen.html](https://kitware.github.io/paraview-docs/v5.8.0/cxx/Offscreen.html)

That page explicitly claims that it’s now possible to use X and OSMESA flags at the same time in the build - do you know if this is a) just not true, b) I’ve misunderstood the entire thing, or c) true only for some versions more recent than 5.8.0 (i.e. dev)? (Perhaps I should include the implicit d) Some other option I can’t think of…)

If I want both, is there a recommended way to do this? (i.e. via two separate compilations, what are the best collection of flags relevant to either case to provide an X tunnelling compatible setup and a headless server that I connect to via a desktop client?)

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 14, 2020, 10:58pm UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/7 "2020-07-14T22:58:35Z")

</div>

> [@cbutcher](#):
>
> That page explicitly claims that it’s now possible to use X and OSMESA flags at the same time in the build

That is indeed correct. However, not the following mentioned on the page you linked:

_If VTK\_OPENGL\_HAS\_OSMESA is ON, and VTK\_USE\_X is ON, then all the OpenGL  
and OSMesa variables should point to the Mesa libraries._

This, AFAIK, is not possible using standard platform provided OSMesa since the that package typically does not provide GLX. If you custom build mesa with OSMesa and GLX support, then it should work.

---

<div class="post-metadata">

### Author: ![cbutcher](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cbutcher/32/2013_2.png) [@cbutcher](https://discourse.paraview.org/u/cbutcher)
#### Post date: [July 15, 2020, 2:59am UTC](https://discourse.paraview.org/t/osmesa-linking-problems-compiling-paraview-on-opensuse-leap-15-1/4124/8 "2020-07-15T02:59:34Z")

</div>

Dear Utkarsh,

Thank you for the clarification.  
I’m going to open a new question because I think I’m moving away from the original topic here - it seems likely my problem may be related to the GLX support you mention (although I’m using a custom built installation of Mesa v20.1.3, and I thought GLX support).
