From 9a21f5edf438afbbe9df3282549bd72d1c054033 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Fri, 30 Sep 2016 14:36:32 +0200 Subject: [PATCH] pcl: patch CMake script to compile with gcc6 (#392) --- ...ke-the-pcl-library-compile-with-gcc6.patch | 138 ++++++++++++++++++ recipes-extended/pcl/pcl_1.8.0.bb | 2 + 2 files changed, 140 insertions(+) create mode 100644 recipes-extended/pcl/pcl/0001-make-the-pcl-library-compile-with-gcc6.patch diff --git a/recipes-extended/pcl/pcl/0001-make-the-pcl-library-compile-with-gcc6.patch b/recipes-extended/pcl/pcl/0001-make-the-pcl-library-compile-with-gcc6.patch new file mode 100644 index 0000000..e9e2ec2 --- /dev/null +++ b/recipes-extended/pcl/pcl/0001-make-the-pcl-library-compile-with-gcc6.patch @@ -0,0 +1,138 @@ +From 19361abfa1bf21bc9be911f6ffa97f1c43174d8d Mon Sep 17 00:00:00 2001 +From: Lukas Bulwahn +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 + +Upstream-Status: Pending [https://github.com/PointCloudLibrary/pcl/pull/1730] + +--- + 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 e5fd763..c658df5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -272,7 +272,7 @@ endif() + + # Eigen (required) + find_package(Eigen REQUIRED) +-include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) ++include_directories(${EIGEN_INCLUDE_DIRS}) + add_definitions(-DEIGEN_USE_NEW_STDVECTOR + -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET) + # FLANN (required) +diff --git a/cmake/Modules/FindOpenNI.cmake b/cmake/Modules/FindOpenNI.cmake +index 9f772a4..bd36f3e 100644 +--- a/cmake/Modules/FindOpenNI.cmake ++++ b/cmake/Modules/FindOpenNI.cmake +@@ -30,7 +30,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 713099a..8226895 100644 +--- a/cmake/Modules/FindOpenNI2.cmake ++++ b/cmake/Modules/FindOpenNI2.cmake +@@ -30,7 +30,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 a3abe1c..c57b87d 100644 +--- a/cmake/pcl_find_boost.cmake ++++ b/cmake/pcl_find_boost.cmake +@@ -48,6 +48,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 691ead0..f730743 100644 +--- a/cmake/pcl_targets.cmake ++++ b/cmake/pcl_targets.cmake +@@ -858,7 +858,7 @@ macro(PCL_ADD_GRABBER_DEPENDENCY _name _description) + message(WARNING "${_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 3b3e2d7..342cb62 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -17,7 +17,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) + +-- +2.5.5 + diff --git a/recipes-extended/pcl/pcl_1.8.0.bb b/recipes-extended/pcl/pcl_1.8.0.bb index 58de62f..16212cd 100644 --- a/recipes-extended/pcl/pcl_1.8.0.bb +++ b/recipes-extended/pcl/pcl_1.8.0.bb @@ -9,6 +9,8 @@ SRC_URI = "https://github.com/PointCloudLibrary/${PN}/archive/${P}.tar.gz" SRC_URI[md5sum] = "8c1308be2c13106e237e4a4204a32cca" SRC_URI[sha256sum] = "9e54b0c1b59a67a386b9b0f4acb2d764272ff9a0377b825c4ed5eedf46ebfcf4" +SRC_URI += "file://0001-make-the-pcl-library-compile-with-gcc6.patch" + S = "${WORKDIR}/pcl-${P}" EXTRA_OECMAKE += "\