Skip to content

Commit

Permalink
#64 organise vtk patches
Browse files Browse the repository at this point in the history
  • Loading branch information
kwabenantim committed May 7, 2024
1 parent dd29a54 commit 7447fb0
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 8 deletions.
19 changes: 11 additions & 8 deletions scripts/install_vtk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,21 @@ fi
# VTK 7.1.x patches: https://sources.debian.org/patches/vtk7/7.1.1%2Bdfsg2-10.2/
if [[ ${major} -eq 7 && ${minor} -eq 1 ]]; then # VTK == 7.1.x
cd ${src_dir}
patch -t -p1 < ${script_dir}/patches/vtk7.1.patch
patch -t -p1 < ${script_dir}/patches/vtk/7.1/vtk7.1.patch
fi

# VTK 8.2.x patches: https://sources.debian.org/patches/vtk7/7.1.1%2Bdfsg2-10.2/
if [[ ${major} -eq 8 && ${minor} -eq 2 ]]; then # VTK == 8.2.x
cd ${src_dir}
patch -t -p1 < ${script_dir}/patches/vtk8.2.patch
patch -t -p1 < ${script_dir}/patches/vtk/8.2/vtk8.2.patch
fi

# VTK 9.0.x patches: https://sources.debian.org/patches/vtk9/9.0.1%2Bdfsg1-8/
if [[ ${major} -eq 9 && ${minor} -eq 0 ]]; then # VTK == 9.0.x
cd ${src_dir}
patch -t -p1 < ${script_dir}/patches/vtk9.0-fix-limits.patch
patch -t -p1 < ${script_dir}/patches/vtk/9.0/50_fix_python-modules_path.patch
patch -t -p1 < ${script_dir}/patches/vtk/9.0/70_fix_python_numpy_warning.patch
patch -t -p1 < ${script_dir}/patches/vtk/9.0/fix-limits.patch
fi

# VTK 9.1.x patches: https://sources.debian.org/patches/vtk9/9.1.0%2Breally9.1.0%2Bdfsg2-7.1/
Expand All @@ -137,10 +139,10 @@ if [[ ${major} -eq 9 && ${minor} -eq 1 ]]; then # VTK == 9.1.x
patch -t -p1 < ${script_dir}/patches/vtk/9.1/gcc-13.patch
fi

# VTK 9.2.x patches: https://sources.debian.org/patches/vtk9/9.1.0%2Breally9.1.0%2Bdfsg2-7.1/
# VTK 9.2.x patches
if [[ ${major} -eq 9 && ${minor} -eq 2 ]]; then # VTK == 9.2.x
cd ${src_dir}
patch -t -p1 < ${script_dir}/patches/vtk/9.1/gcc-13.patch
patch -t -p1 < ${script_dir}/patches/vtk/9.2/gcc-13.patch
fi

# Build and install
Expand All @@ -158,12 +160,13 @@ cmake \
-DBUILD_TESTING=OFF \
-DBUILD_DOCUMENTATION=OFF \
-DVTK_INSTALL_NO_DOCUMENTATION=ON \
-DVTK_WRAP_PYTHON=ON \
-DVTK_ENABLE_VTKPYTHON=OFF \
-DVTK_PYTHON_VERSION=3 \
-DVTK_WRAP_PYTHON=ON \
-DMPIEXEC="$(which mpiexec)" \
-DVTK_Group_MPI=ON \
-DVTK_USE_MPI=ON \
-DVTK_Group_MPI=ON \
-DMPIEXEC="$(which mpiexec)" \
-DVTK_MODULE_USE_EXTERNAL_VTK_mpi4py=ON \
${src_dir} && \
make -j ${parallel} && \
make install
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions scripts/patches/vtk/9.0/50_fix_python-modules_path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Description: Fix path for the installation of python modules
Author: Anton Gladky <[email protected]>
Last-Update: 2020-11-06

Index: vtk9-9.0.1+dfsg1/CMake/vtkModuleWrapPython.cmake
===================================================================
--- vtk9-9.0.1+dfsg1.orig/CMake/vtkModuleWrapPython.cmake
+++ vtk9-9.0.1+dfsg1/CMake/vtkModuleWrapPython.cmake
@@ -84,7 +84,7 @@ function (vtk_module_python_default_dest
"for Python modules.")
set(_vtk_python_version_suffix)
endif ()
- set(destination "${CMAKE_INSTALL_LIBDIR}/python${_vtk_python_version_suffix}/site-packages")
+ set(destination "lib/python3/dist-packages")
endif ()

set("${var}" "${destination}" PARENT_SCOPE)
Index: vtk9-9.0.1+dfsg1/Utilities/Python/CMakeLists.txt
===================================================================
--- vtk9-9.0.1+dfsg1.orig/Utilities/Python/CMakeLists.txt
+++ vtk9-9.0.1+dfsg1/Utilities/Python/CMakeLists.txt
@@ -77,7 +77,7 @@ if (NOT VTK_PYTHON_SITE_PACKAGES_SUFFIX)
set(VTK_PYTHON_SITE_PACKAGES_SUFFIX "Lib/site-packages")
else ()
set(VTK_PYTHON_SITE_PACKAGES_SUFFIX
- "python${vtk_python_version_pair}/site-packages")
+ "python3/dist-packages")
endif ()
endif ()

15 changes: 15 additions & 0 deletions scripts/patches/vtk/9.0/70_fix_python_numpy_warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Description: Fix python numpy warning
Author: Anton Gladky <[email protected]>
Last-Update: 2020-11-09

--- vtk9-9.0.1+dfsg1.orig/Wrapping/Python/vtkmodules/numpy_interface/algorithms.py
+++ vtk9-9.0.1+dfsg1/Wrapping/Python/vtkmodules/numpy_interface/algorithms.py
@@ -206,7 +206,7 @@ def _global_func(impl, array, axis, cont
return dsa.NoneArray;

if res is dsa.NoneArray:
- if max_dims is 1:
+ if max_dims == 1:
# Weird trick to make the array look like a scalar
max_dims = ()
res = numpy.empty(max_dims)
File renamed without changes.
30 changes: 30 additions & 0 deletions scripts/patches/vtk/9.2/gcc-13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 1233ceec268d5366c66f5e79786ec784042b591b Mon Sep 17 00:00:00 2001
From: Laurent Rineau <[email protected]>
Date: Tue, 17 Jan 2023 16:18:53 +0100
Subject: Add #include <cstdint> to compile with gcc13
Origin: upstream, https://gitlab.kitware.com/vtk/vtk/-/commit/1233ceec268d5366c66f5e79786ec784042b591b

The `vtkSEPReader` was introduced by MRs !4909 (from my former
collaborator Maxime) and !4938. Then it was highly modified by
!7516. The later MR is the one that introduced the uses of
`std::uint8_t` and `std::uint32_t`.

Those types needs the inclusion of `<cstdint>`.
---
IO/Image/vtkSEPReader.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- vtk9.orig/IO/Image/vtkSEPReader.h
+++ vtk9/IO/Image/vtkSEPReader.h
@@ -25,8 +25,9 @@
#include "vtkImageAlgorithm.h"
#include "vtkNew.h" // for ivars

-#include <array> // for std::array
-#include <string> // for std::string
+#include <array> // for std::array
+#include <cstdint> // for std::uint8_t and std::uint32_t
+#include <string> // for std::string

namespace details
{

0 comments on commit 7447fb0

Please sign in to comment.