Skip to content

Commit

Permalink
pcl: upgrade to 1.10.1
Browse files Browse the repository at this point in the history
* should resolve the issues with memory usage during the build:
  PointCloudLibrary/pcl#2284 (comment)
  this allows us to drop PARALLEL_MAKE restriction

* recipes in older melodic (around May 2020) weren't compatible with 1.10 and newer pcl,
  e.g. following recipes were failing:
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/robosense/rslidar-driver_1.0.2.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/cartographer-ros/cartographer-ros_1.0.0-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/ar-track-alvar/ar-track-alvar_0.7.1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/ainstein-radar/ainstein-radar-filters_2.0.2-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/sick-scan/sick-scan_1.4.2-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/ibeo-lux/ibeo-lux_2.0.1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/grid-map/grid-map-pcl_1.6.2-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/mcl-3dl/mcl-3dl_0.2.1-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/jsk-common/image-view2_2.2.10.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/robot-self-filter/robot-self-filter_0.1.31.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/grid-map/grid-map-sdf_1.6.2-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/neonavigation/safety-limiter_0.8.1-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/ouster/ouster-driver_0.1.7.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/neonavigation/map-organizer_0.8.1-1.bb:do_compile
  ros1-melodic-gatesgarth/meta-ros/meta-ros1-melodic/generated-recipes/multi-object-tracking-lidar/multi-object-tracking-lidar_1.0.2-1.bb:do_compile

  with errors like:

