【问题标题】:Cmake not detecting boost-python when installing ROS安装 ROS 时 Cmake 未检测到 boost-python
【发布时间】:2018-09-29 07:34:02
【问题描述】:

我一直在尝试在我的 Mac 上安装 ROS,并根据不同版本的 boost 解决了不同库的错误。

但是,似乎有一个库甚至没有检测到 boost-python。

这是我得到的错误:

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

  Boost version: 1.67.0

  Boost include path: /usr/local/include

  Could not find the following static Boost libraries:

          boost_python

  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):
  CMakeLists.txt:8 (find_package)


-- skipping nosetests(parser.py) in project 'camera_calibration_parsers'
-- Configuring incomplete, errors occurred!
See also "/Users/redacted/ros_catkin_ws/build_isolated/camera_calibration_parsers/CMakeFiles/CMakeOutput.log".
<== Failed to process package 'camera_calibration_parsers': 
  Command '['/Users/redacted/ros_catkin_ws/install_isolated/env.sh', 'cmake', '/Users/redacted/ros_catkin_ws/src/image_common/camera_calibration_parsers', '-DCATKIN_DEVEL_PREFIX=/Users/redacted/ros_catkin_ws/devel_isolated/camera_calibration_parsers', '-DCMAKE_INSTALL_PREFIX=/Users/redacted/ros_catkin_ws/install_isolated', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_FIND_FRAMEWORK=LAST', '-DBoost_USE_STATIC_LIBS=ON', '-G', 'Unix Makefiles']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /Users/redacted/ros_catkin_ws/build_isolated/camera_calibration_parsers && /Users/redacted/ros_catkin_ws/install_isolated/env.sh cmake /Users/redacted/ros_catkin_ws/src/image_common/camera_calibration_parsers -DCATKIN_DEVEL_PREFIX=/Users/redacted/ros_catkin_ws/devel_isolated/camera_calibration_parsers -DCMAKE_INSTALL_PREFIX=/Users/redacted/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DBoost_USE_STATIC_LIBS=ON -G 'Unix Makefiles'

当我使用 -DBoost_DEBUG=ON 运行它时会发生这种情况

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/Users/nik312123/ros_catkin_ws/install_isolated/env.sh'
==> cmake /Users/nik312123/ros_catkin_ws/src/image_common/camera_calibration_parsers -DCATKIN_DEVEL_PREFIX=/Users/nik312123/ros_catkin_ws/devel_isolated/camera_calibration_parsers -DCMAKE_INSTALL_PREFIX=/Users/nik312123/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DBoost_USE_STATIC_LIBS=ON -DBoost_DEBUG=ON -G Unix Makefiles in '/Users/nik312123/ros_catkin_ws/build_isolated/camera_calibration_parsers'
-- Using CATKIN_DEVEL_PREFIX: /Users/redacted/ros_catkin_ws/devel_isolated/camera_calibration_parsers
-- Using CMAKE_PREFIX_PATH: /Users/redacted/ros_catkin_ws/install_isolated;/usr/local/Cellar/qt/5.11.2/
-- This workspace overlays: /Users/redacted/ros_catkin_ws/install_isolated
-- Using PYTHON_EXECUTABLE: /usr/local/bin/python
-- Using default Python package layout
-- Using empy: /usr/local/lib/python2.7/site-packages/em.pyc
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /Users/redacted/ros_catkin_ws/build_isolated/camera_calibration_parsers/test_results
-- Found gtest: gtests will be built
-- nosetests not found, Python tests can not be run (try installing package 'python-nose')
-- catkin 0.7.14
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1125 ] _boost_TEST_VERSIONS = 1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;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;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1127 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1129 ] Boost_USE_STATIC_LIBS = ON
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1131 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1133 ] Boost_ADDITIONAL_VERSIONS = 
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1135 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1203 ] Declared as CMake or Environmental Variables:
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1205 ]   BOOST_ROOT = 
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1207 ]   BOOST_INCLUDEDIR = 
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1209 ]   BOOST_LIBRARYDIR = 
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1211 ] _boost_TEST_VERSIONS = 1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;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;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1310 ] location of version.hpp: /usr/local/include/boost/version.hpp
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1334 ] version.hpp reveals boost 1.67.0
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1420 ] guessed _boost_COMPILER = 
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1430 ] _boost_MULTITHREADED = -mt
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1506 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1508 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1571 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG   = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1760 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-mt-1_67;boost_filesystem-mt;boost_filesystem
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:400 ]  Boost_LIBRARY_DIR_RELEASE = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1813 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-mt-d-1_67;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:400 ]  Boost_LIBRARY_DIR_DEBUG = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1760 ] Searching for PYTHON_LIBRARY_RELEASE: boost_python-mt-1_67;boost_python-mt;boost_python
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:400 ]  Boost_LIBRARY_DIR_RELEASE = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1813 ] Searching for PYTHON_LIBRARY_DEBUG: boost_python-mt-d-1_67;boost_python-mt-d;boost_python-mt;boost_python
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:400 ]  Boost_LIBRARY_DIR_DEBUG = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1760 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-mt-1_67;boost_system-mt;boost_system
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:400 ]  Boost_LIBRARY_DIR_RELEASE = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1813 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-mt-d-1_67;boost_system-mt-d;boost_system-mt;boost_system
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:400 ]  Boost_LIBRARY_DIR_DEBUG = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1887 ] Boost_FOUND = 1
CMake Error at /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:2048 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.67.0

  Boost include path: /usr/local/include

  Could not find the following static Boost libraries:

          boost_python

  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):
  CMakeLists.txt:8 (find_package)


