# 9.0.0.rc1 ContextOpenGL2 not built

**URL:** https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933
**Category:** Support
**Created:** [April 1, 2020, 9:09am UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933 "2020-04-01T09:09:23Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Yue\_JIN](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yue_jin/32/1228_2.png) [@Yue\_JIN](https://discourse.vtk.org/u/Yue_JIN)
#### Post date: [April 1, 2020, 9:09am UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/1 "2020-04-01T09:09:23Z")

</div>

I’ve built 9.0rc1 and use 9.0rc1 to reconfigure my project. But it exists an error: “Could not find the VTK package with the following required components: RenderingContextOpenGL2.” I find that there is no cmake files in ContextOpenGL2 folder

---

<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 1, 2020, 12:15pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/2 "2020-04-01T12:15:55Z")

</div>

What tarball did you download? I’m seeing it in the download [here](https://vtk.org/download/). I have an MD5 of `2d872d47e671dec466b5482f7b34e4c6`.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [April 1, 2020, 9:10pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/3 "2020-04-01T21:10:47Z")

</div>

I ran into a similar issue and had to explicitly add `-DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES` to my CMake line (see post here: [https://discourse.vtk.org/t/two-questions-about-new-module-system](https://discourse.vtk.org/t/two-questions-about-new-module-system)).

This was unlike with VTK 8.x (which used the old module system), where the `RenderingContextOpenGL2` module was brought in transitively through some dependency.

---

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 13, 2020, 2:16pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/4 "2020-07-13T14:16:22Z")

</div>

Hi Elvis, I am new to VTK - please could you help - where exactly do you add this line in the CMake file? I am currently just trying to run the Glyph3DImage example, but when I run CMake I get this error: “Skipping Glyph3DImage: Could not find the VTK package with the following required components: RenderingContextOpenGL2.” The CMake file currently looks like this:

```
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)

project(Glyph3DImage)

find_package(VTK COMPONENTS 
  vtkCommonColor
  vtkCommonCore
  vtkCommonDataModel
  vtkFiltersSources
  vtkIOImage
  vtkInteractionStyle
  vtkRenderingContextOpenGL2
  vtkRenderingCore
  vtkRenderingFreeType
  vtkRenderingGL2PSOpenGL2
  vtkRenderingOpenGL2 QUIET) 
if (NOT VTK_FOUND)
  message("Skipping Glyph3DImage: ${VTK_NOT_FOUND_MESSAGE}")
  return ()
endif()
message (STATUS "VTK_VERSION: ${VTK_VERSION}")
if (VTK_VERSION VERSION_LESS "8.90.0")
  # old system
  include(${VTK_USE_FILE})
  add_executable(Glyph3DImage MACOSX_BUNDLE Glyph3DImage.cxx )
  target_link_libraries(Glyph3DImage PRIVATE ${VTK_LIBRARIES})
else ()
  # include all components
  add_executable(Glyph3DImage MACOSX_BUNDLE Glyph3DImage.cxx )
  target_link_libraries(Glyph3DImage PRIVATE ${VTK_LIBRARIES})
  # vtk_module_autoinit is needed
  vtk_module_autoinit(
    TARGETS Glyph3DImage
    MODULES ${VTK_LIBRARIES}
    )
endif () 

```

Many thanks

---

<div class="post-metadata">

### Author: ![Yue\_JIN](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yue_jin/32/1228_2.png) [@Yue\_JIN](https://discourse.vtk.org/u/Yue_JIN)
#### Post date: [July 16, 2020, 6:27am UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/5 "2020-07-16T06:27:29Z")

</div>

Hi Jennifer, which version do you use? I haven’t tried the latest release. It’s strange if the latest vtk still has this bug. You can add an entry “VTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2” in CMake-Gui when you configure your VTK (not your example). After rebuilding VTK, your example may works.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/3/357622521284971d99e3389d88b92e9ad108cf4f.png)

---

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 16, 2020, 3:12pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/6 "2020-07-16T15:12:22Z")

</div>

Hi Yue Jin, Thank you so much for replying. I have re-built and installed VTK again but unfortunately no joy! I used “Add Entry”. I used type “STRING” - is this correct? VTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2 appears as it should in CMake:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/9/9ee03456e60582e6179a1baa4f98c6535dbff4bd.png)  
Maybe I need to download a later development version of VTK - the one I have installed is the release on the Kitware webpage but maybe signing up to the GitHub would be the way to go?

---

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 16, 2020, 9:30pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/7 "2020-07-16T21:30:45Z")

</div>

Hi Yue Jin, I have now installed the latest version downloaded from GitLab, and the issue is the same…

---

<div class="post-metadata">

### Author: ![Yue\_JIN](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yue_jin/32/1228_2.png) [@Yue\_JIN](https://discourse.vtk.org/u/Yue_JIN)
#### Post date: [July 17, 2020, 3:19am UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/8 "2020-07-17T03:19:26Z")

</div>

Try to assign “Yes” instead of DEFAULT to this entry

---

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 17, 2020, 3:31pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/9 "2020-07-17T15:31:59Z")

</div>

> [@Yue\_JIN](#):
>
> VTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2

Hi You Jin, Thank you so much. Yes, I finally got VTK to compile and install with this option (after I added the entry and configured the value reverted to DEFAULT, and I had to edit and configure again). Unfortunately, this newly compiled VTK now won’t actually display the render window when I run the examples (I had previously comiled and run “Sphere” and the render windo appeared with a sphere in it. Now, it seems to run (no errors), but nothing happens. I think this may be something to do with OpenGL. Have you any ideas? Did this happen when you made the edit? Maybe this should be a different thread?

---

<div class="post-metadata">

### Author: ![SArbabi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@SArbabi](https://discourse.vtk.org/u/SArbabi)
#### Post date: [November 18, 2020, 3:46pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/10 "2020-11-18T15:46:27Z")

</div>

> [@estan](#):
>
> -DVTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2=YES

when I use this flag in cmake, I get this warning:  
CMake Warning:  
Manually-specified variables were not used by the project:

```
VTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2

```

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [November 18, 2020, 6:14pm UTC](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/11 "2020-11-18T18:14:56Z")

</div>

Hm okay. I just tested with

```auto
curl -LO https://www.vtk.org/files/release/9.0/VTK-9.0.1.tar.gz
tar xf VTK-9.0.1.tar.gz
cd VTK-9.0.1/
mkdir build
cd build
cmake -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES ..

```

and I’m not getting that warning here. Full transcript here: [transcript.txt](https://discourse.vtk.org/uploads/short-url/7syuxChBKqrsfYMwACk7RXpWS7l.txt) (30.0 KB)

Maybe it has something to with what groups/modules get enabled by default on your system. Would help to see the output from the CMake run.