$ grep error: log.world.pcl-1.10 | sed 's/^.*:.*:.*: error:/error:/g' | sort | uniq -c | sort -n
      3 error: no match for call to '(pcl::detail::CopyPointHelper<mcl_3dl::PointXYZIL, mcl_3dl::PointXYZIL, void>) (const mcl_3dl::PointXYZIL&, mcl_3dl::PointXYZIL&)'
      3 error: no match for call to '(pcl::detail::CopyPointHelper<pcl::PointXYZ, mcl_3dl::PointXYZIL, void>) (const pcl::PointXYZ&, mcl_3dl::PointXYZIL&)'
      3 error: no match for call to '(pcl::detail::CopyPointHelper<pcl::PointXYZ, pcl::PointXYZ, void>) (const pcl::PointXYZ&, pcl::PointXYZ&)'
      3 error: no match for call to '(pcl::detail::CopyPointHelper<pcl::PointXYZI, mcl_3dl::PointXYZIL, void>) (const pcl::PointXYZI&, mcl_3dl::PointXYZIL&)'
      3 error: no match for call to '(pcl::getFieldIndex<mcl_3dl::PointXYZIL>::<lambda(const int&)>) (const pcl::PCLPointField&)'
      3 error: no match for call to '(pcl::getFieldIndex<pcl::PointXYZ>::<lambda(const int&)>) (const pcl::PCLPointField&)'
      6 error: no match for call to '(pcl::detail::CopyPointHelper<pcl::PointXYZRGB, pcl::PointXYZRGB, void>) (const pcl::PointXYZRGB&, pcl::PointXYZRGB&)'
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::azimuth>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::elevation>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::range>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::snr>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::speed>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<PointRadarTarget, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointOS1, pcl::fields::intensity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointOS1, pcl::fields::reflectivity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointOS1, pcl::fields::ring>::decomposed' {aka 'pcl::traits::decomposeArray<unsigned char>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointOS1, pcl::fields::t>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointOS1, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointOS1, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointOS1, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIF, pcl::fields::intensity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIF, pcl::fields::reflectivity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIF, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIF, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIF, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIFN, pcl::fields::intensity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIFN, pcl::fields::noise>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIFN, pcl::fields::reflectivity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIFN, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIFN, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIFN, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIR, pcl::fields::intensity>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIR, pcl::fields::ring>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIR, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIR, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIR, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRF, pcl::fields::intensity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRF, pcl::fields::reflectivity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRF, pcl::fields::ring>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRF, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRF, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRF, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRFN, pcl::fields::intensity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRFN, pcl::fields::noise>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRFN, pcl::fields::reflectivity>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRFN, pcl::fields::ring>::decomposed' {aka 'pcl::traits::decomposeArray<short unsigned int>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRFN, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRFN, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     12 error: 'type' is not a member of 'pcl::traits::datatype<ouster_driver::OS1::PointXYZIRFN, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     21 error: 'type' was not declared in this scope; did you mean 'boost::type'?
     24 error: 'type' is not a member of 'pcl::traits::datatype<mcl_3dl::PointXYZIL, pcl::fields::intensity>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     24 error: 'type' is not a member of 'pcl::traits::datatype<mcl_3dl::PointXYZIL, pcl::fields::label>::decomposed' {aka 'pcl::traits::decomposeArray<unsigned int>'}
     24 error: 'type' is not a member of 'pcl::traits::datatype<mcl_3dl::PointXYZIL, pcl::fields::x>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     24 error: 'type' is not a member of 'pcl::traits::datatype<mcl_3dl::PointXYZIL, pcl::fields::y>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     24 error: 'type' is not a member of 'pcl::traits::datatype<mcl_3dl::PointXYZIL, pcl::fields::z>::decomposed' {aka 'pcl::traits::decomposeArray<float>'}
     39 error: 'make_shared' is not a member of 'pcl'
     39 error: expected primary-expression before ')' token
     39 error: expected primary-expression before '>' token
    129 error: 'type' was not declared in this scope
    144 error: no match for call to '(pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)>) (const pcl::PCLPointField&)'
    144 error: no match for call to '(pcl::getFieldsList(const pcl::PCLPointCloud2&)::<lambda(const int&, const int&)>) (std::__cxx11::basic_string<char>&, const pcl::PCLPointField&)'
    144 error: request for member 'indices' in 'index', which is of non-class type 'const int'
    147 error: no match for call to '(pcl::PolygonMesh::concatenate(pcl::PolygonMesh&, const pcl::PolygonMesh&)::<lambda(int)>) (const pcl::Vertices&)'
    150 error: 'pcl::traits::HasNoNormal' has not been declared
    150 error: 'pcl::traits::HasNoXY' has not been declared
    150 error: 'pcl::traits::HasNoXYZ' has not been declared
    150 error: 'pcl::traits::HasNormal' has not been declared
    150 error: 'pcl::traits::HasXY' has not been declared
    150 error: 'pcl::traits::HasXYZ' has not been declared
    150 error: 'remove_all_extents_t' in namespace 'std' does not name a template type; did you mean 'remove_all_extents'?
    150 error: no match for call to '(pcl::toPCLPointCloud2(const pcl::PCLPointCloud2&, pcl::PCLImage&)::<lambda(const int&)>) (const pcl::PCLPointField&)'
    150 error: redefinition of 'template<class PointT, <typeprefixerror><anonymous> > bool pcl::isNormalFinite(const PointT&)'
    150 error: redefinition of 'template<class PointT, <typeprefixerror><anonymous> > bool pcl::isXYFinite(const PointT&)'
    150 error: redefinition of 'template<class PointT, <typeprefixerror><anonymous> > bool pcl::isXYZFinite(const PointT&)'
    270 error: the value of 'NrDims' is not usable in a constant expression
    288 error: expected initializer before '<' token
    300 error: #error PCL requires C++14 or above
    300 error: 'type' is not a member of 'pcl::traits::datatype<pcl::BRISKSignature512, pcl::fields::brisk_descriptor512>::decomposed' {aka 'pcl::traits::decomposeArray<unsigned char [64]>'}
....
    300 error: 'type' is not a member of 'pcl::traits::datatype<pcl::_ReferenceFrame, pcl::fields::z_axis>::decomposed' {aka 'pcl::traits::decomposeArray<float [3]>'}
    432 error: expected unqualified-id before '>' token
    432 error: type/value mismatch at argument 3 in template parameter list for 'template<class PointInT, class PointOutT, class Enable> struct pcl::detail::CopyPointHelper'
    441 error: request for member 'vertices' in 'polygon', which is of non-class type 'int'
    582 error: request for member 'name' in 'field', which is of non-class type 'const int'
    864 error: 'enable_if_t' is not a member of 'std'
    900 error: expected '>' before '<' token
   1458 error: use of 'auto' in lambda parameter declaration only available with '-std=c++14' or '-std=gnu++14'
   4776 error: 'enable_if_t' in namespace 'std' does not name a template type
  26574 error: 'divscalar' is not a member of 'pcl::traits'
  26574 error: 'minus' is not a member of 'pcl::traits'
  26574 error: 'minusscalar' is not a member of 'pcl::traits'
  26574 error: 'mulscalar' is not a member of 'pcl::traits'
  26574 error: 'plus' is not a member of 'pcl::traits'
  26574 error: 'plusscalar' is not a member of 'pcl::traits'
  26574 error: template argument 1 is invalid

  but with current version of melodic components (as in 2021-09-27 update) they all build OK

