Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compile error] find_package(PCL) finds some but not all boost libraries #5052

Closed
lsdta opened this issue Dec 1, 2021 · 11 comments
Closed
Labels
kind: compile error Type of issue status: triage Labels incomplete

Comments

@lsdta
Copy link

lsdta commented Dec 1, 2021

Describe the error
PCL does not find boost libraries when including PCL in a project.
libpcl-dev (v1.8.1) and libboost-all-dev (v1.65.1) are installed.
This was tested on a clean install of Ubuntu 18.04.

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:48 (message):
  common is required but boost was not found
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:688 (pcl_report_not_found)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:851 (find_external_library)
  test/CMakeLists.txt:38 (find_package)

To Reproduce

Try to compile a CMake project with PCL as a requirement: find_package(PCL REQUIRED)

Build information

cmake correctly uses BOOST_INCLUDEDIR = /usr/include
I have also tried giving cmake the correct location of the Boost libraries, using -DBOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu, but this has not fixed the issue.

After editing the PCL cmake to force the components to be required, I get the following output

CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.65.1

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_thread
          boost_date_time
          boost_iostreams
          boost_serialization

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:127 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:637 (find_boost)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:851 (find_external_library)
  test/CMakeLists.txt:38 (find_package)

I can confirm that /usr/include contains the folders: boost/thread, boost/date_time, boost/iostreams and boost/serialization.
These boost libraries are definitely installed and are not any different to boost libraries that PCLConfig.cmake is finding (e.g. system).

When forcing Boost_DEBUG to be on, I get the following output:

-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1094 ] _boost_TEST_VERSIONS = 1.65.1;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1096 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1098 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1100 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1102 ] Boost_ADDITIONAL_VERSIONS = 1.65.1;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1104 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1172 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1174 ]   BOOST_ROOT = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1176 ]   BOOST_INCLUDEDIR = /usr/include
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1178 ]   BOOST_LIBRARYDIR = /usr/lib/x86_64-linux-gnu
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1180 ] _boost_TEST_VERSIONS = 1.65.1;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1279 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1303 ] version.hpp reveals boost 1.65.1
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1389 ] guessed _boost_COMPILER = -gcc7
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1399 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1443 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1445 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1507 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG   = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-gcc7-mt-1_65_1;boost_system-gcc7-mt;boost_system-mt-1_65_1;boost_system-mt;boost_system
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-gcc7-mt-d-1_65_1;boost_system-gcc7-mt-d;boost_system-mt-d-1_65_1;boost_system-mt-d;boost_system-mt;boost_system
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-gcc7-mt-1_65_1;boost_filesystem-gcc7-mt;boost_filesystem-mt-1_65_1;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-gcc7-mt-d-1_65_1;boost_filesystem-gcc7-mt-d;boost_filesystem-mt-d-1_65_1;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc7-mt-1_65_1;boost_thread-gcc7-mt;boost_thread-mt-1_65_1;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc7-mt-d-1_65_1;boost_thread-gcc7-mt-d;boost_thread-mt-d-1_65_1;boost_thread-mt-d;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for DATE_TIME_LIBRARY_RELEASE: boost_date_time-gcc7-mt-1_65_1;boost_date_time-gcc7-mt;boost_date_time-mt-1_65_1;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for DATE_TIME_LIBRARY_DEBUG: boost_date_time-gcc7-mt-d-1_65_1;boost_date_time-gcc7-mt-d;boost_date_time-mt-d-1_65_1;boost_date_time-mt-d;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for IOSTREAMS_LIBRARY_RELEASE: boost_iostreams-gcc7-mt-1_65_1;boost_iostreams-gcc7-mt;boost_iostreams-mt-1_65_1;boost_iostreams-mt;boost_iostreams
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for IOSTREAMS_LIBRARY_DEBUG: boost_iostreams-gcc7-mt-d-1_65_1;boost_iostreams-gcc7-mt-d;boost_iostreams-mt-d-1_65_1;boost_iostreams-mt-d;boost_iostreams-mt;boost_iostreams
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for SERIALIZATION_LIBRARY_RELEASE: boost_serialization-gcc7-mt-1_65_1;boost_serialization-gcc7-mt;boost_serialization-mt-1_65_1;boost_serialization-mt;boost_serialization
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for SERIALIZATION_LIBRARY_DEBUG: boost_serialization-gcc7-mt-d-1_65_1;boost_serialization-gcc7-mt-d;boost_serialization-mt-d-1_65_1;boost_serialization-mt-d;boost_serialization-mt;boost_serialization
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for CHRONO_LIBRARY_RELEASE: boost_chrono-gcc7-mt-1_65_1;boost_chrono-gcc7-mt;boost_chrono-mt-1_65_1;boost_chrono-mt;boost_chrono
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for CHRONO_LIBRARY_DEBUG: boost_chrono-gcc7-mt-d-1_65_1;boost_chrono-gcc7-mt-d;boost_chrono-mt-d-1_65_1;boost_chrono-mt-d;boost_chrono-mt;boost_chrono
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for ATOMIC_LIBRARY_RELEASE: boost_atomic-gcc7-mt-1_65_1;boost_atomic-gcc7-mt;boost_atomic-mt-1_65_1;boost_atomic-mt;boost_atomic
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for ATOMIC_LIBRARY_DEBUG: boost_atomic-gcc7-mt-d-1_65_1;boost_atomic-gcc7-mt-d;boost_atomic-mt-d-1_65_1;boost_atomic-mt-d;boost_atomic-mt;boost_atomic
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for REGEX_LIBRARY_RELEASE: boost_regex-gcc7-mt-1_65_1;boost_regex-gcc7-mt;boost_regex-mt-1_65_1;boost_regex-mt;boost_regex
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for REGEX_LIBRARY_DEBUG: boost_regex-gcc7-mt-d-1_65_1;boost_regex-gcc7-mt-d;boost_regex-mt-d-1_65_1;boost_regex-mt-d;boost_regex-mt;boost_regex
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /opt/ros/melodic/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1783 ] Boost_FOUND = 1

