KitwareMedical / VTKPythonPackage

A setup script to generate VTK Python Wheels
https://vtkpythonpackage.readthedocs.io
BSD 3-Clause "New" or "Revised" License
34 stars 15 forks source link

Cannot build wheel with EGL support #41

Closed DavidGillsjo closed 4 years ago

DavidGillsjo commented 4 years ago

Hi,

I want to use mayavi for EGL offscreen rendering and therefore need to build a VTK python wheel with EGL support.

I execute the build with

VTK_CMAKE_ARGS="-DVTK_OPENGL_HAS_EGL:BOOL=ON -DVTK_USE_X:BOOL=OFF" python3 setup.py bdist_wheel

and get the error:

CMake Error at CMake/vtkModuleTop.cmake:376 (add_library):
  Target "vtkOpenGL" links to target "EGL::EGL" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:510 (include)

I've tried to change VTK version to 8.2.0 by editing vtkVersion.py and CMakeLists.txt and manage to successfully build the wheel. But after the package installation with pip I can only import vtk, no modules. For instance, vtk.vtkVersion is not found.

I'm building in a ubuntu 18.04 docker environment. Any pointers are appreciated, I'm out of my depth on this :smile:

DavidGillsjo commented 4 years ago

I solved it by the following steps:

  1. Use version 8.2.0
  2. Install the python lib make install
  3. Run custom setup.py to make it appear as a python package.

If anyone is curious my docker file is here.