From 1121163756d889c8253151bc6052607955a4f1c2 Mon Sep 17 00:00:00 2001 From: Charles PIGNEROL <> Date: Tue, 18 Nov 2025 13:38:32 +0100 Subject: [PATCH 1/2] VTK 7 (vtk-mesh) and VTK 9 compatibility. The goal is to be able to compile Magix3D in VTK 9 and offer a simple alternative to the current VTK 7 solution. Note that VTK 9 has the drawback of using OpenGL > 3.2.0 and therefore cannot take advantage of GLX (or Vulcan) SSH tunneling. --- meshing/packages/magix3d/package.py | 14 +++++++------- meshing/packages/qqualif/package.py | 17 ++++++++++++----- meshing/packages/qtvtk/package.py | 9 +++++---- meshing/packages/vtkcontrib/package.py | 8 +++----- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/meshing/packages/magix3d/package.py b/meshing/packages/magix3d/package.py index e378e79..9cee909 100644 --- a/meshing/packages/magix3d/package.py +++ b/meshing/packages/magix3d/package.py @@ -36,14 +36,14 @@ class Magix3d(CMakePackage): version('2.2.6', sha256='9d39dd74a1b9360a5ca2790f2d9e8b17429f82833df2d633b57c866383873d05') version('2.2.5') - depends_on('guitoolkitsvariables', type=('build')) - depends_on('tkutil') - depends_on('vtkcontrib@4: +shared', type=('build', 'link')) - depends_on('preferences@5: +shared', type=('build', 'link')) - depends_on('pythonutil@5: +shared', type=('build', 'link')) + depends_on('guitoolkitsvariables@1.6.0:', type=('build')) + depends_on('tkutil@6:') + depends_on('vtkcontrib@5: +shared', type=('build', 'link')) + depends_on('preferences@6: +shared', type=('build', 'link')) + depends_on('pythonutil@6: +shared', type=('build', 'link')) depends_on('qqualif+gmds', type=('build', 'link')) - depends_on('qtpython@4: +shared', type=('build', 'link')) - depends_on('qtvtk@7: +shared', type=('build', 'link')) + depends_on('qtpython@6: +shared', type=('build', 'link')) + depends_on('qtvtk@8: +shared', type=('build', 'link')) depends_on('cgns', type=('build', 'link')) depends_on('gmds+lima+cgns', type=('build', 'link')) depends_on('gts', type=('build', 'link')) diff --git a/meshing/packages/qqualif/package.py b/meshing/packages/qqualif/package.py index 74ccedd..13feb61 100644 --- a/meshing/packages/qqualif/package.py +++ b/meshing/packages/qqualif/package.py @@ -19,13 +19,14 @@ class Qqualif(CMakePackage): depends_on('guitoolkitsvariables', type=('build')) depends_on('qwtcharts@4: ~shared', type=('build', 'link'), when='~shared') depends_on('qwtcharts@4: +shared', type=('build', 'link'), when='+shared') - depends_on('vtkcontrib@4: ~shared', type=('build', 'link'), when='~shared+vtk') - depends_on('vtkcontrib@4: +shared', type=('build', 'link'), when='+shared+vtk') +# depends_on('vtkcontrib@4: ~shared', type=('build', 'link'), when='~shared+vtk') +# depends_on('vtkcontrib@4: +shared', type=('build', 'link'), when='+shared+vtk') depends_on('qualif@2: ~shared', type=('build', 'link'), when='~shared') depends_on('qualif@2: +shared', type=('build', 'link'), when='+shared') depends_on('gmds', type=('build', 'link'), when='+gmds') depends_on('lima', type=('build', 'link'), when='+lima') - depends_on('vtk-maillage', type=('build', 'link'), when='+vtk') + depends_on('vtk-maillage', type=('build', 'link'), when='+vtk7') + depends_on('vtk', type=('build', 'link'), when='+vtk9') # necessary because it is probably missing in the lima cmake files # depends_on('machine-types', type=('build', 'link'), when='+lima') @@ -36,7 +37,12 @@ class Qqualif(CMakePackage): variant('shared', default=True, description='Creation de bibliotheques dynamiques') variant('lima', default=True, description='Utilisation de la structure de maillages Lima') variant('gmds', default=True, description='Utilisation de la structure de maillages GMDS') - variant('vtk', default=True, description='Utilisation de la structure de maillages VTK') +# The difficulty with QQualif is that we do or do not want VTK, and that, for VtkContrib and +# QtVtk, we can use vtk-maillage or vtk 9. +# The use here of the 2 variants vtk7 and vtk9 allows us to cover these 3 cases. + variant('vtk7', default=True, description='Utilisation de la structure de maillages vtkUnstructuredGrid de VTK 7') + variant('vtk9', default=False, description='Utilisation de la structure de maillages vtkUnstructuredGrid de VTK 9') + conflicts('+vtk7', when='+vtk9') version('4.6.0', sha256='78fbbbd4919b5b6a96ee684e66baafa074c2a36328829ac120625e1a6540da14') version('4.5.0', sha256='ae16c1e0c44a5ad3843e9bc7e6beca3d800ce0c887faf646e06b8f0dfb40363e') @@ -65,6 +71,7 @@ def cmake_args(self): args.append(self.define_from_variant('BUILD_SHARED_LIBS', 'shared')) args.append(self.define_from_variant('BUILD_GQLima', 'lima')) args.append(self.define_from_variant('BUILD_GQGMDS', 'gmds')) - args.append(self.define_from_variant('BUILD_GQVtk', 'vtk')) + if self.spec.satisfies('+vtk7') or self.spec.satisfies('+vtk9'): + args.append('-DBUILD_GQVtk:BOOL=ON') return args diff --git a/meshing/packages/qtvtk/package.py b/meshing/packages/qtvtk/package.py index fe6d057..c948ae3 100644 --- a/meshing/packages/qtvtk/package.py +++ b/meshing/packages/qtvtk/package.py @@ -19,14 +19,15 @@ class Qtvtk(CMakePackage): depends_on('guitoolkitsvariables', type=('build')) depends_on('qtutil@5: +shared', type=('build', 'link'), when='+shared') depends_on('qtutil@5: ~shared', type=('build', 'link'), when='~shared') - depends_on('vtkcontrib@4: +shared', type=('build', 'link'), when='+shared') - depends_on('vtkcontrib@4: ~shared', type=('build', 'link'), when='~shared') + depends_on('vtkcontrib@5: +shared', type=('build', 'link'), when='+shared') + depends_on('vtkcontrib@5: ~shared', type=('build', 'link'), when='~shared') depends_on('preferences', type=('build', 'link')) depends_on('qt') - depends_on('vtk-maillage +qt', type=('build', 'link')) + depends_on('vtk-maillage +qt', type=('build', 'link'), when='^vtkcontrib+vtk7') + depends_on('vtk +qt', type=('build', 'link'), when='^vtkcontrib~vtk7') variant('shared', default=True, description='Creation de bibliotheques dynamiques (defaut:shared, annuler le defaut par ~shared)') - + version('8.8.4', sha256='436fc9ea484f308e529f8ba7c60e963c48e315dc6d22fabf6bccb34ea13d4568') version('8.8.3', sha256='c1408a43b7d2832de99d2e3fa170ef7c7ed2a94e978b05eda5327b7ca0a7a500') version('8.8.2', sha256='be755be155304572c7c2eae81a67c5ecbcd3dcd3aa6372d7f4afeb7ffaad6356') diff --git a/meshing/packages/vtkcontrib/package.py b/meshing/packages/vtkcontrib/package.py index 9ce2e71..8b3e54a 100644 --- a/meshing/packages/vtkcontrib/package.py +++ b/meshing/packages/vtkcontrib/package.py @@ -21,7 +21,8 @@ class Vtkcontrib(CMakePackage): # depends_on('vtk@7.1:7.99~opengl2~python~xdmf+qt', type=('build', 'link')) # depends_on('qt@5.9.1', type=('build', 'link')) depends_on('guitoolkitsvariables@1.5.99:', type=('build', 'link')) - depends_on('vtk-maillage', type=('build', 'link')) + depends_on('vtk-maillage', type=('build', 'link'), when='+vtk7') + depends_on('vtk@9.3:', type=('build', 'link'), when='~vtk7') # depends_on('mpi', type=('build', 'link')) # for undefined reference in util-linux/libmount to intl_.... @@ -56,6 +57,7 @@ class Vtkcontrib(CMakePackage): depends_on("cxx", type="build") # generated variant('shared', default=True, description='Creation de bibliotheques dynamiques (defaut:shared, annuler le defaut par ~shared)') + variant('vtk7', default=True, description='Uses VTK v 7.1.1 and its OpenGL 1 backend. In its absence uses VTK 9.3 and its OpenGL 2 backend (does not pass through the GLX channel of ssh).') def cmake_args(self): # Since version 5.4.0 VtkContrib uses common_vtk.cmake of GUIToolkitsVariables which @@ -63,8 +65,4 @@ def cmake_args(self): args = [] args.append(self.define_from_variant('BUILD_SHARED_LIBS', 'shared')) - # if OFF does vtkcontrib uses OPENGL2 ? - # see VTK_OPENGL_BACKEND in src/VtkContrib/CMakeLists.txt - args.append('-DUSE_OPENGL_BACKEND:BOOL=ON') - return args From 6761184e8f31a5c5c02edec32d4fdf6f9c3cf056 Mon Sep 17 00:00:00 2001 From: Charles PIGNEROL <> Date: Tue, 18 Nov 2025 13:42:35 +0100 Subject: [PATCH 2/2] VTK 7 (vtk-mesh) and VTK 9 compatibility. The goal is to be able to compile Magix3D in VTK 9 and offer a simple alternative to the current VTK 7 solution. Note that VTK 9 has the drawback of using OpenGL > 3.2.0 and therefore cannot take advantage of GLX (or Vulcan) SSH tunneling. --- meshing/packages/qqualif/package.py | 2 +- meshing/packages/qtvtk/package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meshing/packages/qqualif/package.py b/meshing/packages/qqualif/package.py index 13feb61..2aef7c6 100644 --- a/meshing/packages/qqualif/package.py +++ b/meshing/packages/qqualif/package.py @@ -37,7 +37,7 @@ class Qqualif(CMakePackage): variant('shared', default=True, description='Creation de bibliotheques dynamiques') variant('lima', default=True, description='Utilisation de la structure de maillages Lima') variant('gmds', default=True, description='Utilisation de la structure de maillages GMDS') -# The difficulty with QQualif is that we do or do not want VTK, and that, for VtkContrib and +# The difficulty with QQualif is that we do or do not want VTK, and that, for VtkContrib and # QtVtk, we can use vtk-maillage or vtk 9. # The use here of the 2 variants vtk7 and vtk9 allows us to cover these 3 cases. variant('vtk7', default=True, description='Utilisation de la structure de maillages vtkUnstructuredGrid de VTK 7') diff --git a/meshing/packages/qtvtk/package.py b/meshing/packages/qtvtk/package.py index c948ae3..bd8fe7a 100644 --- a/meshing/packages/qtvtk/package.py +++ b/meshing/packages/qtvtk/package.py @@ -27,7 +27,7 @@ class Qtvtk(CMakePackage): depends_on('vtk +qt', type=('build', 'link'), when='^vtkcontrib~vtk7') variant('shared', default=True, description='Creation de bibliotheques dynamiques (defaut:shared, annuler le defaut par ~shared)') - + version('8.8.4', sha256='436fc9ea484f308e529f8ba7c60e963c48e315dc6d22fabf6bccb34ea13d4568') version('8.8.3', sha256='c1408a43b7d2832de99d2e3fa170ef7c7ed2a94e978b05eda5327b7ca0a7a500') version('8.8.2', sha256='be755be155304572c7c2eae81a67c5ecbcd3dcd3aa6372d7f4afeb7ffaad6356')