Environment:

  • OS: Ubuntu "Bionic" 18.04.6 LTS
  • Compiler: build-essential 12.4 (gcc 7.5.0)
  • PCL Version: 1.8.1
  • PCL Type: Installed from Ubuntu repo libpcl-dev (which i specifically installed via ros-melodic-desktop-full meta-package, which depends on libpcl-dev among other pcl libs)
  • Boost: libboost-all-dev v1.65.1 (which libpcl-dev requires in Ubuntu repo)

Sorry if this turns out to be a Boost problem rather than a PCL problem, I've been stuck on this issue for hours.

@lsdta lsdta added kind: compile error Type of issue status: triage Labels incomplete labels Dec 1, 2021
@mvieth
Copy link
Member

mvieth commented Dec 1, 2021

Can you try to build a tutorial, let's say this one, to make sure this problem is not related to ROS?

@lsdta
Copy link
Author

lsdta commented Dec 1, 2021

I have tested using that tutorial, and get the exact same error, same boost debug, same boost libraries not found.

In fact, a completely empty project with CMakeLists.txt having only the line find_package(PCL REQUIRED), then running cmake ., will give the same error:

-- Could NOT find Boost
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:48 (message):
  common is required but boost was not found
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:688 (pcl_report_not_found)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:851 (find_external_library)
  CMakeLists.txt:1 (find_package)

The only idea I have is around the fact that /opt/ros/melodic/lib is in the Boost_DEBUG listing above, not sure how that affects things.

@larshg
Copy link
Contributor

larshg commented Dec 1, 2021

Seems to me that boost 1.65.1 is too new for pcl 1.8.1 see:
https://github.com/PointCloudLibrary/pcl/blob/pcl-1.8.1/PCLConfig.cmake.in#L94-L97

@lsdta
Copy link
Author

lsdta commented Dec 1, 2021

The version of PCLConfig.cmake I have from the Ubuntu repo with pcl 1.8.1 has "1.65.1" "1.65" on line 93:
https://github.com/PointCloudLibrary/pcl/blob/pcl-1.8.1/PCLConfig.cmake.in#L93

@lsdta
Copy link
Author

lsdta commented Dec 1, 2021

I think FindBoost is looking for Boost in the /opt/ros/melodic/lib/ folder for the Boost libraries for some reason, even when I tell cmake that BOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu

@larshg
Copy link
Contributor

larshg commented Dec 1, 2021

Indeed it does state that in the output you provided:
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1507 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG = /opt/ros/melodic/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH

But as you write, BOOST_LIBRARYDIR = /usr/lib/x86_64-linux-gnu is set like this.

@larshg
Copy link
Contributor

larshg commented Dec 1, 2021

I guess you would have to investigate what goes on in FindBoost in the cmake 3.10 module to figure out why it goes to the ros variables.

@lsdta
Copy link
Author

lsdta commented Dec 1, 2021

Thanks. It seems Boost_LIBRARY_SEARCH_DIRS_RELEASE/DEBUG are being set to /opt/ros/melodic/lib, even with BOOST_LIBRARYDIR being set and also with Boost_NO_SYSTEM_PATHS=ON
No idea why, must be set globally when installing ros (or similar).

For anyone else encountering this, manually setting -DBoost_LIBRARY_DIR_RELEASE=/usr/lib/x86_64-linux-gnu when calling cmake seems to fix the issue. Doing the same for DEBUG may also help. This also works with catkin_make, if building ros packages.

@shashankkapoor
Copy link

I have tested using that tutorial, and get the exact same error, same boost debug, same boost libraries not found.

In fact, a completely empty project with CMakeLists.txt having only the line find_package(PCL REQUIRED), then running cmake ., will give the same error:

-- Could NOT find Boost
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:48 (message):
  common is required but boost was not found
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:688 (pcl_report_not_found)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:851 (find_external_library)
  CMakeLists.txt:1 (find_package)

The only idea I have is around the fact that /opt/ros/melodic/lib is in the Boost_DEBUG listing above, not sure how that affects things.

I had this same issue.
image

@rvenky125
Copy link

rvenky125 commented May 15, 2023

Is there any update on the issue, any workaround 🤔?
I'm using windows and getting the same error.

@larsleimbach
Copy link

I just build boost and PCL from source code https://github.com/boostorg/boost?tab=readme-ov-file
Then I called in the boost source code folder
./bootstrap.sh --prefix=/path/where/lib/and/include/folder/of/boost/will/be && ./b2 install

Then when you call cmake in the PCL source folder you just add the path for boost:

cmake \
-DBOOST_LIBRARYDIR=/path/where/lib/folder/of/boost/will/be \
-DBOOST_INCLUDEDIR=/path/where/include/folder/of/boost/will/be \
..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: compile error Type of issue status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

6 participants