Bug#959387: [Re] paraview-dev: missing cmake vtk modules in the dev package, cannot use

Jakob Meng JakobMeng at web.de
Thu Aug 6 11:17:35 BST 2020


Hello,
paraview-dev from Debian Testing/Sid is broken. I tried to fix it, but
new bugs were popping up as soon as i fixed one. Here are my findings.

First, the VCS repository [1][2] is not up to date, it's missing
commits: Salsa has 5.7.0-2 [1], but Debian Sid has 5.7.0-4 [3]. I worked
on the newer version from Sid. I applied all patches from merge request
#1 [4] on top of ParaView 5.7.0-4 to fix bug #959387 [5].

One set of bugs is caused by debian/rules, because it alters the
filesystem after it has build ParaView. For example, it moves files from
/usr/lib/x86_64-linux-gnu/python3* to /usr/lib/python3* [6], renames
e.g. /usr/bin/pvbatch3.8 to /usr/bin/pvbatch and then dh_python3 renames
libraries e.g. from vtkClientServerPython.so to
vtkClientServerPython.cpython-38-x86_64-linux-gnu.so. Hence ParaView's
exported CMake files [7] cannot find those files at the original
locations. When you try to import ParaView into your own code using
CMake (and its find_package command), then CMake fails due to missing
files. For some ideas how to fix those bugs, please see file
debian.patch [8].

ParaView's CMake flag VTK_PYTHON_OPTIONAL_LINK must be OFF to fix vtk
issue #17692 [9].

Another problem is, that FFMPEG_VERSION in libavutil/ffversion.h [10]
from Debian package libavutil-dev [11] is "4.3-3+b2". ParaView picks up
this version in VTK/CMake/FindFFMPEG.cmake [12] during build, stores it
in CMake variable FFMPEG_VERSION and then exports it to file
VTK-vtk-module-find-packages.cmake [13]. The latter then contains
"find_package(FFMPEG 4.3-3+b2 ...", which breaks CMake's find_package
[14], because find_package's version format is
major[.minor[.patch[.tweak]]], but no plus or minus. So once again, when
you try to "find_package(ParaView...)" in your own CMakeLists.txt, then
CMake fails again. One workaround is to remove the additional version
postfix from the FFMPEG_VERSION CMake variable, please see file
vtk-cmake-findffmpeg-cmake.patch [15].

By the way, in ParaView's sources [1], there is a subdirectory "VTK"
which is a copy of the upstream vtk.git [16]. (This "VTK" folder is
actually a git submodule in the upstream repo [17]). The vtk code is
already packaged in Debian [18][19] and has a lot of patches [20], but
the VTK subdirectory in ParaView lacks most of these patches. Perhaps it
may be beneficial to either copy those patches [20] or copy the whole
already-patched vtk source tree from [19] to ParaView's VTK subdirectory.

Another quirk of Debian's ParaView package, that got me thinking, is
mpi4py. ParaView builds and links against its own variant of mpi4py, but
the resulting files are not integrated into the debian package. At
runtime the system provided mpi4py libraries are used. One has to be
very careful with keeping both versions, the
ParaView-build-in-but-not-installed and the system-provided mpi4py
libraries, in sync to prevent probably-hard-to-detect bugs.
Unfortunately i could not figure out yet how to force ParaView to use
mpi4py that is provided by the system.

After all patches [8][15] have been applied, my little toy project [21]
successfully compiles and links against ParaView. I never expected that
creating debian packages for ParaView is that hard! Hopefully, someday
someone with more debian skills fixes the "dh_python3 --no-ext-rename"
hack in debian/rules and uploads a fixed debian package. Thank you and
keep up the great work :-)

Regards
Jakob

[1] https://salsa.debian.org/science-team/paraview
[2] https://tracker.debian.org/pkg/paraview
[3] https://packages.debian.org/sid/paraview
[4] https://salsa.debian.org/science-team/paraview/-/merge_requests/1
[5] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959387
[6] mv debian/tmp/usr/lib/*/python3* debian/tmp/usr/lib/
[7]
/usr/lib/x86_64-linux-gnu/cmake/paraview-5.7/ParaViewPython-targets-release.cmake
[8] debian.patch [attached to this mail]
[9] https://gitlab.kitware.com/vtk/vtk/-/issues/17692
[10] /usr/include/x86_64-linux-gnu/libavutil/ffversion.h
[11] https://packages.debian.org/buster/libavutil-dev
[12]
https://salsa.debian.org/science-team/paraview/-/blob/4c909f1888037e64a655f630910c9f90a5ae3bda/VTK/CMake/FindFFMPEG.cmake#L152
[13]
/usr/lib/x86_64-linux-gnu/cmake/paraview-5.7/vtk/VTK-vtk-module-find-packages.cmake
[14] https://cmake.org/cmake/help/latest/command/find_package.html
[15] vtk-cmake-findffmpeg-cmake.patch [attached to this mail]
[16] https://gitlab.kitware.com/vtk/vtk.git
[17] https://github.com/Kitware/ParaView
[18] https://salsa.debian.org/science-team/vtk7
[19] https://tracker.debian.org/pkg/vtk7
[20] https://salsa.debian.org/science-team/vtk7/-/tree/master/debian/patches
[21] paraview-example.zip [attached to this mail]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: debian.patch
Type: text/x-patch
Size: 2205 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20200806/fc3ec882/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: paraview-example.zip
Type: application/zip
Size: 942 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20200806/fc3ec882/attachment-0001.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtk-cmake-findffmpeg-cmake.patch
Type: text/x-patch
Size: 532 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20200806/fc3ec882/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20200806/fc3ec882/attachment-0001.sig>


More information about the debian-science-maintainers mailing list