Add upstream patch to fix build on armhf
authorJochen Sprickerhof <git@jochen.sprickerhof.de>
Fri, 19 Aug 2022 11:40:55 +0000 (13:40 +0200)
committerJochen Sprickerhof <git@jochen.sprickerhof.de>
Fri, 19 Aug 2022 11:41:36 +0000 (13:41 +0200)
As seen on

https://launchpad.net/ubuntu/+source/pcl/1.12.1+dfsg-4/+build/24168829

debian/patches/0009-Repair-sparse_matrix.hpp.patch [new file with mode: 0644]
debian/patches/0010-Fix-variable-name-in-poisson4.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0009-Repair-sparse_matrix.hpp.patch b/debian/patches/0009-Repair-sparse_matrix.hpp.patch
new file mode 100644 (file)
index 0000000..d1097c5
--- /dev/null
@@ -0,0 +1,57 @@
+From: Thomas Dickerson <elfprince13@gmail.com>
+Date: Thu, 12 May 2022 14:28:41 -0400
+Subject: Repair sparse_matrix.hpp
+
+Unclear why nobody has noticed for a decade that this code was just totally uncompilable. `SparseMatrix` does not have methods `Columns()` or `Rows()`, and `m_ppElements[i]` is a pointer so can't possibly have anything called with `.`.
+---
+ .../pcl/surface/3rdparty/poisson4/sparse_matrix.hpp    | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
+index e6564cd..02c2db5 100644
+--- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
++++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
+@@ -250,9 +250,9 @@ namespace pcl
+     template<class T>
+     SparseMatrix<T>& SparseMatrix<T>::operator *= (const T& V)
+     {
+-      for (int i=0; i<this->Rows(); i++)
++      for (int i=0; i<rows; i++)
+       {
+-        for(int ii=0;ii<m_ppElements[i].size();i++){m_ppElements[i][ii].Value*=V;}
++        for(int ii=0;ii<rowSizes[i];i++){m_ppElements[i][ii].Value*=V;}
+       }
+       return *this;
+     }
+@@ -260,12 +260,12 @@ namespace pcl
+     template<class T>
+     SparseMatrix<T> SparseMatrix<T>::Multiply( const SparseMatrix<T>& M ) const
+     {
+-      SparseMatrix<T> R( this->Rows(), M.Columns() );
+-      for(int i=0; i<R.Rows(); i++){
+-        for(int ii=0;ii<m_ppElements[i].size();ii++){
++      SparseMatrix<T> R( rows, M._maxEntriesPerRow );
++      for(int i=0; i<R.rows; i++){
++        for(int ii=0;ii<rowSizes[i];ii++){
+           int N=m_ppElements[i][ii].N;
+           T Value=m_ppElements[i][ii].Value;
+-          for(int jj=0;jj<M.m_ppElements[N].size();jj++){
++          for(int jj=0;jj<M.rowSizes[N];jj++){
+             R(i,M.m_ppElements[N][jj].N) += Value * M.m_ppElements[N][jj].Value;
+           }
+         }
+@@ -319,11 +319,11 @@ namespace pcl
+     template<class T>
+     SparseMatrix<T> SparseMatrix<T>::Transpose() const
+     {
+-      SparseMatrix<T> M( this->Columns(), this->Rows() );
++      SparseMatrix<T> M( _maxEntriesPerRow, rows );
+-      for (int i=0; i<this->Rows(); i++)
++      for (int i=0; i<rows; i++)
+       {
+-        for(int ii=0;ii<m_ppElements[i].size();ii++){
++        for(int ii=0;ii<rowSizes[i];ii++){
+           M(m_ppElements[i][ii].N,i) = m_ppElements[i][ii].Value;
+         }
+       }
diff --git a/debian/patches/0010-Fix-variable-name-in-poisson4.patch b/debian/patches/0010-Fix-variable-name-in-poisson4.patch
new file mode 100644 (file)
index 0000000..e11006e
--- /dev/null
@@ -0,0 +1,21 @@
+From: Markus Vieth <39675748+mvieth@users.noreply.github.com>
+Date: Fri, 20 May 2022 14:47:52 +0200
+Subject: Fix variable name in poisson4
+
+---
+ surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
+index 02c2db5..24f0a54 100644
+--- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
++++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
+@@ -252,7 +252,7 @@ namespace pcl
+     {
+       for (int i=0; i<rows; i++)
+       {
+-        for(int ii=0;ii<rowSizes[i];i++){m_ppElements[i][ii].Value*=V;}
++        for(int ii=0;ii<rowSizes[i];ii++){m_ppElements[i][ii].Value*=V;}
+       }
+       return *this;
+     }
index 31a9c2f1b666c7ea9eb8f164ad5ba834e75b773b..474450b7ef5f7bd2de359f0d67b226312ff929c4 100644 (file)
@@ -6,3 +6,5 @@
 0007-Adopt-unit-tests-for-arm64-and-ppc64el.patch
 0007-Drop-PCL_SOURCES_TREE-from-installation-cmake.patch
 0008-Don-t-require-boost-in-pkg-config.patch
+0009-Repair-sparse_matrix.hpp.patch
+0010-Fix-variable-name-in-poisson4.patch