Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2017-12-06 19:11:49 -0500

M@t gravatar image

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake. CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package(PCL REQUIRED)
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package(Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories(include ${catkin_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative.

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake. CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package(PCL find_package( PCL REQUIRED)
find_package(catkin find_package( catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package(Boost find_package( Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories(include include_directories( include 
  ${catkin_INCLUDE_DIRS}  ${PCL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

  ${Boost_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative. appreciative.

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake. CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

When I add set(Boost_DEBUG 1) the compiler spits out more information, including this:

-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1104 ] Boost_FOUND = 1
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono

So it seems that Boost is being found, but it only detects a few libraries. However there are definitely more libraries than those few present in the /usr/include/boost folder, so I'm not sure why only these ones are being found.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package( PCL REQUIRED)
find_package( catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package( Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories( include 
  ${catkin_INCLUDE_DIRS} 
  ${PCL_INCLUDE_DIRS} 
  ${Boost_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative.

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake. CMake on Linux (Ubuntu 14.04). CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

When I add set(Boost_DEBUG 1) the compiler spits out more information, including this:

-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1104 ] Boost_FOUND = 1
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono

So it seems that Boost is being found, but it only detects a few libraries. However there are definitely more libraries than those few present in the /usr/include/boost folder, so I'm not sure why only these ones are being found.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package( PCL REQUIRED)
find_package( catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package( Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories( include 
  ${catkin_INCLUDE_DIRS} 
  ${PCL_INCLUDE_DIRS} 
  ${Boost_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative.

UPDATES

  1. There are actually two versions of boost installed on my system. v1.54.0 in /usr/include/boost/version.hpp and v1.65.1 in /usr/lib/boost_1_65_1/boost/version.hpp

  2. In response to @gvdhoorn's comment, the output of dpkg -l | grep boost is here: output of grep boost.txt. Note that grep doesn't return anything about v1.65.1

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake on Linux (Ubuntu 14.04). CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

When I add set(Boost_DEBUG 1) the compiler spits out more information, including this:

-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1104 ] Boost_FOUND = 1
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono

So it seems that Boost is being found, but it only detects a few libraries. However there are definitely more libraries than those few present in the /usr/include/boost folder, so I'm not sure why only these ones are being found.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package( PCL REQUIRED)
find_package( catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package( Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories( include 
  ${catkin_INCLUDE_DIRS} 
  ${PCL_INCLUDE_DIRS} 
  ${Boost_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative.

UPDATES

  1. There are actually two versions of boost installed on my system. v1.54.0 in /usr/include/boost/version.hpp and v1.65.1 in /usr/lib/boost_1_65_1/boost/version.hpp

  2. In response to @gvdhoorn's comment, the output of dpkg -l | grep boost is here: output of grep boost.txt. Note that grep doesn't return anything about v1.65.1

  3. I've noticed that my code will compile and run if I only use v1.54.0 and don't include <boost/core/demangle.hpp> as it seems that v1.54.0 does have the other two files I'm including (<boost/foreach.hpp> and <boost/algorithm/string.hpp>) but not this one.

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake on Linux (Ubuntu 14.04). CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

When I add set(Boost_DEBUG 1) the compiler spits out more information, including this:

-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1104 ] Boost_FOUND = 1
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono

So it seems that Boost is being found, but it only detects a few libraries. However there are definitely more libraries than those few present in the /usr/include/boost folder, so I'm not sure why only these ones are being found.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package( PCL REQUIRED)
find_package( catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package( Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories( include 
  ${catkin_INCLUDE_DIRS} 
  ${PCL_INCLUDE_DIRS} 
  ${Boost_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative.

UPDATES

  1. There are actually two versions of boost installed on my system. v1.54.0 in /usr/include/boost/version.hpp and v1.65.1 in /usr/lib/boost_1_65_1/boost/version.hpp

  2. In response to @gvdhoorn's comment, the output of dpkg -l | grep boost is here: output of grep boost.txt. Note that grep doesn't return anything about v1.65.1

  3. I've noticed that my code will compile and run if I only use v1.54.0 and don't include <boost/core/demangle.hpp> as it seems that v1.54.0 does have the other two files I'm including (<boost/foreach.hpp> and <boost/algorithm/string.hpp>) but not this one.

  4. In response to @gvdhoorn's answer: I added the following lines to my CMakeLists.txt file, to try to force CMake to use version 1.65.1:

    set(BOOST_ROOT /usr/lib/boost_1_65_1)
    set(BOOST_INCLUDEDIR /usr/lib/boost_1_65_1)
    set(BOOST_LIBRARYDIR /usr/lib/boost_1_65_1/stage/lib)
    find_package(Boost REQUIRED 1.65.1 COMPONENTS algorithm core)

    However this still fails to compile with the same error message, but with version "1.65.1" instead of "1.54.0" I suspect that either my 1.65 installation is incorrect or otherwise I'm not directing CMake to the right library filepath.

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake on Linux (Ubuntu 14.04). CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

When I add set(Boost_DEBUG 1) the compiler spits out more information, including this:

-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1104 ] Boost_FOUND = 1
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono

So it seems that Boost is being found, but it only detects a few libraries. However there are definitely more libraries than those few present in the /usr/include/boost folder, so I'm not sure why only these ones are being found.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package( PCL REQUIRED)
find_package( catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package( Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories( include 
  ${catkin_INCLUDE_DIRS} 
  ${PCL_INCLUDE_DIRS} 
  ${Boost_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative.

UPDATES

  1. There are actually two versions of boost installed on my system. v1.54.0 in /usr/include/boost/version.hpp and v1.65.1 in /usr/lib/boost_1_65_1/boost/version.hpp

  2. In response to @gvdhoorn's comment, the output of dpkg -l | grep boost is here: output of grep boost.txt. Note that grep doesn't return anything about v1.65.1

  3. I've noticed that my code will compile and run if I only use v1.54.0 and don't include <boost/core/demangle.hpp> as it seems that v1.54.0 does have the other two files I'm including (<boost/foreach.hpp> and <boost/algorithm/string.hpp>) but not this one.

  4. In response to @gvdhoorn's answer: I added the following lines to my CMakeLists.txt file, to try to force CMake to use version 1.65.1:

    set(BOOST_ROOT /usr/lib/boost_1_65_1)
    set(BOOST_INCLUDEDIR /usr/lib/boost_1_65_1)
    set(BOOST_LIBRARYDIR /usr/lib/boost_1_65_1/stage/lib)
    find_package(Boost REQUIRED 1.65.1 COMPONENTS algorithm core)

    However this still fails to compile with the same error message, but with version "1.65.1" instead of "1.54.0" I suspect that either my 1.65 installation is incorrect or otherwise I'm not directing CMake to the right library filepath.filepath. In which case it would probably make more sense to somehow force version 1.54.0 to upgrade, rather than having two separate installations.

Why can't CMake find the installed Boost libraries? (Boost-catkin error)

I'm trying to get the Boost library working with catkin and CMake on Linux (Ubuntu 14.04). CMake can successfully find Boost, but can't find the libraries, instead failing to when running catkin_make with this error:

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

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_algorithm
          boost_core

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I've made the necessary edits to my CMakeLists.txt file, as per the wiki page. And I've also searched other ROS/StackOverflow questions here, here and here, however none of these solutions have worked for me.

Boost is definitely installed in the /usr/include/boost folder, and all the libraries are there so I'm not sure why CMake isn't finding them. I've also tried using set() to change BOOST_LIBRARYDIR and BOOST_ROOT in the CMakeList.txt file, but if that's the solution then I haven't found the right filepath to set them to.

When I add set(Boost_DEBUG 1) the compiler spits out more information, including this:

-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1104 ] Boost_FOUND = 1
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono

So it seems that Boost is being found, but it only detects a few libraries. However there are definitely more libraries than those few present in the /usr/include/boost folder, so I'm not sure why only these ones are being found.

My CMakeList.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(myproject)

find_package( PCL REQUIRED)
find_package( catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  pcl_ros
  pcl_conversions
  roslaunch
)

find_package( Boost REQUIRED COMPONENTS
  algorithm
  core
)

catkin_package()

include_directories( include 
  ${catkin_INCLUDE_DIRS} 
  ${PCL_INCLUDE_DIRS} 
  ${Boost_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})

# All the "add_executable" and "link_target_libraries" commands for my .cpp files.

If anyone has any advice or suggestions on how to resolve this problem, I'd be very appreciative.

UPDATES

  1. There are actually two versions of boost installed on my system. v1.54.0 in /usr/include/boost/version.hpp and v1.65.1 in /usr/lib/boost_1_65_1/boost/version.hpp

  2. In response to @gvdhoorn's comment, the output of dpkg -l | grep boost is here: output of grep boost.txt. Note that grep doesn't return anything about v1.65.1

  3. I've noticed that my code will compile and run if I only use v1.54.0 and don't include <boost/core/demangle.hpp> as it seems that v1.54.0 does have the other two files I'm including (<boost/foreach.hpp> and <boost/algorithm/string.hpp>) but not this one.

  4. In response to @gvdhoorn's answer: I added the following lines to my CMakeLists.txt file, to try to force CMake to use version 1.65.1:

    set(BOOST_ROOT /usr/lib/boost_1_65_1)
    set(BOOST_INCLUDEDIR /usr/lib/boost_1_65_1)
    set(BOOST_LIBRARYDIR /usr/lib/boost_1_65_1/stage/lib)
    find_package(Boost REQUIRED 1.65.1 COMPONENTS algorithm core)

    However this still fails to compile with the same error message, but with version "1.65.1" instead of "1.54.0" I suspect that either my 1.65 installation is incorrect or otherwise I'm not directing CMake to the right library filepath. In which case it would probably make more sense to somehow force version 1.54.0 to upgrade, rather than having two separate installations.installations (which is even more preferable given the warnings about mixing versions).