From efd55d0e530cbc9d890ced013cd3ee218128570b Mon Sep 17 00:00:00 2001 From: icysky Date: Mon, 20 Jan 2025 20:37:19 +0800 Subject: [PATCH] pcl: fix boost version requirement (#6163) --- .../correspondence_rejection_features.patch | 17 ++++++++ .../p/pcl/patches/1.14.1/octree_poisson.patch | 43 +++++++++++++++++++ .../p/pcl/patches/1.14.1/sparse_matrix.patch | 34 +++++++++++++++ packages/p/pcl/xmake.lua | 16 +++++-- 4 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 packages/p/pcl/patches/1.14.1/correspondence_rejection_features.patch create mode 100644 packages/p/pcl/patches/1.14.1/octree_poisson.patch create mode 100644 packages/p/pcl/patches/1.14.1/sparse_matrix.patch diff --git a/packages/p/pcl/patches/1.14.1/correspondence_rejection_features.patch b/packages/p/pcl/patches/1.14.1/correspondence_rejection_features.patch new file mode 100644 index 00000000000..dac3b2558a3 --- /dev/null +++ b/packages/p/pcl/patches/1.14.1/correspondence_rejection_features.patch @@ -0,0 +1,17 @@ +diff --git a/registration/include/pcl/registration/correspondence_rejection_features.h b/registration/include/pcl/registration/correspondence_rejection_features.h +index 44835c379..f3bab8fef 100644 +--- a/registration/include/pcl/registration/correspondence_rejection_features.h ++++ b/registration/include/pcl/registration/correspondence_rejection_features.h +@@ -269,9 +269,9 @@ protected: + // Check if the representations are valid + if (!feature_representation_->isValid(feat_src) || + !feature_representation_->isValid(feat_tgt)) { +- PCL_ERROR("[pcl::registration::%s::getCorrespondenceScore] Invalid feature " +- "representation given!\n", +- this->getClassName().c_str()); ++ PCL_ERROR( ++ "[pcl::registration::CorrespondenceRejectorFeatures::FeatureContainer::" ++ "getCorrespondenceScore] Invalid feature representation given!\n"); + return (std::numeric_limits::max()); + } + diff --git a/packages/p/pcl/patches/1.14.1/octree_poisson.patch b/packages/p/pcl/patches/1.14.1/octree_poisson.patch new file mode 100644 index 00000000000..66b30ff3c99 --- /dev/null +++ b/packages/p/pcl/patches/1.14.1/octree_poisson.patch @@ -0,0 +1,43 @@ +diff --git a/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp b/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp +index 7ed8aaf9d..e7f45b650 100644 +--- a/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp ++++ b/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp +@@ -746,7 +746,10 @@ namespace pcl + Real temp,dist2; + if(!children){return this;} + for(int i=0;i child_center; ++ Real child_width; ++ children[i].centerAndWidth(child_center, child_width); ++ temp=SquareDistance(child_center,p); + if(!i || tempoffset[i] = node.offset[i];} ++ for(i=0;ioff[i] = node.off[i];} + if(node.children){ + initChildren(); + for(i=0;i + int OctNode::CompareForwardDepths(const void* v1,const void* v2){ +- return ((const OctNode*)v1)->depth-((const OctNode*)v2)->depth; ++ return ((const OctNode*)v1)->depth()-((const OctNode*)v2)->depth(); + } + + template< class NodeData , class Real > +@@ -874,7 +877,7 @@ namespace pcl + + template + int OctNode::CompareBackwardDepths(const void* v1,const void* v2){ +- return ((const OctNode*)v2)->depth-((const OctNode*)v1)->depth; ++ return ((const OctNode*)v2)->depth()-((const OctNode*)v1)->depth(); + } + + template diff --git a/packages/p/pcl/patches/1.14.1/sparse_matrix.patch b/packages/p/pcl/patches/1.14.1/sparse_matrix.patch new file mode 100644 index 00000000000..f0bf3b0f351 --- /dev/null +++ b/packages/p/pcl/patches/1.14.1/sparse_matrix.patch @@ -0,0 +1,34 @@ +diff --git a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp +index 24f0a5402..5e54ac786 100644 +--- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp ++++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp +@@ -228,14 +228,18 @@ namespace pcl + template + void SparseMatrix::SetZero() + { +- Resize(this->m_N, this->m_M); ++ // copied from operator *= ++ for (int i=0; i + void SparseMatrix::SetIdentity() + { + SetZero(); +- for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++) ++ for(int ij=0; ij < std::min( rows, _maxEntriesPerRow ); ij++) + (*this)(ij,ij) = T(1); + } + +@@ -388,7 +392,7 @@ namespace pcl + T alpha,beta,rDotR; + int i; + +- solution.Resize(M.Columns()); ++ solution.Resize(bb.Dimensions()); + solution.SetZero(); + + d=r=bb; diff --git a/packages/p/pcl/xmake.lua b/packages/p/pcl/xmake.lua index a9e6a1d62c8..f6be8b23544 100644 --- a/packages/p/pcl/xmake.lua +++ b/packages/p/pcl/xmake.lua @@ -9,21 +9,31 @@ package("pcl") add_versions("1.12.0", "21dfa9a268de9675c1f94d54d9402e4e02120a0aa4215d064436c52b7d5bd48f") add_versions("1.12.1", "dc0ac26f094eafa7b26c3653838494cc0a012bd1bdc1f1b0dc79b16c2de0125a") add_versions("1.14.0", "de297b929eafcb93747f12f98a196efddf3d55e4edf1b6729018b436d5be594d") + add_versions("1.14.1", "5dc5e09509644f703de9a3fb76d99ab2cc67ef53eaf5637db2c6c8b933b28af6") + + add_patches("1.14.1", "patches/1.14.1/octree_poisson.patch", "5423a29bbb3f51bb66dca3bcb7851e037944cc33e62e816a8a8d2d00b0bdc964") + add_patches("1.14.1", "patches/1.14.1/sparse_matrix.patch", "90b20730956104f3ed61fc2d4de156401d0c470257def7ac4e1e2ec0a9456442") + add_patches("1.14.1", "patches/1.14.1/correspondence_rejection_features.patch", "20bc608eb0bd7892a6c5fc34773fd7479021d6f5f2e6f311c17b5fe60ddff6fe") add_configs("vtk", {description = "Build with vtk.", default = false, type = "boolean"}) add_configs("cuda", {description = "Build with cuda.", default = false, type = "boolean"}) add_deps("cmake") - add_deps("boost", {configs = {filesystem = true, serialization = true, date_time = true, iostreams = true, system = true}}) - add_deps("eigen", "boost", "lz4", "flann", "zlib", "libpng", "qhull", "glew") + add_deps("eigen", "lz4", "flann", "zlib", "libpng", "qhull", "glew") on_load("windows", "linux", "macosx", function (package) package:add("includedirs", "include/pcl-" .. package:version():major() .. "." .. package:version():minor()) + + if package:version():le("1.14.1") then + package:add("deps", "boost", {version = "1.85.0", configs = {filesystem = true, serialization = true, date_time = true, iostreams = true, system = true, thread = true, graph = true}}) + else + package:add("deps", "boost", {configs = {asio = true, filesystem = true, serialization = true, date_time = true, iostreams = true, system = true, thread = true, graph = true}}) + end + if package:config("vtk") then package:add("deps", "vtk") end if package:config("cuda") then package:add("deps", "cuda", {system = true}) - package:add("deps", "optix", {system = true}) end end)