diff --git a/pcl-1.12.0-fedora.patch b/pcl-1.12.0-fedora.patch new file mode 100644 index 0000000000000000000000000000000000000000..7433e26837186eed35c81e225c014c1bbacc7d51 --- /dev/null +++ b/pcl-1.12.0-fedora.patch @@ -0,0 +1,12 @@ +diff -up ./PCLConfig.cmake.in.fedora ./PCLConfig.cmake.in +--- ./PCLConfig.cmake.in.fedora 2020-05-29 17:48:55.884924391 -0400 ++++ ./PCLConfig.cmake.in 2020-05-29 17:50:25.211139677 -0400 +@@ -398,7 +398,7 @@ if(WIN32 AND NOT MINGW) + endif() + else() + # PCLConfig.cmake is installed to PCL_ROOT/share/pcl-x.y +- get_filename_component(PCL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) ++ set(PCL_ROOT "@CMAKE_INSTALL_PREFIX@") + endif() + + # check whether PCLConfig.cmake is found into a PCL installation or in a build tree diff --git a/pcl-1.12.0-metslib.patch b/pcl-1.12.0-metslib.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f95d1cb50db3c6ac1adf72d82df40a2204608f7 --- /dev/null +++ b/pcl-1.12.0-metslib.patch @@ -0,0 +1,23 @@ +diff -up ./recognition/include/pcl/recognition/hv/hv_go.h.metslib ./recognition/include/pcl/recognition/hv/hv_go.h +--- ./recognition/include/pcl/recognition/hv/hv_go.h.metslib 2020-05-29 17:47:21.343600510 -0400 ++++ ./recognition/include/pcl/recognition/hv/hv_go.h 2020-05-29 17:48:12.185237506 -0400 +@@ -20,6 +20,6 @@ + #include + #include +-#include ++#include + #include + + #include +diff -up ./recognition/include/pcl/recognition/impl/hv/hv_go.hpp.metslib ./recognition/include/pcl/recognition/impl/hv/hv_go.hpp +--- ./recognition/include/pcl/recognition/impl/hv/hv_go.hpp.metslib 2020-05-11 04:59:26.000000000 -0400 ++++ ./recognition/include/pcl/recognition/impl/hv/hv_go.hpp 2020-05-29 17:47:21.343600510 -0400 +@@ -453,7 +453,7 @@ void pcl::GlobalHypothesesVerification sa (model, best_recorder, neigh, noimprove, linear_cooling, initial_temp_, 1e-7, 2); +- sa.setApplyAndEvaluate(true); ++ //sa.setApplyAndEvaluate(true); + + { + pcl::ScopeTime t ("SA search..."); diff --git a/pcl-1.12.1-boost.patch b/pcl-1.12.1-boost.patch new file mode 100644 index 0000000000000000000000000000000000000000..446dfd9387027452887b1e3a8a595052840e92e0 --- /dev/null +++ b/pcl-1.12.1-boost.patch @@ -0,0 +1,20 @@ +--- pcl-pcl-1.12.1/io/CMakeLists.txt_org 2023-05-01 07:11:10.766982288 +0800 ++++ pcl-pcl-1.12.1/io/CMakeLists.txt 2023-05-01 07:11:29.331003919 +0800 +@@ -1,7 +1,7 @@ + set(SUBSYS_NAME io) + set(SUBSYS_DESC "Point cloud IO library") + set(SUBSYS_DEPS common octree) +-set(SUBSYS_EXT_DEPS boost eigen) ++set(SUBSYS_EXT_DEPS eigen) + + set(build TRUE) + PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ON) +@@ -415,7 +415,7 @@ + target_link_libraries("${LIB_NAME}" ${PCAP_LIBRARIES}) + endif() + +-set(EXT_DEPS boost eigen3) ++set(EXT_DEPS eigen3) + + if(WITH_OPENNI) + list(APPEND EXT_DEPS libopenni) diff --git a/pcl-1.12.1.tar.gz b/pcl-1.12.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9353b743e7442e11a232222b383c0b7b1cc174e0 Binary files /dev/null and b/pcl-1.12.1.tar.gz differ diff --git a/pcl.spec b/pcl.spec new file mode 100644 index 0000000000000000000000000000000000000000..f66f236926c444c36cea4d31bb57dfd7d7079277 --- /dev/null +++ b/pcl.spec @@ -0,0 +1,162 @@ +%global apiversion 1.12 +%global soversion 1.12 + +Name: pcl +Version: 1.12.1 +Release: 1 +Summary: Library for point cloud processing +License: BSD +URL: http://pointclouds.org/ + +Source0: %{name}-%{version}.tar.gz +# Look for external metslib, not upstream +Patch0: %{name}-1.12.0-metslib.patch +# Patch for PCLConfig.cmake to find pcl +Patch1: %{name}-1.12.0-fedora.patch +Patch2: %{name}-1.12.1-boost.patch + +# For plain building +BuildRequires: cmake, gcc-c++, boost-devel +# Documentation +#BuildRequires: doxygen, graphviz, /usr/bin/sphinx-build +BuildRequires: doxygen, graphviz + +# mandatory +#BuildRequires: eigen3-static, flann-devel, vtk-devel, gl2ps-devel, hdf5-devel, libxml2-devel, netcdf-cxx-devel, jsoncpp-devel, metslib-static, libXext-devel +BuildRequires: eigen3-static, flann-devel, gl2ps-devel, hdf5-devel, libxml2-devel, netcdf-devel, jsoncpp-devel, metslib-static, libXext-devel, flann-static +BuildRequires: texlive-latex + +# To fix Imported target "VTK::Java" includes non-existent path "/usr/lib/jvm/java/include" in its INTERFACE_INCLUDE_DIRECTORIES +%ifarch %{java_arches} +BuildRequires: java-devel +%endif + +# optional +BuildRequires: qt5-qtbase-devel, qhull-devel, libusbx-devel, gtest-devel, qt5-qtwebkit-devel +%ifarch %{ix86} x86_64 +BuildRequires: openni-devel +%endif + +%description +The Point Cloud Library (or PCL) is a large scale, open project for point +cloud processing. + +The PCL framework contains numerous state-of-the art algorithms including +filtering, feature estimation, surface reconstruction, registration, model +fitting and segmentation. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} +Requires: libusb-devel +Requires: flann-static +Requires: pkgconfig +#Requires: eigen3-devel, qhull-devel, flann-devel, vtk-devel +Requires: eigen3-devel, qhull-devel, flann-devel +%ifarch %{ix86} x86_64 +Requires: openni-devel +%endif + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package tools +Summary: Point cloud tools and viewers +Requires: %{name} = %{version}-%{release} + +%description tools +This package contains tools for point cloud file processing and viewers +for point cloud files and live Kinect data. + + +%package doc +Summary: PCL API documentation +BuildArch: noarch + +%description doc +The %{name}-doc package contains API documentation for the Point Cloud +Library. + + +%prep +%setup -qn %{name}-%{name}-%{version} +%patch0 -p1 -b .metslib +%patch1 -p0 -b .fedora +%patch2 -p1 -b .boost + +# Just to make it obvious we're not using any of these +rm -fr recognition/include/pcl/recognition/3rdparty/metslib +rm -fr surface/src/3rdparty/opennurbs +rm -rf surface/include/pcl/surface/3rdparty/opennurbs + +%build +# try to reduce memory usage of compile process (can cause OOM errors +# esp. on ARM builders) +%global optflags %(echo %{optflags} | sed -e 's/-g /-g1 /' -e 's/-pipe //' -e's/-ffat-lto-objects/-fno-fat-lto-objects/') +mkdir build && cd build +%cmake \ + -DCMAKE_BUILD_TYPE=None \ + -DWITH_DOCS=ON \ + -DWITH_CUDA=OFF \ + -DWITH_VTK=OFF \ + -DWITH_TUTORIALS=ON \ + -DBUILD_apps=ON \ + -DBUILD_global_tests=OFF \ + -DOPENNI_INCLUDE_DIR:PATH=/usr/include/ni \ + -DLIB_INSTALL_DIR=%{_lib} \ +%ifarch x86_64 + -DPCL_ENABLE_SSE=ON \ +%else + -DPCL_ENABLE_SSE=OFF \ +%endif + -DPCL_PKGCONFIG_SUFFIX:STRING="" \ + -DBUILD_documentation=ON \ + -DCMAKE_SKIP_RPATH=ON \ + .. + +%make_build + +%install +cd build +%make_install + +# Just a dummy test +rm -f $RPM_BUILD_ROOT%{_bindir}/timed_trigger_test + +mkdir -p $RPM_BUILD_ROOT%{_libdir}/cmake/pcl +mv $RPM_BUILD_ROOT%{_datadir}/%{name}-*/*.cmake $RPM_BUILD_ROOT%{_libdir}/cmake/pcl/ +mv $RPM_BUILD_ROOT%{_datadir}/%{name}-*/Modules $RPM_BUILD_ROOT%{_libdir}/cmake/pcl/ + +%check +cd build +make test || true + +%ldconfig_scriptlets + + +%files +%license LICENSE.txt +%doc AUTHORS.txt +%{_libdir}/*.so.%{version} +%{_libdir}/*.so.%{soversion} +%{_datadir}/%{name}-%{apiversion} + +%files devel +%{_includedir}/* +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc +%{_libdir}/cmake/pcl + +%files tools +%{_bindir}/pcl_* +# There are no .desktop files because the GUI tools are rather examples +# to understand a particular feature of PCL. + +%files doc +%doc %{_datadir}/doc + +%changelog +* Fri Apr 28 2023 will_niutao - 1.12.1-1 +- init package for openEuler