gerddie / ginkgocadx

Advanced DICOM viewer
131 stars 38 forks source link

Ginkgo CADx doesn't support VTK versions ≥ 7.0.0 #21

Closed pmattern closed 7 years ago

pmattern commented 8 years ago

Ginkgo CADx doesn't seem to support VTK versions ≥ 7.0.0 right now.

At least one problem is a change regarding the header files. E. g. after tweaking FIND_PACKAGE(VTK 6.2.0 REQUIRED) in ./CMakelists.txt to accept version 7.0.0 running cmake completes successfully but make fails with

[...]
[  4%] Building CXX object cadxcore/CMakeFiles/CADxCore.dir/api/iannotator.cpp.o
In file included from /usr/local/peter/Tests/GinkgoCADx/Projekt/ginkgocadx/cadxcore/api/westilo.h:23:0,
from /usr/local/peter/Tests/GinkgoCADx/Projekt/ginkgocadx/cadxcore/api/iannotator.cpp:22:
/usr/local/peter/Tests/GinkgoCADx/Projekt/ginkgocadx/cadxcore/widgets/openglhelper.h:26:19: fatal error: vtkgl.h: No such file or directory
#include <vtkgl.h>
                  ^
compilation terminated.
cadxcore/CMakeFiles/CADxCore.dir/build.make:518: recipe for target 'cadxcore/CMakeFiles/CADxCore.dir/api/iannotator.cpp.o' failed
make[2]: *** [cadxcore/CMakeFiles/CADxCore.dir/api/iannotator.cpp.o] Error 1
CMakeFiles/Makefile2:118: recipe for target 'cadxcore/CMakeFiles/CADxCore.dir/all' failed
make[1]: *** [cadxcore/CMakeFiles/CADxCore.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

And indeed vtkgl.h is no longer available as of 7.0.0. Same findings compiling a8819b7 against VTK Kitware/VTK@a74fc9e or 7.0.0 on Arch Linux.

On the one hand I think it would be good if Ginkgo CADx supported VTK ≥ 7 simply because it's the latest stable release. On the other hand supporting those versions would be helpful as compiling VTK 6.x gets more and more difficult on Linux distributions using recent software. E. g. support of GCC 6 was introduced after release 7.0.0 only.

gerddie commented 8 years ago

Currently, VTK 7 is not yet packaged for Debian, so I'll put this on hold - unless someone comes up with a patch that also honours compilation against VTK-6. The latter is also needed because I use travis-ci for continuous integration, and there vtk-7 is also not yet available.

At least on Debian VTK 6.3 has a patch to compile with gcc-6 - and it is trivial and could be picked up by other distros.

paulfertser commented 7 years ago

In fact, I managed to build and run it with VTK-7.1.0 on Gentoo. CMake test needed amendment, but other than that, everything worked fine. The trick was to add -DVTK_RENDERING_BACKEND=OpenGL to VTK configuration because it switched to using OpenGL2 by default.

gerddie commented 7 years ago

That sounds great, could you post the details of the changes you made to the cmake test, or, even better, create a pull request?

many thanks, Gert

pmattern commented 7 years ago

VTK upstream is more and more geared towards OpenGL 2, so disabling this version just to build Ginkgo CADx can be considered a rather dirty hack at best. Also, don't expect downstream to provide restricted VTK versions like that, e. g. header vtkgl.h is no longer provided by 7.x in Fedora either. (And of course building recent Ginkgo CADx against proper VTK 7 still fails due to lack of this very header, as simply tweaking CMakeLists.txt to accept VTK 7 had already been a prerequisite of the findings of the initial comment.)

All in all this issue cannot be considered as fixed in any way.

gerddie commented 7 years ago

Funny. I actually assumed OpenGL2 was the old interface (OpenGL 2 is very old after all). Well, I've opened #34 to track the problem. Pull requests are very welcome :)