Fedora 36 and math text (MaskParser is not initialized!)

Hi! On Fedora 36, I’m unable to use LaTeX math fonts for any string.

When using the package:
paraview.x86_64 5.10.0-0.4.fc36
I get the errors:

ERROR: In /builddir/build/BUILD/ParaView-v5.10.0/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx, line 984
vtkMatplotlibMathTextUtilities (0x55aa49684830): MaskParser is not initialized!

ERROR: In /builddir/build/BUILD/ParaView-v5.10.0/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx, line 515
vtkMatplotlibMathTextUtilities (0x55aa49684830): MaskParser is not initialized!

ERROR: In /builddir/build/BUILD/ParaView-v5.10.0/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx, line 984
vtkMatplotlibMathTextUtilities (0x55aa49684830): MaskParser is not initialized!

ERROR: In /builddir/build/BUILD/ParaView-v5.10.0/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx, line 515
vtkMatplotlibMathTextUtilities (0x55aa49684830): MaskParser is not initialized!

And when building from source (master branch)
(using cmake -GNinja -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DCMAKE_BUILD_TYPE=Release ../paraview)
I get similar errors:

ERROR: In vtkMatplotlibMathTextUtilities.cxx, line 1087
vtkMatplotlibMathTextUtilities (0x4091e80): MaskParser is not initialized!

ERROR: In vtkMatplotlibMathTextUtilities.cxx, line 518
vtkMatplotlibMathTextUtilities (0x4091e80): MaskParser is not initialized!

ERROR: In vtkMatplotlibMathTextUtilities.cxx, line 1087
vtkMatplotlibMathTextUtilities (0x4091e80): MaskParser is not initialized!

ERROR: In vtkMatplotlibMathTextUtilities.cxx, line 518
vtkMatplotlibMathTextUtilities (0x4091e80): MaskParser is not initialized!

Any thoughts on how to resolve this would be appreciated. I haven’t had any luck on my own search.

Is this using ParaView itself? I wonder if Fedora builds without Matplotlib support (seems so looking at the spec file)? Your build is almost certainly without it though; you’d need VTK_MODULE_ENABLE_VTK_RenderingMatplotlib=ON).

Yes, this is while in paraview. It’s the error output in the popup “Output Messages” box when I try to do something like set the xlabel of an axis to $x$.

Unfortunately, when I use that option (-DVTK_MODULE_ENABLE_VTK_RenderingMatplotlib=YES) I still get the same error when building with this option. Does Matplotlib have to be setup in a specific way on the system?

Watching things in the debugger, it looks like it’s this call that’s failing inside vtk: VTK/vtkMatplotlibMathTextUtilities.cxx at 468bf785a4dac90a796565edff650d651a4d32dd · Kitware/VTK · GitHub
leading to the error messages that I’ve pasted above.

At my limits for understanding what’s going on in here (for now). Just posting this update in case anyone else knows a quick fix.

I wonder if there isn’t a matplotlib API change we’re affected by. I remember something about this name being deprecated, optional, or something, but that’s about it.

Good insight. Yes, that seems to be the case.

matplotlib v3.5.3:

v3.6.0 (what I’m on in Fedora 36):

Looks like they’ve made some changes to how they represent mathtext in the backend, including removing the bitmap backend.

I’m going to try downgrading my matplotlib, rebuilding with v3.5.3 to see if that works.

That worked! Using matplotlib v3.5.3, I can use math formatting in strings.

That’s a good enough fix for me for now, but moving forward, I guess we just bring this to the attention of the VTK devs to update their code (VTK/master uses the same call as VTK/468bf78).

Note: changing your matplotlib version does NOT require a rebuild of paraview

VTK has had an issue for a while; it’s important now: https://gitlab.kitware.com/vtk/vtk/-/issues/18517