Signed-off-by: Martin Jansa <[email protected]>
  • Loading branch information
shr-project committed Oct 2, 2021
1 parent 9e0f449 commit 667df2b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 206 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=5b8a2a1aa14e6de44b4273134946a34c"

DEPENDS = "boost libflann libeigen qhull"

SRCREV = "39732f5a7c8455ed51fd0f6278d8b25322a68dd9"
# pcl-1.8.1 tag isn't in any branch
ROS_BRANCH ?= "nobranch=1"
SRC_URI = "git://github.com/PointCloudLibrary/pcl;${ROS_BRANCH};protocol=https \
file://0001-Dereference-shared_ptr-fix-for-GCC8.patch \
file://0001-Fix-deprecated-boost-endians.patch \
file://0002-pcl_pclconfig.cmake-don-t-pass-SSE_FLAGS-as-DEFINITI.patch \
"
S = "${WORKDIR}/git"
PV = "1.10.1+git${SRCPV}"
SRCREV = "cbed174ba0a0c9ef021015d54d3b60320d808593"
SRC_URI = "git://github.com/PointCloudLibrary/pcl.git"

S = "${WORKDIR}/git"

EXTRA_OECMAKE += "\
-DCMAKE_SKIP_RPATH=ON \
Expand All @@ -39,33 +34,6 @@ EXTRA_OECMAKE += "\
#Setting -ffloat-store to alleviate 32bit vs 64bit discrepancies on non-SSE platforms.
CXXFLAGS += "${@bb.utils.contains("TARGET_CC_ARCH", "-mfpmath=sse", "", "-ffloat-store", d)}"

# pcl/1.8.1-r0/git/recognition/include/pcl/recognition/3rdparty/metslib/abstract-search.hh:137:7: error: ISO C++17 does not allow dynamic exception specifications
# 137 | throw(no_moves_error) = 0;
# | ^~~~~
CXXFLAGS += "-std=gnu++14"

inherit cmake

FILES:${PN}-dev += "${datadir}/${PN}-1.8/*.cmake"

# The build is really memory hungry (at least with gcc8), even with just -j 8 it triggers OOMK on system with 32GB ram
# High memory needs mentioned in: https://github.com/PointCloudLibrary/pcl/issues/2284
# Setting just empty doesn't work, ninja will by default use number of cores available
# However, quick experiments have shown that it's possible to use up to CEIL(<RAM-in-GB>/5) as the argument to -j without running
# out of memory as long as the machine has a few GB of swap space. If this fails, override it by setting
# PARALLEL_MAKE:pn-pcl = "-j <A-SMALLER-N>" in conf/local.conf .

# Tried this, but psutil fails to import:
# inherit python3native
# DEPENDS += "python3-psutil-native"
# PARALLEL_MAKE = "-j ${@from psutil import virtual_memory; import math; int(math.ceil(virtual_memory().total / float(1024*1024*1024*5)))}"

def pcl_parallel_make_n():
import math
with open('/proc/meminfo', 'r') as f:
# First line of /proc/meminfo is:
# MemTotal: 65879500 kB
_, phys_mem_kb, _ = f.readline().split()
return int(math.ceil(float(phys_mem_kb)/float(1024*1024*5)))

PARALLEL_MAKE = "-j ${@pcl_parallel_make_n()}"
FILES:${PN}-dev += "${datadir}/${BPN}-*/*.cmake ${datadir}/${BPN}-*/Modules/*.cmake"

0 comments on commit 667df2b

Please sign in to comment.