From 0147399b3980e9b1cf525670df6019a22983de5a Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Thu, 1 Dec 2022 10:55:04 +0100 Subject: [PATCH] spns #33000: fix PyImport_ImportModule segmentation fault (ParaView 5.11.0) + Handle ALAMOS (ParaView 5.9.0) --- products/ParaView.pyconf | 21 ++++++++++++------- products/compil_scripts/ParaView-5.9.0.sh | 6 ++++++ .../patches/paraview-5.11.0.p006-GIL.patch | 10 +++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 products/patches/paraview-5.11.0.p006-GIL.patch diff --git a/products/ParaView.pyconf b/products/ParaView.pyconf index 94aa8c0..1189c16 100755 --- a/products/ParaView.pyconf +++ b/products/ParaView.pyconf @@ -36,7 +36,8 @@ version_5_11_0 : archive_info : {archive_name : "ParaView-5.11.0.tar.gz"} patches : [ 'paraview-5.11.0.p001-FindCGNS.patch', - 'paraview-5.11.0.p003-ParaViewClient.patch' + 'paraview-5.11.0.p003-ParaViewClient.patch', + 'paraview-5.11.0.p006-GIL.patch' ] depend : [ 'Python', @@ -60,7 +61,8 @@ version_5_11_0_int32 : archive_info : {archive_name : "ParaView-5.11.0.tar.gz"} # two other LATA patches already included in archive patches : [ - 'paraview-5.11.0.p001-FindCGNS.patch' + 'paraview-5.11.0.p001-FindCGNS.patch', + 'paraview-5.11.0.p006-GIL.patch' ] depend : [ 'Python', @@ -97,7 +99,8 @@ version_5_11_0_win : opt_depend : ['openmpi', 'ospray','tbb', 'openturns', 'rkCommon', 'matplotlib'] patches : ['paraview-5.11.0.p001-FindCGNS.patch', 'paraview-5.11.0.p002-FindMPI.patch', - 'paraview-5.11.0.p004-vtkUniformHyperTreeGrid.patch' + 'paraview-5.11.0.p004-vtkUniformHyperTreeGrid.patch', + 'paraview-5.11.0.p006-GIL.patch' ] } @@ -121,7 +124,8 @@ version_5_11_0_win_dbg : patches : ['paraview-5.11.0.p001-FindCGNS.patch', 'paraview-5.11.0.p002-FindMPI.patch', 'paraview-5.11.0.p004-vtkUniformHyperTreeGrid.patch', - 'paraview-5.11.0.p005-vtkPython-debug.patch' + 'paraview-5.11.0.p005-vtkPython-debug.patch', + 'paraview-5.11.0.p006-GIL.patch' ] } @@ -154,7 +158,8 @@ version_5_11_0_MPI_LATA_64BITS_IDS : archive_info : {archive_name : "ParaView-5.11.0.tar.gz"} patches : ['paraview-5.11.0.p001-FindCGNS.patch', 'paraview-5.11.0.p002-FindMPI.patch', - 'paraview-0012-LATA_64BITS_IDS.patch' + 'paraview-0012-LATA_64BITS_IDS.patch', + 'paraview-5.11.0.p006-GIL.patch' ] } @@ -164,7 +169,8 @@ version_5_11_0_MPI_DB10 : archive_info : {archive_name : "ParaView-5.11.0.tar.gz"} patches : ['paraview-5.11.0.p001-FindCGNS.patch', 'paraview-5.11.0.p002-FindMPI.patch', - 'paraview-5.11.0.p003-ParaViewClient.patch' + 'paraview-5.11.0.p003-ParaViewClient.patch', + 'paraview-5.11.0.p006-GIL.patch' ] depend : [ 'Python', @@ -188,7 +194,8 @@ version_5_11_0_MPI_CO8 : archive_info : {archive_name : "ParaView-5.11.0.tar.gz"} patches : ['paraview-5.11.0.p001-FindCGNS.patch', 'paraview-5.11.0.p002-FindMPI.patch', - 'paraview-5.11.0.p003-ParaViewClient.patch' + 'paraview-5.11.0.p003-ParaViewClient.patch', + 'paraview-5.11.0.p006-GIL.patch' ] depend : [ 'Python', diff --git a/products/compil_scripts/ParaView-5.9.0.sh b/products/compil_scripts/ParaView-5.9.0.sh index 8cffe1c..7956604 100755 --- a/products/compil_scripts/ParaView-5.9.0.sh +++ b/products/compil_scripts/ParaView-5.9.0.sh @@ -274,6 +274,12 @@ if [ -n "$NETCDF_ROOT_DIR" ]; then CMAKE_OPTIONS+=" -DVTK_MODULE_ENABLE_VTK_FiltersParallelGeometry=YES" fi +if [ "${SALOME_APPLICATION_NAME}" == "ALAMOS" ]; then + echo "WARNING: Assumming application is ALAMOS, switching on PDF export..." + CMAKE_OPTIONS+=" -DVTK_MODULE_ENABLE_VTK_PythonContext2D=YES" + CMAKE_OPTIONS+=" -DVTK_MODULE_ENABLE_VTK_IOExportPDF=YES" +fi + echo echo "*** cmake" ${CMAKE_OPTIONS} cmake ${CMAKE_OPTIONS} $SOURCE_DIR diff --git a/products/patches/paraview-5.11.0.p006-GIL.patch b/products/patches/paraview-5.11.0.p006-GIL.patch new file mode 100644 index 0000000..b12d7bc --- /dev/null +++ b/products/patches/paraview-5.11.0.p006-GIL.patch @@ -0,0 +1,10 @@ +--- ParaView_ref/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx 2022-12-01 10:35:02.476305685 +0100 ++++ ParaView_dev/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx 2022-12-01 10:35:41.811632384 +0100 +@@ -790,6 +790,7 @@ + //------------------------------------------------------------------------------ + bool vtkMatplotlibMathTextUtilities::SetMathTextFont(vtkTextProperty* tprop) + { ++ vtkPythonScopeGilEnsurer gilEnsurer; + vtkSmartPyObject mplBase(PyImport_ImportModule("matplotlib")); + if (this->CheckForError(mplBase)) + { -- 2.39.2