diff --git a/.gitignore b/.gitignore index 104cc2e..1e9afc3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,17 @@ vtk-5.6.0.tar.gz /VTKData-9.2.5.tar.gz /VTK-9.2.6.tar.gz /VTKData-9.2.6.tar.gz +/VTK-9.3.0.tar.gz +/VTKData-9.3.0.tar.gz +/VTK-9.3.1.tar.gz +/VTKData-9.3.1.tar.gz +/VTK-9.4.1.tar.gz +/VTKData-9.4.1.tar.gz +/VTK-9.4.2.tar.gz +/VTKData-9.4.2.tar.gz +/VTK-9.5.0.tar.gz +/VTKData-9.5.0.tar.gz +/VTK-9.5.1.tar.gz +/VTKData-9.5.1.tar.gz +/VTK-9.5.2.tar.gz +/VTKData-9.5.2.tar.gz diff --git a/9616.patch b/9616.patch deleted file mode 100644 index 4dfd591..0000000 --- a/9616.patch +++ /dev/null @@ -1,79 +0,0 @@ -From a2ca9a079ecc8926f6ddf7a72803340a4944e7cf Mon Sep 17 00:00:00 2001 -From: Eric Larson -Date: Tue, 11 Oct 2022 12:12:38 -0400 -Subject: [PATCH] BUG: Fix bug with vtkPlotBar.GetLookupTable() - -Also remove old nullptr assignments as they are unnecessary -when using vtkSmartPointer. ---- - .../Core/Testing/Cxx/TestPlotBarRangeHandlesItem.cxx | 2 ++ - Charts/Core/vtkPlotBar.cxx | 10 +++++++--- - .../release/dev/fix-vtkPlotBar-GetLookupTable.md | 4 ++++ - 3 files changed, 13 insertions(+), 3 deletions(-) - create mode 100644 Documentation/release/dev/fix-vtkPlotBar-GetLookupTable.md - -diff --git a/Charts/Core/Testing/Cxx/TestPlotBarRangeHandlesItem.cxx b/Charts/Core/Testing/Cxx/TestPlotBarRangeHandlesItem.cxx -index 2d0ed46b128..919319a6b4d 100644 ---- a/Charts/Core/Testing/Cxx/TestPlotBarRangeHandlesItem.cxx -+++ b/Charts/Core/Testing/Cxx/TestPlotBarRangeHandlesItem.cxx -@@ -88,6 +88,8 @@ int TestPlotBarRangeHandlesItem(int, char*[]) - - // Add bar plot and handles - vtkPlotBar* barPlot = vtkPlotBar::SafeDownCast(chart->AddPlot(vtkChart::BAR)); -+ // smoke test for https://gitlab.kitware.com/vtk/vtk/-/issues/18682#note_1258974 -+ barPlot->GetLookupTable(); - barPlot->SetInputData(table, "Months", "Books"); - chart->SetBarWidthFraction(1.0); - -diff --git a/Charts/Core/vtkPlotBar.cxx b/Charts/Core/vtkPlotBar.cxx -index a68a26c0ecd..220e8199d02 100644 ---- a/Charts/Core/vtkPlotBar.cxx -+++ b/Charts/Core/vtkPlotBar.cxx -@@ -535,12 +535,11 @@ vtkStandardNewMacro(vtkPlotBar); - vtkPlotBar::vtkPlotBar() - { - this->Private = new vtkPlotBarPrivate(this); -+ // Points is not a vtkSmartPointer, so set it explicitly to nullptr - this->Points = nullptr; -- this->AutoLabels = nullptr; - this->Width = 1.0; - this->Pen->SetWidth(1.0); - this->Offset = 1.0; -- this->ColorSeries = nullptr; - this->Orientation = vtkPlotBar::VERTICAL; - this->ScalarVisibility = false; - this->EnableOpacityMapping = true; -@@ -612,6 +611,10 @@ void vtkPlotBar::GetBounds(double bounds[4], bool unscaled) - - // Get the x and y arrays (index 0 and 1 respectively) - vtkTable* table = this->Data->GetInput(); -+ if (!table) -+ { -+ return; -+ } - vtkDataArray* x = - this->UseIndexForXSeries ? nullptr : this->Data->GetInputArrayToProcess(0, table); - vtkDataArray* y = this->Data->GetInputArrayToProcess(1, table); -@@ -945,7 +948,8 @@ void vtkPlotBar::CreateDefaultLookupTable() - // rainbow - blue to red - lut->SetHueRange(0.6667, 0.0); - lut->Build(); -- double bounds[4]; -+ // set reasonable defaults in case no data has been set -+ double bounds[4] = { 0.0, 1.0, 0.0, 1.0 }; - this->GetBounds(bounds); - lut->SetRange(bounds[0], bounds[1]); - this->LookupTable = lut; -diff --git a/Documentation/release/dev/fix-vtkPlotBar-GetLookupTable.md b/Documentation/release/dev/fix-vtkPlotBar-GetLookupTable.md -new file mode 100644 -index 00000000000..ba6a96753ac ---- /dev/null -+++ b/Documentation/release/dev/fix-vtkPlotBar-GetLookupTable.md -@@ -0,0 +1,4 @@ -+## Fixes for vtkPlotBar.GetLookupTable -+ -+Fixes a bug where calling vtkPlotBar.GetLookupTable caused a segmentation -+fault in the case where no data had been plotted yet. --- -GitLab - diff --git a/sources b/sources index 03bdad8..be5d56c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (VTK-9.2.6.tar.gz) = f2328caae959d583299b7fd57205f3dd76f87c8c1ee78653e85d44cab085295bf7bf88b3f6a2b960a57df96ccb32049337ebccb067ecde6d84d25eda636196bc -SHA512 (VTKData-9.2.6.tar.gz) = 5c5f2b365777733180a63daff224da7055e1c2911eb5e4efda26e38b9ac01cb8e886cf7e71c45ac83347642caf1786e72bb469c22954ffbbb6e2c317fc6b4080 +SHA512 (VTK-9.5.2.tar.gz) = fc8157a89fa603a7f7fce356e2f638ae69e0ea629a507458bdbb173daf511c61e39a1f0d7201b196a5b3a7ffa7e3e821398b62521faadf85edb1119a1e8b8e8e +SHA512 (VTKData-9.5.2.tar.gz) = 1be895bed613ed0f0ace0ba5e138afacc3d61b57e437299b3aecf6beff702ad1a2d02036fd147853bbbcb6a1f9d20a51831c0263fdc5b8e62ece9a6f8f7d410e diff --git a/vtk-build.patch b/vtk-build.patch deleted file mode 100644 index e1ab822..0000000 --- a/vtk-build.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -rupN VTK-9.2.6/Utilities/octree/octree/octree_node.txx VTK-9.2.6-new/Utilities/octree/octree/octree_node.txx ---- VTK-9.2.6/Utilities/octree/octree/octree_node.txx 2023-02-15 05:03:53.000000000 +0100 -+++ VTK-9.2.6-new/Utilities/octree/octree/octree_node.txx 2025-01-24 14:12:16.855255487 +0100 -@@ -207,7 +207,7 @@ const octree_node& octree_no - { - throw std::domain_error("Attempt to access children of an octree leaf node."); - } -- return this->_M_chilren[child]; -+ return this->m_children[child]; - } - - /**\brief Return a reference to a child node. diff --git a/vtk-chobo-cstdint.patch b/vtk-chobo-cstdint.patch new file mode 100644 index 0000000..162259e --- /dev/null +++ b/vtk-chobo-cstdint.patch @@ -0,0 +1,22 @@ +diff -up VTK-9.3.1/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/chobo/small_vector.hpp.cstdint VTK-9.3.1/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/chobo/small_vector.hpp +--- VTK-9.3.1/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/chobo/small_vector.hpp.cstdint 2024-06-28 10:00:10.000000000 -0600 ++++ VTK-9.3.1/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/chobo/small_vector.hpp 2025-02-17 17:08:44.231541639 -0700 +@@ -138,6 +138,7 @@ + + #include + #include ++#include + #include + + #define CHOBO_SMALL_VECTOR_ERROR_HANDLING_NONE 0 +diff -up VTK-9.3.1/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/diy/vtkmdiy/include/vtkmdiy/thirdparty/chobo/small_vector.hpp.cstdint VTK-9.3.1/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/diy/vtkmdiy/include/vtkmdiy/thirdparty/chobo/small_vector.hpp +--- VTK-9.3.1/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/diy/vtkmdiy/include/vtkmdiy/thirdparty/chobo/small_vector.hpp.cstdint 2024-06-28 10:00:10.000000000 -0600 ++++ VTK-9.3.1/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/diy/vtkmdiy/include/vtkmdiy/thirdparty/chobo/small_vector.hpp 2025-02-17 17:08:27.992495226 -0700 +@@ -138,6 +138,7 @@ + + #include + #include ++#include + #include + + #define CHOBO_SMALL_VECTOR_ERROR_HANDLING_NONE 0 diff --git a/vtk-include.patch b/vtk-include.patch deleted file mode 100644 index 85d6e2f..0000000 --- a/vtk-include.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up VTK-9.2.5/IO/Image/vtkSEPReader.h.include VTK-9.2.5/IO/Image/vtkSEPReader.h ---- VTK-9.2.5/IO/Image/vtkSEPReader.h.include 2023-01-05 08:51:35.000000000 -0700 -+++ VTK-9.2.5/IO/Image/vtkSEPReader.h 2023-01-17 07:43:41.988095734 -0700 -@@ -26,6 +26,7 @@ - #include "vtkNew.h" // for ivars - - #include // for std::array -+#include // for std::uint8_t - #include // for std::string - - namespace details diff --git a/vtk-ppc64-no-always-inline.patch b/vtk-ppc64-no-always-inline.patch new file mode 100644 index 0000000..9705931 --- /dev/null +++ b/vtk-ppc64-no-always-inline.patch @@ -0,0 +1,13 @@ +diff --git a/Common/Core/vtkDataArrayMeta.h b/Common/Core/vtkDataArrayMeta.h +index 602305d3ed..8c37a96891 100644 +--- a/Common/Core/vtkDataArrayMeta.h ++++ b/Common/Core/vtkDataArrayMeta.h +@@ -32,7 +32,7 @@ + #endif + + #if (defined(VTK_ALWAYS_OPTIMIZE_ARRAY_ITERATORS) || !defined(VTK_DEBUG_RANGE_ITERATORS)) && \ +- !defined(VTK_COMPILER_MSVC) ++ !defined(VTK_COMPILER_MSVC) && !defined(__PPC64__) + #define VTK_ITER_INLINE VTK_ALWAYS_INLINE + #define VTK_ITER_ASSUME VTK_ASSUME_NO_ASSERT + #define VTK_ITER_OPTIMIZE_START VTK_ALWAYS_OPTIMIZE_START diff --git a/vtk-python3.13.patch b/vtk-python3.13.patch deleted file mode 100644 index 0bea05f..0000000 --- a/vtk-python3.13.patch +++ /dev/null @@ -1,90 +0,0 @@ -diff --git a/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx b/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx -index 0471594..bc92c85 100644 ---- a/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx -+++ b/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx -@@ -114,7 +114,9 @@ wchar_t* vtk_Py_UTF8ToWide(const char* arg) - - return result; - } -+#endif - -+#if PY_VERSION_HEX < 0x03080000 - std::string vtk_Py_WideToUTF8(const wchar_t* arg) - { - std::string result; -@@ -859,15 +861,20 @@ void vtkPythonInterpreter::SetupVTKPythonPaths() - if (vtklib.empty()) - { - VTKPY_DEBUG_MESSAGE( -- "`GetVTKVersion` library couldn't be found. Will use `Py_GetProgramName` next."); -+ "`GetVTKVersion` library couldn't be found. Will use `sys.executable` next."); - } - - if (vtklib.empty()) - { --#if PY_VERSION_HEX >= 0x03000000 -- vtklib = vtk_Py_WideToUTF8(Py_GetProgramName()); -+#if PY_VERSION_HEX >= 0x03080000 -+ vtkPythonScopeGilEnsurer gilEnsurer; -+ PyObject* executable_path = PySys_GetObject("executable"); -+ if (executable_path != Py_None) -+ { -+ vtklib = PyUnicode_AsUTF8AndSize(executable_path, nullptr); -+ } - #else -- vtklib = Py_GetProgramName(); -+ vtklib = vtk_Py_WideToUTF8(Py_GetProgramName()); - #endif - } - -diff --git a/Wrapping/Python/vtkmodules/test/Testing.py b/Wrapping/Python/vtkmodules/test/Testing.py -index 59186bb..d0643c1 100644 ---- a/Wrapping/Python/vtkmodules/test/Testing.py -+++ b/Wrapping/Python/vtkmodules/test/Testing.py -@@ -513,8 +513,10 @@ def test(cases): - """ - # Make the test suites from the arguments. - suites = [] -- for case in cases: -- suites.append(unittest.makeSuite(case[0], case[1])) -+ loader = unittest.TestLoader() -+ # the "name" is ignored (it was always just 'test') -+ for test,name in cases: -+ suites.append(loader.loadTestsFromTestCase(test)) - test_suite = unittest.TestSuite(suites) - - # Now run the tests. -diff --git a/Wrapping/PythonCore/PyVTKNamespace.cxx b/Wrapping/PythonCore/PyVTKNamespace.cxx -index 927eef1..7460eb7 100644 ---- a/Wrapping/PythonCore/PyVTKNamespace.cxx -+++ b/Wrapping/PythonCore/PyVTKNamespace.cxx -@@ -113,8 +113,10 @@ PyObject* PyVTKNamespace_New(const char* name) - { - // make sure python has readied the type object - PyType_Ready(&PyVTKNamespace_Type); -- // call the allocator provided by python for this type -- self = PyVTKNamespace_Type.tp_alloc(&PyVTKNamespace_Type, 0); -+ // call the superclass new function -+ PyObject* empty = PyTuple_New(0); -+ self = PyVTKNamespace_Type.tp_base->tp_new(&PyVTKNamespace_Type, empty, nullptr); -+ Py_DECREF(empty); - // call the superclass init function - PyObject* args = PyTuple_New(1); - PyTuple_SET_ITEM(args, 0, PyString_FromString(name)); -diff --git a/Wrapping/PythonCore/PyVTKTemplate.cxx b/Wrapping/PythonCore/PyVTKTemplate.cxx -index e0ff31e..c89900f 100644 ---- a/Wrapping/PythonCore/PyVTKTemplate.cxx -+++ b/Wrapping/PythonCore/PyVTKTemplate.cxx -@@ -788,8 +788,10 @@ PyObject* PyVTKTemplate_New(const char* name, const char* docstring) - { - // make sure python has readied the type object - PyType_Ready(&PyVTKTemplate_Type); -- // call the allocator provided by python for this type -- PyObject* self = PyVTKTemplate_Type.tp_alloc(&PyVTKTemplate_Type, 0); -+ // call the superclass new function -+ PyObject* empty = PyTuple_New(0); -+ PyObject* self = PyVTKTemplate_Type.tp_base->tp_new(&PyVTKTemplate_Type, empty, nullptr); -+ Py_DECREF(empty); - // call the superclass init function - PyObject* args = PyTuple_New(2); - PyTuple_SET_ITEM(args, 0, PyString_FromString(name)); diff --git a/vtk-tk9.patch b/vtk-tk9.patch new file mode 100644 index 0000000..895669f --- /dev/null +++ b/vtk-tk9.patch @@ -0,0 +1,489 @@ +commit b7c22497712be6751fbefe155533ae34d5e381f5 +Author: Spiros Tsalikis +Date: Thu May 22 12:30:19 2025 -0400 + + Tcl/Tk: Support version 9.0.0 + +diff --git a/Rendering/Tk/vtkTkImageViewerWidget.cxx b/Rendering/Tk/vtkTkImageViewerWidget.cxx +index 43c7a48a13..9d2c4210de 100644 +--- a/Rendering/Tk/vtkTkImageViewerWidget.cxx ++++ b/Rendering/Tk/vtkTkImageViewerWidget.cxx +@@ -23,6 +23,17 @@ + #include + #include + ++#if (TCL_MAJOR_VERSION >= 9) ++#define VTK_TCL_CONST const ++#elif ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) ++#define VTK_TCL_CONST CONST84 ++#else ++#define VTK_TCL_CONST ++#endif ++#ifndef offsetof ++#define offsetof(type, field) ((size_t)((char*)&((type*)0)->field)) ++#endif ++ + #define VTK_ALL_EVENTS_MASK \ + KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | \ + LeaveWindowMask | PointerMotionMask | ExposureMask | VisibilityChangeMask | FocusChangeMask | \ +@@ -32,14 +43,14 @@ + // or with the command configure. The only new one is "-rw" which allows + // the uses to set their own ImageViewer window. + static Tk_ConfigSpec vtkTkImageViewerWidgetConfigSpecs[] = { +- { TK_CONFIG_PIXELS, (char*)"-height", (char*)"height", (char*)"Height", (char*)"400", +- Tk_Offset(struct vtkTkImageViewerWidget, Height), 0, nullptr }, ++ { TK_CONFIG_PIXELS, "-height", "height", "Height", "400", ++ offsetof(struct vtkTkImageViewerWidget, Height), 0, nullptr }, + +- { TK_CONFIG_PIXELS, (char*)"-width", (char*)"width", (char*)"Width", (char*)"400", +- Tk_Offset(struct vtkTkImageViewerWidget, Width), 0, nullptr }, ++ { TK_CONFIG_PIXELS, "-width", "width", "Width", "400", ++ offsetof(struct vtkTkImageViewerWidget, Width), 0, nullptr }, + +- { TK_CONFIG_STRING, (char*)"-iv", (char*)"iv", (char*)"IV", (char*)"", +- Tk_Offset(struct vtkTkImageViewerWidget, IV), 0, nullptr }, ++ { TK_CONFIG_STRING, "-iv", "iv", "IV", "", offsetof(struct vtkTkImageViewerWidget, IV), 0, ++ nullptr }, + + { TK_CONFIG_END, nullptr, nullptr, nullptr, nullptr, 0, 0, nullptr } + }; +@@ -56,17 +67,22 @@ extern int vtkImageViewerCommand(ClientData cd, Tcl_Interp* interp, int argc, ch + //------------------------------------------------------------------------------ + // It's possible to change with this function or in a script some + // options like width, height or the ImageViewer widget. +-int vtkTkImageViewerWidget_Configure( +- Tcl_Interp* interp, struct vtkTkImageViewerWidget* self, int argc, char* argv[], int flags) ++#if (TCL_MAJOR_VERSION >= 9) ++int vtkTkImageViewerWidget_Configure(Tcl_Interp* interp, struct vtkTkImageViewerWidget* self, ++ Tcl_Size objc, Tcl_Obj* const* objv, int flags) ++#else ++int vtkTkImageViewerWidget_Configure(Tcl_Interp* interp, struct vtkTkImageViewerWidget* self, ++ int argc, VTK_TCL_CONST char* argv[], int flags) ++#endif + { + // Let Tk handle generic configure options. +- if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkImageViewerWidgetConfigSpecs, argc, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- const_cast(argv), ++#if (TCL_MAJOR_VERSION >= 9) ++ if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkImageViewerWidgetConfigSpecs, objc, objv, ++ (void*)self, flags) == TCL_ERROR) + #else +- argv, +-#endif ++ if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkImageViewerWidgetConfigSpecs, argc, argv, + (char*)self, flags) == TCL_ERROR) ++#endif + { + return (TCL_ERROR); + } +@@ -89,11 +105,8 @@ int vtkTkImageViewerWidget_Configure( + // to choose the appropriate method to invoke. + extern "C" + { +- int vtkTkImageViewerWidget_Widget(ClientData clientData, Tcl_Interp* interp, int argc, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- CONST84 +-#endif +- char* argv[]) ++ int vtkTkImageViewerWidget_Widget( ++ ClientData clientData, Tcl_Interp* interp, int argc, VTK_TCL_CONST char* argv[]) + { + struct vtkTkImageViewerWidget* self = (struct vtkTkImageViewerWidget*)clientData; + int result = TCL_OK; +@@ -106,7 +119,11 @@ extern "C" + } + + // Make sure the widget is not deleted during this function ++#if (TCL_MAJOR_VERSION >= 9) ++ Tcl_Preserve((ClientData)self); ++#else + Tk_Preserve((ClientData)self); ++#endif + + // Handle render call to the widget + if (strncmp(argv[1], "render", std::max(1, strlen(argv[1]))) == 0 || +@@ -137,13 +154,27 @@ extern "C" + else + { + /* Execute a configuration change */ +- result = vtkTkImageViewerWidget_Configure(interp, self, argc - 2, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- const_cast(argv + 2), ++#if (TCL_MAJOR_VERSION >= 9) ++ // Convert string arguments to Tcl_Obj for TCL 9.0 ++ Tcl_Obj** objv_config = (Tcl_Obj**)ckalloc((argc - 2) * sizeof(Tcl_Obj*)); ++ for (int i = 0; i < argc - 2; i++) ++ { ++ objv_config[i] = Tcl_NewStringObj(argv[i + 2], -1); ++ Tcl_IncrRefCount(objv_config[i]); ++ } ++ result = vtkTkImageViewerWidget_Configure( ++ interp, self, argc - 2, objv_config, TK_CONFIG_ARGV_ONLY); ++ ++ // Clean up the Tcl_Obj array ++ for (int i = 0; i < argc - 2; i++) ++ { ++ Tcl_DecrRefCount(objv_config[i]); ++ } ++ ckfree((char*)objv_config); + #else +- argv + 2, ++ result = ++ vtkTkImageViewerWidget_Configure(interp, self, argc - 2, argv + 2, TK_CONFIG_ARGV_ONLY); + #endif +- TK_CONFIG_ARGV_ONLY); + } + } + else if (!strcmp(argv[1], "GetImageViewer")) +@@ -165,7 +196,11 @@ extern "C" + } + + // Unlock the object so it can be deleted. ++#if (TCL_MAJOR_VERSION >= 9) ++ Tcl_Release((ClientData)self); ++#else + Tk_Release((ClientData)self); ++#endif + return result; + } + } +@@ -181,16 +216,10 @@ extern "C" + // * Configures this vtkTkImageViewerWidget for the given arguments + extern "C" + { +- int vtkTkImageViewerWidget_Cmd(ClientData clientData, Tcl_Interp* interp, int argc, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- CONST84 +-#endif +- char** argv) ++ int vtkTkImageViewerWidget_Cmd( ++ ClientData clientData, Tcl_Interp* interp, int argc, VTK_TCL_CONST char** argv) + { +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- CONST84 +-#endif +- char* name; ++ VTK_TCL_CONST char* name; + Tk_Window main = (Tk_Window)clientData; + Tk_Window tkwin; + struct vtkTkImageViewerWidget* self; +@@ -233,13 +262,37 @@ extern "C" + vtkTkImageViewerWidget_EventProc, (ClientData)self); + + // Configure vtkTkImageViewerWidget widget +- if (vtkTkImageViewerWidget_Configure(interp, self, argc - 2, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- const_cast(argv + 2), ++#if (TCL_MAJOR_VERSION >= 9) ++ // Convert string arguments to Tcl_Obj for TCL 9.0 ++ Tcl_Obj** objv_init = (Tcl_Obj**)ckalloc((argc - 2) * sizeof(Tcl_Obj*)); ++ for (int i = 0; i < argc - 2; i++) ++ { ++ objv_init[i] = Tcl_NewStringObj(argv[i + 2], -1); ++ Tcl_IncrRefCount(objv_init[i]); ++ } ++ ++ if (vtkTkImageViewerWidget_Configure(interp, self, argc - 2, objv_init, 0) == TCL_ERROR) ++ { ++ // Clean up before error return ++ for (int i = 0; i < argc - 2; i++) ++ { ++ Tcl_DecrRefCount(objv_init[i]); ++ } ++ ckfree((char*)objv_init); ++ ++ Tk_DestroyWindow(tkwin); ++ Tcl_DeleteCommand(interp, (char*)"vtkTkImageViewerWidget"); ++ return TCL_ERROR; ++ } ++ ++ // Clean up the Tcl_Obj array ++ for (int i = 0; i < argc - 2; i++) ++ { ++ Tcl_DecrRefCount(objv_init[i]); ++ } ++ ckfree((char*)objv_init); + #else +- argv + 2, +-#endif +- 0) == TCL_ERROR) ++ if (vtkTkImageViewerWidget_Configure(interp, self, argc - 2, argv + 2, 0) == TCL_ERROR) + { + Tk_DestroyWindow(tkwin); + Tcl_DeleteCommand(interp, (char*)"vtkTkImageViewerWidget"); +@@ -247,6 +300,7 @@ extern "C" + // free(self); + return TCL_ERROR; + } ++#endif + + Tcl_AppendResult(interp, Tk_PathName(tkwin), nullptr); + return TCL_OK; +@@ -255,7 +309,11 @@ extern "C" + + extern "C" + { ++#if (TCL_MAJOR_VERSION >= 9) ++ void vtkTkImageViewerWidget_Destroy(void* memPtr) ++#else + void vtkTkImageViewerWidget_Destroy(char* memPtr) ++#endif + { + struct vtkTkImageViewerWidget* self = (struct vtkTkImageViewerWidget*)memPtr; + +diff --git a/Rendering/Tk/vtkTkRenderWidget.cxx b/Rendering/Tk/vtkTkRenderWidget.cxx +index 6ddaa5816a..84c940b484 100644 +--- a/Rendering/Tk/vtkTkRenderWidget.cxx ++++ b/Rendering/Tk/vtkTkRenderWidget.cxx +@@ -29,6 +29,17 @@ + #include + #include + ++#if (TCL_MAJOR_VERSION >= 9) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 6)) ++#define VTK_TCL_CONST const ++#elif ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) ++#define VTK_TCL_CONST CONST84 ++#else ++#define VTK_TCL_CONST ++#endif ++#ifndef offsetof ++#define offsetof(type, field) ((size_t)((char*)&((type*)0)->field)) ++#endif ++ + // Silence warning like + // "dereferencing type-punned pointer will break strict-aliasing rules" + // it happens because this kind of expression: (long *)&ptr +@@ -45,14 +56,13 @@ + // or with the command configure. The only new one is "-rw" which allows + // the uses to set their own render window. + static Tk_ConfigSpec vtkTkRenderWidgetConfigSpecs[] = { +- { TK_CONFIG_PIXELS, (char*)"-height", (char*)"height", (char*)"Height", (char*)"400", +- Tk_Offset(struct vtkTkRenderWidget, Height), 0, nullptr }, ++ { TK_CONFIG_PIXELS, "-height", "height", "Height", "400", ++ offsetof(struct vtkTkRenderWidget, Height), 0, nullptr }, + +- { TK_CONFIG_PIXELS, (char*)"-width", (char*)"width", (char*)"Width", (char*)"400", +- Tk_Offset(struct vtkTkRenderWidget, Width), 0, nullptr }, ++ { TK_CONFIG_PIXELS, "-width", "width", "Width", "400", offsetof(struct vtkTkRenderWidget, Width), ++ 0, nullptr }, + +- { TK_CONFIG_STRING, (char*)"-rw", (char*)"rw", (char*)"RW", (char*)"", +- Tk_Offset(struct vtkTkRenderWidget, RW), 0, nullptr }, ++ { TK_CONFIG_STRING, "-rw", "rw", "RW", "", offsetof(struct vtkTkRenderWidget, RW), 0, nullptr }, + + { TK_CONFIG_END, nullptr, nullptr, nullptr, nullptr, 0, 0, nullptr } + }; +@@ -113,11 +123,8 @@ extern "C" + #define VTKIMAGEDATATOTKPHOTO_CORONAL 0 + #define VTKIMAGEDATATOTKPHOTO_SAGITTAL 1 + #define VTKIMAGEDATATOTKPHOTO_TRANSVERSE 2 +- int vtkImageDataToTkPhoto_Cmd(ClientData vtkNotUsed(clientData), Tcl_Interp* interp, int argc, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- CONST84 +-#endif +- char** argv) ++ int vtkImageDataToTkPhoto_Cmd( ++ ClientData vtkNotUsed(clientData), Tcl_Interp* interp, int argc, VTK_TCL_CONST char** argv) + { + int status = 0; + vtkImageData* image; +@@ -330,8 +337,14 @@ extern "C" + block.offset[3] = 3; + break; + } ++#if (TCL_MAJOR_VERSION >= 9) ++ Tk_PhotoSetSize(interp, photo, block.width, block.height); ++ Tk_PhotoPutBlock( ++ interp, photo, &block, 0, 0, block.width, block.height, TK_PHOTO_COMPOSITE_SET); ++#else + Tk_PhotoSetSize(photo, block.width, block.height); + Tk_PhotoPutBlock(photo, &block, 0, 0, block.width, block.height); ++#endif + return TCL_OK; + } + } +@@ -339,17 +352,22 @@ extern "C" + //------------------------------------------------------------------------------ + // It's possible to change with this function or in a script some + // options like width, height or the render widget. +-int vtkTkRenderWidget_Configure( +- Tcl_Interp* interp, struct vtkTkRenderWidget* self, int argc, char* argv[], int flags) ++#if (TCL_MAJOR_VERSION >= 9) ++int vtkTkRenderWidget_Configure(Tcl_Interp* interp, struct vtkTkRenderWidget* self, Tcl_Size objc, ++ Tcl_Obj* const* objv, int flags) ++#else ++int vtkTkRenderWidget_Configure(Tcl_Interp* interp, struct vtkTkRenderWidget* self, int argc, ++ VTK_TCL_CONST char* argv[], int flags) ++#endif + { + // Let Tk handle generic configure options. +- if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkRenderWidgetConfigSpecs, argc, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- const_cast(argv), ++#if (TCL_MAJOR_VERSION >= 9) ++ if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkRenderWidgetConfigSpecs, objc, objv, (void*)self, ++ flags) == TCL_ERROR) + #else +- argv, ++ if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkRenderWidgetConfigSpecs, argc, argv, (char*)self, ++ flags) == TCL_ERROR) + #endif +- (char*)self, flags) == TCL_ERROR) + { + return (TCL_ERROR); + } +@@ -372,11 +390,8 @@ int vtkTkRenderWidget_Configure( + // to choose the appropriate method to invoke. + extern "C" + { +- int vtkTkRenderWidget_Widget(ClientData clientData, Tcl_Interp* interp, int argc, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- CONST84 +-#endif +- char* argv[]) ++ int vtkTkRenderWidget_Widget( ++ ClientData clientData, Tcl_Interp* interp, int argc, VTK_TCL_CONST char* argv[]) + { + struct vtkTkRenderWidget* self = (struct vtkTkRenderWidget*)clientData; + int result = TCL_OK; +@@ -389,7 +404,11 @@ extern "C" + } + + // Make sure the widget is not deleted during this function ++#if (TCL_MAJOR_VERSION >= 9) ++ Tcl_Preserve((ClientData)self); ++#else + Tk_Preserve((ClientData)self); ++#endif + + // Handle render call to the widget + if (strncmp(argv[1], "render", std::max(1, strlen(argv[1]))) == 0 || +@@ -420,13 +439,26 @@ extern "C" + else + { + /* Execute a configuration change */ +- result = vtkTkRenderWidget_Configure(interp, self, argc - 2, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- const_cast(argv + 2), ++#if (TCL_MAJOR_VERSION >= 9) ++ // Convert string arguments to Tcl_Obj for TCL 9.0 ++ Tcl_Obj** objv_config = (Tcl_Obj**)ckalloc((argc - 2) * sizeof(Tcl_Obj*)); ++ for (int i = 0; i < argc - 2; i++) ++ { ++ objv_config[i] = Tcl_NewStringObj(argv[i + 2], -1); ++ Tcl_IncrRefCount(objv_config[i]); ++ } ++ result = ++ vtkTkRenderWidget_Configure(interp, self, argc - 2, objv_config, TK_CONFIG_ARGV_ONLY); ++ ++ // Clean up the Tcl_Obj array ++ for (int i = 0; i < argc - 2; i++) ++ { ++ Tcl_DecrRefCount(objv_config[i]); ++ } ++ ckfree((char*)objv_config); + #else +- argv + 2, ++ result = vtkTkRenderWidget_Configure(interp, self, argc - 2, argv + 2, TK_CONFIG_ARGV_ONLY); + #endif +- TK_CONFIG_ARGV_ONLY); + } + } + else if (!strcmp(argv[1], "GetRenderWindow")) +@@ -448,7 +480,11 @@ extern "C" + } + + // Unlock the object so it can be deleted. ++#if (TCL_MAJOR_VERSION >= 9) ++ Tcl_Release((ClientData)self); ++#else + Tk_Release((ClientData)self); ++#endif + return result; + } + } +@@ -464,16 +500,10 @@ extern "C" + // * Configures this vtkTkRenderWidget for the given arguments + extern "C" + { +- int vtkTkRenderWidget_Cmd(ClientData clientData, Tcl_Interp* interp, int argc, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- CONST84 +-#endif +- char** argv) ++ int vtkTkRenderWidget_Cmd( ++ ClientData clientData, Tcl_Interp* interp, int argc, VTK_TCL_CONST char** argv) + { +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- CONST84 +-#endif +- char* name; ++ VTK_TCL_CONST char* name; + Tk_Window main = (Tk_Window)clientData; + Tk_Window tkwin; + struct vtkTkRenderWidget* self; +@@ -515,13 +545,37 @@ extern "C" + tkwin, ExposureMask | StructureNotifyMask, vtkTkRenderWidget_EventProc, (ClientData)self); + + // Configure vtkTkRenderWidget widget +- if (vtkTkRenderWidget_Configure(interp, self, argc - 2, +-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4) +- const_cast(argv + 2), ++#if (TCL_MAJOR_VERSION >= 9) ++ // Convert string arguments to Tcl_Obj for TCL 9.0 ++ Tcl_Obj** objv_init = (Tcl_Obj**)ckalloc((argc - 2) * sizeof(Tcl_Obj*)); ++ for (int i = 0; i < argc - 2; i++) ++ { ++ objv_init[i] = Tcl_NewStringObj(argv[i + 2], -1); ++ Tcl_IncrRefCount(objv_init[i]); ++ } ++ ++ if (vtkTkRenderWidget_Configure(interp, self, argc - 2, objv_init, 0) == TCL_ERROR) ++ { ++ // Clean up before error return ++ for (int i = 0; i < argc - 2; i++) ++ { ++ Tcl_DecrRefCount(objv_init[i]); ++ } ++ ckfree((char*)objv_init); ++ ++ Tk_DestroyWindow(tkwin); ++ Tcl_DeleteCommand(interp, (char*)"vtkTkImageViewerWidget"); ++ return TCL_ERROR; ++ } ++ ++ // Clean up the Tcl_Obj array ++ for (int i = 0; i < argc - 2; i++) ++ { ++ Tcl_DecrRefCount(objv_init[i]); ++ } ++ ckfree((char*)objv_init); + #else +- argv + 2, +-#endif +- 0) == TCL_ERROR) ++ if (vtkTkRenderWidget_Configure(interp, self, argc - 2, argv + 2, 0) == TCL_ERROR) + { + Tk_DestroyWindow(tkwin); + Tcl_DeleteCommand(interp, "vtkTkRenderWidget"); +@@ -529,6 +583,7 @@ extern "C" + // free(self); + return TCL_ERROR; + } ++#endif + + Tcl_AppendResult(interp, Tk_PathName(tkwin), nullptr); + return TCL_OK; +@@ -555,7 +610,11 @@ extern "C" + + extern "C" + { ++#if (TCL_MAJOR_VERSION >= 9) ++ void vtkTkRenderWidget_Destroy(void* memPtr) ++#else + void vtkTkRenderWidget_Destroy(char* memPtr) ++#endif + { + struct vtkTkRenderWidget* self = (struct vtkTkRenderWidget*)memPtr; + diff --git a/vtk.spec b/vtk.spec index bf1457f..17b813e 100644 --- a/vtk.spec +++ b/vtk.spec @@ -5,6 +5,9 @@ # '_ZZNSt8__detail18__to_chars_10_implIjEEvPcjT_E8__digits@@LLVM_11' %global _lto_cflags %{nil} +# There is a circular dep with opencascade +%bcond bootstrap 0 + # OSMesa and X support are mutually exclusive. # TODO - buid separate OSMesa version if desired %bcond_with OSMesa @@ -18,15 +21,18 @@ %bcond_with mpich %bcond_with openmpi %else -%bcond_without mpich # No openmpi on i668 with openmpi 5 in Fedora 40+ -%if 0%{?fedora} >= 40 +# No mpi4py on i686 +%if 0%{?fedora} %ifarch %{ix86} +%bcond_with mpich %bcond_with openmpi %else +%bcond_without mpich %bcond_without openmpi %endif %else +%bcond_without mpich %bcond_without openmpi %endif %endif @@ -41,37 +47,39 @@ %bcond_without xdummy %endif -%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 +%if 0%{?fedora} || 0%{?rhel} >= 9 %bcond_without flexiblas %endif +# Try disabling LTO on ppc64le +%ifarch ppc64le +%global _lto_cflags %{nil} +%endif + # VTK currently is carrying local modifications to gl2ps %bcond_with gl2ps -# VTK currently requires unreleased fmt 8.1.0 -%bcond_with fmt +%bcond_without fmt + +#global rc rc2 Summary: The Visualization Toolkit - A high level 3D visualization library Name: vtk -Version: 9.2.6 +Version: 9.5.2%{?rc:~%{rc}} Release: %autorelease License: BSD-3-Clause -Source0: https://www.vtk.org/files/release/9.2/VTK-%{version}.tar.gz -Source1: https://www.vtk.org/files/release/9.2/VTKData-%{version}.tar.gz +%global srcver %{lua:local ver = rpm.expand('%version');ver = ver:gsub('~','.');print(ver)} +Source0: https://www.vtk.org/files/release/9.5/VTK-%{srcver}.tar.gz +Source1: https://www.vtk.org/files/release/9.5/VTKData-%{srcver}.tar.gz Source2: xorg.conf # Patch required libharu version (Fedora 33+ contains the needed VTK patches) -Patch0: vtk-libharu.patch -# Fix issue with Mayavi -Patch1: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9616.patch -# Add missing includes for gcc 13 -# https://gitlab.kitware.com/vtk/vtk/-/issues/18782 -Patch2: vtk-include.patch -# Fix segfault with Python 3.13 -# https://bugzilla.redhat.com/show_bug.cgi?id=2310520 -# Backport of https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11486 -Patch3: vtk-python3.13.patch -# Fix build -Patch4: vtk-build.patch +Patch: vtk-libharu.patch +# Tk 9.0 - based on b7c22497712be6751fbefe155533ae34d5e381f5 +Patch: vtk-tk9.patch +# always_inline fails on ppc64le +# https://gitlab.kitware.com/vtk/vtk/-/issues/19622 +# https://bugzilla.redhat.com/show_bug.cgi?id=2386242 +Patch: vtk-ppc64-no-always-inline.patch URL: https://vtk.org/ @@ -86,6 +94,7 @@ BuildRequires: java-devel Obsoletes: %{name}-java < %{version}-%{release} Obsoletes: %{name}-java-devel < %{version}-%{release} %endif +BuildRequires: alembic-devel %if %{with flexiblas} BuildRequires: flexiblas-devel %else @@ -98,15 +107,17 @@ BuildRequires: cli11-devel BuildRequires: double-conversion-devel BuildRequires: eigen3-devel BuildRequires: expat-devel +BuildRequires: fast_float-devel +BuildRequires: ffmpeg-free-devel %if %{with fmt} BuildRequires: fmt-devel >= 8.1.0 %endif +BuildRequires: freeglut-devel BuildRequires: freetype-devel BuildRequires: gdal-devel %if %{with gl2ps} BuildRequires: gl2ps-devel %endif -BuildRequires: glew-devel BuildRequires: hdf5-devel BuildRequires: json-devel BuildRequires: jsoncpp-devel @@ -115,10 +126,12 @@ BuildRequires: libGL-devel BuildRequires: libharu-devel >= 2.4.0 BuildRequires: libICE-devel BuildRequires: libjpeg-devel +BuildRequires: liblas-devel BuildRequires: libpng-devel BuildRequires: libpq-devel BuildRequires: libtheora-devel BuildRequires: libtiff-devel +BuildRequires: libxkbcommon-devel BuildRequires: libxml2-devel BuildRequires: libX11-devel BuildRequires: libXcursor-devel @@ -127,22 +140,27 @@ BuildRequires: libXt-devel BuildRequires: lz4-devel BuildRequires: mariadb-connector-c-devel %{?with_OSMesa:BuildRequires: mesa-libOSMesa-devel} -BuildRequires: motif-devel BuildRequires: netcdf-cxx-devel +%if %{without bootstrap} +BuildRequires: opencascade-devel +%endif BuildRequires: openslide-devel +# Currently does not provide OpenVDBConfig.cmake +#BuildRequires: openvdb-devel +BuildRequires: openvr-devel +BuildRequires: openxr-devel +BuildRequires: PDAL-devel BuildRequires: PEGTL-devel BuildRequires: proj-devel BuildRequires: pugixml-devel BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-qt5 -BuildRequires: cmake(Qt5) -BuildRequires: cmake(Qt5UiPlugin) -BuildRequires: cmake(Qt5X11Extras) -BuildRequires: qt5-qtwebkit-devel +BuildRequires: cmake(Qt6UiPlugin) +BuildRequires: cmake(Qt6Quick) BuildRequires: R-devel BuildRequires: sqlite-devel BuildRequires: tcl-devel BuildRequires: tk-devel +BuildRequires: unixODBC-devel BuildRequires: utf8cpp-devel BuildRequires: zlib-devel BuildRequires: chrpath @@ -187,15 +205,18 @@ Requires: double-conversion-devel%{?_isa} \ # eigen3 is noarch and header-only \ Requires: eigen3-static \ Requires: expat-devel%{?_isa} \ +# fast_float is noarch and header-only \ +Requires: fast_float-devel \ +Requires: ffmpeg-free-devel%{?_isa} \ %if %{with fmt} \ Requires: fmt-devel%{?_isa} \ %endif \ +Requires: freeglut-devel%{?_isa} \ Requires: freetype-devel%{?_isa} \ Requires: gdal-devel%{?_isa} \ %if %{with gl2ps} \ Requires: gl2ps-devel%{?_isa} \ %endif \ -Requires: glew-devel%{?_isa} \ Requires: json-devel%{?_isa} \ Requires: jsoncpp-devel%{?_isa} \ Requires: lapack-devel%{?_isa} \ @@ -203,11 +224,13 @@ Requires: libarchive-devel%{?_isa} \ Requires: libGL-devel%{?_isa} \ Requires: libharu-devel%{?_isa} >= 2.3.0-9 \ Requires: libjpeg-devel%{?_isa} \ +Requires: liblas-devel%{?_isa} \ Requires: libogg-devel%{?_isa} \ Requires: libpng-devel%{?_isa} \ Requires: libpq-devel%{?_isa} \ Requires: libtheora-devel%{?_isa} \ Requires: libtiff-devel%{?_isa} \ +Requires: libxkbcommon-devel%{?_isa} \ Requires: libxml2-devel%{?_isa} \ Requires: libX11-devel%{?_isa} \ Requires: libXcursor-devel%{?_isa} \ @@ -219,17 +242,25 @@ Requires: mariadb-connector-c-devel%{?_isa} \ Requires: mesa-libOSMesa-devel%{?_isa} \ %endif \ Requires: netcdf-cxx-devel%{?_isa} \ +%if %{without bootstrap} \ +Requires: opencascade-devel%{?_isa} \ +%endif \ Requires: openslide-devel%{?_isa} \ +#Requires: openvdb-devel%{?_isa} \ +Requires: openvr-devel%{?_isa} \ +Requires: openxr-devel%{?_isa} \ +Requires: PDAL-devel%{?_isa} \ Requires: PEGTL-devel%{?_isa} \ Requires: proj-devel%{?_isa} \ Requires: pugixml-devel%{?_isa} \ # bz #1183210 + #1183530 \ Requires: python%{python3_pkgversion}-devel \ Requires: sqlite-devel%{?_isa} \ -Requires: cmake(Qt5) \ -Requires: cmake(Qt5UiPlugin) \ -Requires: cmake(Qt5X11Extras) \ -Requires: qt5-qtwebkit-devel%{?_isa} \ +Requires: cmake(Qt6) \ +Requires: cmake(Qt6Core5Compat) \ +Requires: cmake(Qt6Quick) \ +Requires: cmake(Qt6UiPlugin) \ +Requires: unixODBC-devel%{?_isa} \ Requires: utf8cpp-devel \ Requires: zlib-devel%{?_isa} \ @@ -255,6 +286,7 @@ Provides: bundled(kwsys-systemtools) Provides: bundled(diy2) Provides: bundled(exodusII) = 2.0.0 Provides: bundled(exprtk) = 2.71 +Provides: bundled(fides) %if !%{with fmt} Provides: bundled(fmt) = 8.1.0 %endif @@ -262,10 +294,17 @@ Provides: bundled(ftgl) = 1.32 %if !%{with gl2ps} Provides: bundled(gl2ps) = 1.4.0 %endif -Provides: bundled(ioss) = 20210512 +Provides: bundled(h5part) = 1.6.6 +Provides: bundled(ioss) = 20221014 +Provides: bundled(itlib-small-vector) = 1.0.4 Provides: bundled(kissfft) +Provides: bundled(loguru) = 2.1 Provides: bundled(metaio) +Provides: bundled(scn) = 4.0.0 +# kitware library https://gitlab.kitware.com/utils/token +Provides: bundled(token) = 23.09 Provides: bundled(verdict) = 1.4.0 +Provides: bundled(viskores) = 1.0.0 Provides: bundled(vpic) Provides: bundled(xdmf2) = 2.1 Provides: bundled(xdmf3) @@ -520,18 +559,36 @@ programming languages. %prep -%autosetup -p1 -b 1 -n VTK-%{version} +%autosetup -p1 -b 1 -n VTK-%{srcver} # Remove included thirdparty sources just to be sure +# ls VTK-*/ThirdParty/*/vtk* -dl | grep ^d # TODO - diy2 - not yet packaged # TODO - exodusII - not yet packaged +# TODO - exprtk - not yet packaged +# TODO - fides - not yet packaged +# TODO - h5part - not yet packaged +# TODO - ioss - not yet packaged +# TODO - kissfft - not yet packaged +# TODO - loguru - not yet packaged +# TODO - scn - not yet packaged # TODO - verdict - not yet packaged +# TODO - viskores - not yet packaged # TODO - VPIC - not yet packaged # TODO - xdmf2 - not yet packaged # TODO - xdmf3 - not yet packaged -for x in vtk{cli11,doubleconversion,eigen,expat,%{?with_fmt:fmt,}freetype,%{?with_gl2ps:gl2ps,}glew,hdf5,jpeg,jsoncpp,libharu,libproj,libxml2,lz4,lzma,mpi4py,netcdf,ogg,pegtl,png,pugixml,sqlite,theora,tiff,utf8,zfp,zlib} +for x in vtk{cgns,cli11,doubleconversion,eigen,expat,fast_float,%{?with_fmt:fmt,}freetype,%{?with_gl2ps:gl2ps,}hdf5,jpeg,jsoncpp,libharu,libproj,libxml2,lz4,lzma,mpi4py,netcdf,nlohmannjson,ogg,pegtl,png,pugixml,sqlite,theora,tiff,utf8,zlib} do rm -r ThirdParty/*/${x} done +%ifarch %{ix86} +rm -r ThirdParty/xdmf3 +%endif + +# Remove version requirements +sed -i -e '/VERSION *"/d' ThirdParty/fast_float/CMakeLists.txt + +# Remove version requirements +sed -i -e '/VERSION *"/d' ThirdParty/fast_float/CMakeLists.txt # Remove unused KWSys items find Utilities/KWSys/vtksys/ -name \*.[ch]\* | grep -vE '^Utilities/KWSys/vtksys/([a-z].*|Configure|SharedForward|Status|String\.hxx|Base64|CommandLineArguments|Directory|DynamicLoader|Encoding|FStream|FundamentalType|Glob|MD5|Process|RegularExpression|System|SystemInformation|SystemTools)(C|CXX|UNIX)?\.' | xargs rm @@ -541,7 +598,11 @@ mkdir vtk-examples cp -a Examples vtk-examples find vtk-examples -type f | xargs chmod -R a-x - +# Requires OpenTURNS which is not packaged +# -DVTK_MODULE_ENABLE_VTK_FiltersOpenTURNS:STRING=YES +# fides and ADIOS2 require ADIOS2 which is not packaged +# ZSpace is Windows only, but is getting enabled anyway +# Xdmf3 fails on i686 - https://gitlab.kitware.com/vtk/vtk/-/issues/19402 %global vtk_cmake_options \\\ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \\\ -DCMAKE_INSTALL_DOCDIR=share/doc/%{name} \\\ @@ -549,7 +610,6 @@ find vtk-examples -type f | xargs chmod -R a-x -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \\\ -DCMAKE_INSTALL_JNILIBDIR:PATH=%{_lib}/%{name} \\\ -DCMAKE_INSTALL_LICENSEDIR:PATH=share/licenses/%{name} \\\ - -DCMAKE_INSTALL_QMLDIR:PATH=%{_lib}/qt5/qml \\\ -DVTK_CUSTOM_LIBRARY_SUFFIX="" \\\ -DVTK_VERSIONED_INSTALL:BOOL=OFF \\\ -DVTK_GROUP_ENABLE_Imaging:STRING=YES \\\ @@ -558,15 +618,34 @@ find vtk-examples -type f | xargs chmod -R a-x -DVTK_GROUP_ENABLE_StandAlone:STRING=YES \\\ -DVTK_GROUP_ENABLE_Views:STRING=YES \\\ -DVTK_GROUP_ENABLE_Web:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_AcceleratorsVTKmFilters:STRING=YES \\\ -DVTK_MODULE_ENABLE_VTK_CommonArchive:STRING=YES \\\ -DVTK_MODULE_ENABLE_VTK_DomainsMicroscopy:STRING=YES \\\ -DVTK_MODULE_ENABLE_VTK_GeovisGDAL:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_FiltersParallelStatistics:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_FiltersParallelVerdict:STRING=YES \\\ -DVTK_MODULE_ENABLE_VTK_ImagingOpenGL2:STRING=YES \\\ -DVTK_MODULE_ENABLE_VTK_InfovisBoost:STRING=YES \\\ -DVTK_MODULE_ENABLE_VTK_InfovisBoostGraphAlgorithms:STRING=YES \\\ +%if %{with bootstrap} \ + -DVTK_MODULE_ENABLE_VTK_IOOCCT:STRING=NO \\\ +%endif \ + -DVTK_MODULE_ENABLE_VTK_IOFDS:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_IOH5part:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_IOH5Rage:STRING=YES \\\ -DVTK_MODULE_ENABLE_VTK_IOMySQL:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_IOOMF:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_IOParallelLSDyna:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_IOTRUCHAS:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_IOVPIC:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_IOXdmf2:STRING=YES \\\ +%ifarch %{ix86} \ + -DVTK_MODULE_ENABLE_VTK_IOXdmf3:STRING=NO \\\ +%endif \ + -DVTK_MODULE_ENABLE_VTK_RenderingAnari:STRING=NO \\\ + -DVTK_MODULE_ENABLE_VTK_RenderingMatplotlib:STRING=YES \\\ + -DVTK_MODULE_ENABLE_VTK_RenderingVolumeAMR:STRING=YES \\\ -DVTK_PYTHON_OPTIONAL_LINK:BOOL=OFF \\\ - -DVTK_PYTHON_VERSION=3 \\\ %if %{with OSMesa} \ -DVTK_OPENGL_HAS_OSMESA:BOOL=ON \\\ %endif \ @@ -585,6 +664,12 @@ find vtk-examples -type f | xargs chmod -R a-x %endif \ -DVTK_WRAP_PYTHON:BOOL=ON \\\ -DVTK_USE_EXTERNAL=ON \\\ + -DVTK_BUILD_ALL_MODULES=ON \\\ + -DVTK_ENABLE_OSPRAY:BOOL=OFF \\\ + -DVTK_MODULE_ENABLE_VTK_fides:STRING=NO \\\ + -DVTK_MODULE_ENABLE_VTK_FiltersOpenTURNS:STRING=NO \\\ + -DVTK_MODULE_ENABLE_VTK_IOADIOS2:STRING=NO \\\ + -DVTK_MODULE_ENABLE_VTK_IOOpenVDB:STRING=NO \\\ %if !%{with fmt} \ -DVTK_MODULE_USE_EXTERNAL_VTK_fmt:BOOL=OFF \\\ %endif \ @@ -593,16 +678,18 @@ find vtk-examples -type f | xargs chmod -R a-x %endif \ -DVTK_MODULE_USE_EXTERNAL_VTK_exprtk:BOOL=OFF \\\ -DVTK_MODULE_USE_EXTERNAL_VTK_ioss:BOOL=OFF \\\ + -DVTK_MODULE_USE_EXTERNAL_VTK_scn:BOOL=OFF \\\ + -DVTK_MODULE_USE_EXTERNAL_VTK_token:BOOL=OFF \\\ -DVTK_MODULE_USE_EXTERNAL_VTK_verdict:BOOL=OFF \\\ + -DVTK_MODULE_USE_EXTERNAL_VTK_vtkviskores:BOOL=OFF \\\ -DVTK_USE_TK=ON \\\ %{?with_flexiblas:-DBLA_VENDOR=FlexiBLAS} -# https://gitlab.kitware.com/cmake/cmake/issues/17223 -#-DVTK_MODULE_ENABLE_VTK_IOPostgreSQL:STRING=YES \\\ # $mpi will be evaluated in the loops below %global _vpath_builddir %{_vendor}-%{_target_os}-build-${mpi:-serial} -%build + +%conf export CFLAGS="%{optflags} -D_UNICODE -DHAVE_UINTPTR_T" export CXXFLAGS="%{optflags} -D_UNICODE -DHAVE_UINTPTR_T" export CPPFLAGS=-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H @@ -618,29 +705,50 @@ export JAVA_TOOL_OPTIONS=-Xmx2048m %endif %endif + %cmake %{cmake_gen} \ %{vtk_cmake_options} \ -DVTK_BUILD_DOCUMENTATION:BOOL=ON \ -DVTK_BUILD_EXAMPLES:BOOL=ON \ -DVTK_BUILD_TESTING:BOOL=ON -%cmake_build -- --output-sync -%cmake_build --target DoxygenDoc + #-DVTK_MODULE_ENABLE_VTK_FiltersParallelStatistics:STRING=YES \ + export CC=mpicc export CXX=mpic++ for mpi in %{mpi_list} do module load mpi/$mpi-%{_arch} - #CMAKE_INSTALL_LIBDIR -> ARCHIVE_DESTINATION must not be an absolute path + # CMAKE_INSTALL_LIBDIR -> ARCHIVE_DESTINATION must not be an absolute path + # VTK_MODULE_ENABLE_VTK_FiltersParallelStatistics need MPI modules at the moment %cmake %{cmake_gen} \ %{vtk_cmake_options} \ -DCMAKE_PREFIX_PATH:PATH=$MPI_HOME \ -DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME \ -DCMAKE_INSTALL_LIBDIR:PATH=lib \ -DCMAKE_INSTALL_JNILIBDIR:PATH=lib/%{name} \ - -DCMAKE_INSTALL_QMLDIR:PATH=lib/qt5/qml \ + -DVTK_MODULE_ENABLE_VTK_ParallelMPI=WANT \ + -DVTK_MODULE_ENABLE_VTK_mpi=WANT \ + -DVTK_MODULE_ENABLE_VTK_RenderingParallelLIC=WANT \ + -DVTK_MODULE_ENABLE_VTK_ParallelMPI4Py=WANT \ + -DVTK_MODULE_ENABLE_VTK_FiltersParallelFlowPaths=WANT \ + -DVTK_MODULE_ENABLE_VTK_FiltersParallelGeometry=WANT \ + -DVTK_MODULE_ENABLE_VTK_FiltersParallelMPI=WANT \ + -DVTK_MODULE_ENABLE_VTK_IOMPIImage=WANT \ + -DVTK_MODULE_ENABLE_VTK_IOParallelNetCDF=WANT \ + -DVTK_MODULE_ENABLE_VTK_IOPIO=WANT \ -DVTK_USE_MPI:BOOL=ON + module purge +done + + +%build +%cmake_build -- --output-sync +%cmake_build --target DoxygenDoc +for mpi in %{mpi_list} +do + module load mpi/$mpi-%{_arch} %cmake_build -- --output-sync module purge done @@ -727,6 +835,8 @@ rm -v %{buildroot}/%{_libdir}/openmpi/lib/cmake/%{name}/patches/99/FindHDF5.cmak export QA_RPATHS=18 +# Test take a very long time on s390x because many tests hit the default 25 minute timeout +%ifnarch s390x %check cp %SOURCE2 . %if %{with xdummy} @@ -744,11 +854,14 @@ export FLEXIBLAS=netlib kill %1 || : cat xorg.log %endif +%endif %files -f %{_vendor}-%{_target_os}-build-serial/libs.list %license %{_defaultlicensedir}/%{name}/ %doc README.md _docs/Wrapping +%{_datadir}/vr_actions/ +%{_datadir}/xr_actions/ %files devel %doc Utilities/Upgrading @@ -756,6 +869,8 @@ cat xorg.log %{_bindir}/vtkProbeOpenGLVersion %{_bindir}/vtkWrapHierarchy %{_bindir}/vtkWrapJava +%{_bindir}/vtkWrapSerDes + %{_includedir}/%{name} %{_libdir}/*.so %{_libdir}/cmake/%{name}/ @@ -780,18 +895,20 @@ cat xorg.log %files qt %{_libdir}/lib*Qt*.so.* %exclude %{_libdir}/*Python*.so.* -%{_libdir}/qt5/qml/* %if %{with mpich} %files mpich -f %{_vendor}-%{_target_os}-build-mpich/libs.list %license %{_defaultlicensedir}/%{name}-mpich/ %doc README.md _docs/Wrapping +%{_libdir}/mpich/share/vr_actions/ +%{_libdir}/mpich/share/xr_actions/ %files mpich-devel %{_libdir}/mpich/bin/vtkParseJava %{_libdir}/mpich/bin/vtkProbeOpenGLVersion %{_libdir}/mpich/bin/vtkWrapHierarchy %{_libdir}/mpich/bin/vtkWrapJava +%{_libdir}/mpich/bin/vtkWrapSerDes %{_libdir}/mpich/include/ %{_libdir}/mpich/lib/*.so %{_libdir}/mpich/lib/cmake/ @@ -817,19 +934,21 @@ cat xorg.log %files mpich-qt %{_libdir}/mpich/lib/lib*Qt*.so.* %exclude %{_libdir}/mpich/lib/*Python*.so.* -%{_libdir}/mpich/lib/qt5/ %endif %if %{with openmpi} %files openmpi -f %{_vendor}-%{_target_os}-build-openmpi/libs.list %license %{_defaultlicensedir}/%{name}-openmpi/ %doc README.md _docs/Wrapping +%{_libdir}/openmpi/share/vr_actions/ +%{_libdir}/openmpi/share/xr_actions/ %files openmpi-devel %{_libdir}/openmpi/bin/vtkParseJava %{_libdir}/openmpi/bin/vtkProbeOpenGLVersion %{_libdir}/openmpi/bin/vtkWrapHierarchy %{_libdir}/openmpi/bin/vtkWrapJava +%{_libdir}/openmpi/bin/vtkWrapSerDes %{_libdir}/openmpi/include/ %{_libdir}/openmpi/lib/*.so %{_libdir}/openmpi/lib/cmake/ @@ -855,7 +974,6 @@ cat xorg.log %files openmpi-qt %{_libdir}/openmpi/lib/lib*Qt*.so.* %exclude %{_libdir}/openmpi/lib/*Python*.so.* -%{_libdir}/openmpi/lib/qt5/ %endif %files data