Skip to content

Commit

Permalink
pcl: upgrade to 1.9.1
Browse files Browse the repository at this point in the history
* resolves issues with newer CMake
  -- Performing Test HAVE_MM_MALLOC
  CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
     HAVE_MM_MALLOC_EXITCODE (advanced)
     HAVE_MM_MALLOC_EXITCODE__TRYRUN_OUTPUT (advanced)
  For details see pcl/1.8.0-r0/build/TryRunResults.cmake
  -- Performing Test HAVE_MM_MALLOC - Success
* should resolve the issues with memory usage during the build:
  PointCloudLibrary/pcl#2284 (comment)
  but it still triggers OOMK with -j8 on 32GB RAM builder, use at least
  -j4 to improve the build time a bit
* use git fetcher for sources, github archives can be regenerated
  from time to time with different checksums:
  ros#609
* 0001-make-the-pcl-library-compile-with-gcc6.patch is needed only
  with thud and older, with warrior it builds OK without this
  patch as well

Signed-off-by: Martin Jansa <[email protected]>
  • Loading branch information
shr-project committed Jul 7, 2020
1 parent 13c1611 commit a773f61
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 122 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
From 31f72094a309ef6845e5c6b0b989237b4b59973f Mon Sep 17 00:00:00 2001
From: Lukas Bulwahn <[email protected]>
Date: Tue, 27 Sep 2016 14:05:22 +0200
Subject: [PATCH] make the pcl library compile with gcc6

With gcc6, compiling fails with `stdlib.h: No such file or directory`,
as including '-isystem /usr/include' breaks with gcc6, cf.,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129.

As far as I can judge from the history, all uses of `SYSTEM` were
added to avoid to show warnings from external libraries or were
added without any further argumentation for the use of `SYSTEM` in
the commit message. The detailed inspection of the git history is shown
below.

There are other better solutions to avoid to show warnings from
external libraries without modifying the SYSTEM default directories.
Hence, this commit replaces all occurrences of
`include_directory(SYSTEM ...)` with `include_directory(...)`. After
this change, the point cloud library compiles with gcc6 (in my setup).

The inspection of the git history pointed the following relevant
git commits:

In commit 636c49a6 [1], Eigen, FLANN, and MPI include directories
`are set as system to avoid warnings in those files`. The SYSTEM attribute
in the Eigen include directory remained until now; the other two occurrences
of the SYSTEM attribute have been dropped in commit 9003e42b [2] for FLANN
during work on `fixing the USE_ROS flag` without further explanation,
and in commit 582a1cff [3], which completely removed the whole MPI setup
in the CMakeLists.txt.

The commit ef3e489b [4] `set[ted] Boost libraries as system libraries`,
probably with the same rationale as in commit 636c49a6, i.e., to avoid
warnings in those files.

The commit 55deacd7 [5] provided a generic cmake script for grabbers
based on already pre-existing patterns in the CMakeLists.txt file.

[1] https://github.com/PointCloudLibrary/pcl/commit/636c49a6ffe7ec8c5409803b137b9d77081b9f9b
[2] https://github.com/PointCloudLibrary/pcl/commit/9003e42b7f648cd94ed817473c566cc97517ae08
[3] https://github.com/PointCloudLibrary/pcl/commit/582a1cffd5f074135937bfdaeab01b4e6048ce32
[4] https://github.com/PointCloudLibrary/pcl/commit/ef3e489ba7ef6fe3ef0319b15f5dc4b64b21ea32
[5] https://github.com/PointCloudLibrary/pcl/commit/55deacd7b1bb3cc63ad19bef971b97f0777864d6

Signed-off-by: Lukas Bulwahn <[email protected]>

Upstream-Status: Inappropriate [openembedded specific]

Signed-off-by: Lukas Bulwahn <[email protected]>
---
CMakeLists.txt | 2 +-
cmake/Modules/FindOpenNI.cmake | 2 +-
cmake/Modules/FindOpenNI2.cmake | 2 +-
cmake/pcl_find_boost.cmake | 2 +-
cmake/pcl_targets.cmake | 2 +-
test/CMakeLists.txt | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0b4c1a33d..95e1d31e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,7 +277,7 @@ endif()

# Eigen (required)
find_package(Eigen REQUIRED)
-include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS})
+include_directories(${EIGEN_INCLUDE_DIRS})

# FLANN (required)
if(NOT PCL_SHARED_LIBS OR ((WIN32 AND NOT MINGW) AND NOT PCL_BUILD_WITH_FLANN_DYNAMIC_LINKING_WIN32))
diff --git a/cmake/Modules/FindOpenNI.cmake b/cmake/Modules/FindOpenNI.cmake
index 2c7b26eea..1e62c359b 100644
--- a/cmake/Modules/FindOpenNI.cmake
+++ b/cmake/Modules/FindOpenNI.cmake
@@ -31,7 +31,7 @@ if(NOT WIN32)
message(STATUS "OpenNI disabled because libusb-1.0 not found.")
return()
else()
- include_directories(SYSTEM ${USB_10_INCLUDE_DIR})
+ include_directories(${USB_10_INCLUDE_DIR})
endif()
endif(NOT WIN32)