-- skipping nosetests(parser.py) in project 'camera_calibration_parsers'
-- Configuring incomplete, errors occurred!
See also "/Users/redacted/ros_catkin_ws/build_isolated/camera_calibration_parsers/CMakeFiles/CMakeOutput.log".

我尝试了一些选项,例如使用 -DBoost_USE_STATIC_LIBS=ON 并导出多个路径,如下所示:

export INCLUDE="/usr/local/include/boost:$INCLUDE"
export LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

我还有 -DBoost_DEBUG=ON 代码块末尾提到的 CMakeOutput.log。很长,所以I made a pastebin for it here.

【问题讨论】:

  • 使用选项-DBoost_DEBUG=ON 搜索 Boost 的消息将提供更多信息。通过这种方式,您可以找到与boost_python 库对应的确切 文件名被搜索到以及在哪里搜索。然后将这些文件名和目录与您实际拥有的文件名和目录进行比较。
  • @Tsyvarev 对不起! -DBoost_DEBUG=ON 的错误与没有的日志混合在一起。
  • 好吧,Searching for PYTHON_LIBRARY_RELEASE: boost_python-mt-1_67;boost_python-mt;boost_python 行包含搜索为boost-bython 库的文件。你有这些文件之一(/usr/local/lib 下)吗?
  • @Tsyvarev 我在 /usr/local/lib 中有 libboost_python27-mt.a、libboost_python27-mt.dylib、libboost_python27.a 和 libboost_python27.dylib
  • 非常相似的问题(但尚未解决):stackoverflow.com/questions/50919160/….

标签: python boost cmake ros boost-python


【解决方案1】:

我根据 Tsyvarev 的链接得到了答案。您可以对同一目录中的库进行符号链接,而无需附加 27,如下所示:

ln -s libboost_python27-mt.a libboost_python-mt.a
ln -s libboost_python27-mt.dylib libboost_python-mt.dylib
ln -s libboost_python27.a libboost_python.a
ln -s libboost_python27.dylib libboost_python.dylib

【讨论】:

  • 这正是我所需要的!感谢@Tsyvarev 的启发!
【解决方案2】:

您已经安装了 Boost,但您是否构建了 Boost 二进制文件?见

unix-prepare-to-use-a-boost-library-binary

许多 Boost 库仅包含标头,不需要构建二进制文件,但 boost-python 可以。请参阅此答案以获取需要构建的库列表:

Which Boost libraries are header-only?

【讨论】:

  • 我会试试这个,让你知道它是怎么回事。只是让你知道,我已经通过自制软件单独安装了 boost 和 boost-python。 (brew install boost 和 brew install boost-python)
猜你喜欢
  • 2012-11-08
  • 1970-01-01
  • 2020-08-09
  • 2019-02-26
  • 1970-01-01
  • 1970-01-01
  • 2015-08-07
  • 1970-01-01
  • 2012-10-02
相关资源
最近更新 更多