diff --git a/cmake/Modules/FindOpenNI2.cmake b/cmake/Modules/FindOpenNI2.cmake
index 037a9a399..cc1855e0f 100644
--- a/cmake/Modules/FindOpenNI2.cmake
+++ b/cmake/Modules/FindOpenNI2.cmake
@@ -31,7 +31,7 @@ if(NOT WIN32)
message(STATUS "OpenNI 2 disabled because libusb-1.0 not found.")
return()
else()
- include_directories(SYSTEM ${USB_10_INCLUDE_DIR})
+ include_directories(${USB_10_INCLUDE_DIR})
endif()
endif(NOT WIN32)

diff --git a/cmake/pcl_find_boost.cmake b/cmake/pcl_find_boost.cmake
index 6489f3954..0c170116d 100644
--- a/cmake/pcl_find_boost.cmake
+++ b/cmake/pcl_find_boost.cmake
@@ -49,6 +49,6 @@ if(Boost_FOUND)
# Obtain diagnostic information about Boost's automatic linking outputted
# during compilation time.
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
- include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
+ include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
endif(Boost_FOUND)
diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake
index 30696346f..bede67ffa 100644
--- a/cmake/pcl_targets.cmake
+++ b/cmake/pcl_targets.cmake
@@ -864,7 +864,7 @@ macro(PCL_ADD_GRABBER_DEPENDENCY _name _description)
message(STATUS "${_description}: not building because ${_name} not found")
else()
set(HAVE_${_name_capitalized} TRUE)
- include_directories(SYSTEM "${${_name_capitalized}_INCLUDE_DIRS}")
+ include_directories("${${_name_capitalized}_INCLUDE_DIRS}")
endif()
endif()
endmacro(PCL_ADD_GRABBER_DEPENDENCY)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 6a1d55d96..543c279ef 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -9,7 +9,7 @@ PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS} OPT_DEPS ${OPT_DEPS
if(build)

find_package(Gtest REQUIRED)
- include_directories(SYSTEM ${GTEST_INCLUDE_DIRS} ${GTEST_SRC_DIR})
+ include_directories(${GTEST_INCLUDE_DIRS} ${GTEST_SRC_DIR})

add_library(pcl_gtest STATIC ${GTEST_SRC_DIR}/src/gtest-all.cc)

76 changes: 0 additions & 76 deletions meta-ros-common/recipes-extended/pcl/pcl_1.8.1.bb

This file was deleted.

46 changes: 46 additions & 0 deletions meta-ros-common/recipes-extended/pcl/pcl_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
DESCRIPTION = "The Point Cloud Library (or PCL) for point cloud processing."
SECTION = "devel"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=5b8a2a1aa14e6de44b4273134946a34c"

DEPENDS = "boost libflann libeigen qhull"

PV = "1.9.1+git${SRCPV}"
SRCREV = "72f41b60a539cd1da67d1329b57222290122a0bb"
SRC_URI = "git://github.com/PointCloudLibrary/pcl.git \
file://0001-make-the-pcl-library-compile-with-gcc6.patch \
"

S = "${WORKDIR}/git"

EXTRA_OECMAKE += "\
-DCMAKE_SKIP_RPATH=ON \
-DHAVE_MM_MALLOC_EXITCODE=0 \
-DHAVE_POSIX_MEMALIGN_EXITCODE=0 \
${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DHAVE_SSE4_2_EXTENSIONS_EXITCODE=0", "-DHAVE_SSE4_2_EXTENSIONS_EXITCODE=1", d)} \
${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DHAVE_SSE4_1_EXTENSIONS_EXITCODE=0", "-DHAVE_SSE4_1_EXTENSIONS_EXITCODE=1", d)} \
-DHAVE_SSSE3_EXTENSIONS_EXITCODE=0 \
${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DHAVE_SSE3_EXTENSIONS_EXITCODE=0", "-DHAVE_SSE3_EXTENSIONS_EXITCODE=1", d)} \
${@bb.utils.contains("TARGET_CC_ARCH", "-msse2", "-DHAVE_SSE2_EXTENSIONS_EXITCODE=0", "-DHAVE_SSE2_EXTENSIONS_EXITCODE=1", d)} \
${@bb.utils.contains("TARGET_CC_ARCH", "-msse", "-DHAVE_SSE_EXTENSIONS_EXITCODE=0", "-DHAVE_SSE_EXTENSIONS_EXITCODE=1", d)} \
-DWITH_LIBUSB=FALSE \
-DWITH_PNG=FALSE \
-DWITH_QHULL=TRUE \
-DWITH_CUDA=FALSE \
-DWITH_QT=FALSE \
-DWITH_VTK=FALSE \
-DWITH_PCAP=FALSE \
-DWITH_OPENGL=FALSE \
"

#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)}"

inherit cmake

FILES_${PN}-dev += "${datadir}/${PN}-1.9/*.cmake ${datadir}/${PN}-1.9/Modules/*.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
PARALLEL_MAKE = "-j4"

0 comments on commit a773f61

Please sign in to comment.