这是因为boost默认编译不开启mpi,运行bootstrap.sh, ./b2之后,打印信息显示zlib等等项的值为no。
进入./boost_1_73_0/tools/build目录,找到boost-build.jam文件,在这个文件最后一行加上:
using mpi ;
最终文件内容:
# Copyright 2001, 2002 Dave Abrahams
# Copyright 2002 Rene Rivera
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
boost-build src/kernel ;
using mpi ;
注意mpi后面有个空格,然后才是;
之后重新编译安装boost,打印内容显示zlib等等库都已关联:
Building the Boost C++ Libraries.
- C++11 mutex : yes
- lockfree boost::atomic_flag : yes
- Boost.Config Feature Check: cxx11_auto_declarations : yes
- Boost.Config Feature Check: cxx11_constexpr : yes
- Boost.Config Feature Check: cxx11_defaulted_functions : yes
- Boost.Config Feature Check: cxx11_final : yes
- Boost.Config Feature Check: cxx11_hdr_mutex : yes
- Boost.Config Feature Check: cxx11_hdr_tuple : yes
- Boost.Config Feature Check: cxx11_lambdas : yes
- Boost.Config Feature Check: cxx11_noexcept : yes
- Boost.Config Feature Check: cxx11_nullptr : yes
- Boost.Config Feature Check: cxx11_rvalue_references : yes
- Boost.Config Feature Check: cxx11_template_aliases : yes
- Boost.Config Feature Check: cxx11_thread_local : yes
- Boost.Config Feature Check: cxx11_variadic_templates : yes
- has_icu builds : yes
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam.
note: to suppress this message, pass "--without-graph_parallel" to bjam.
- zlib : yes
- bzip2 : yes
- lzma : yes
- zstd : no
- lzma : yes (cached)
- has_lzma_cputhreads builds : yes
- iconv (libc) : yes
- icu : yes
- native-atomic-int32-supported : yes
- native-syslog-supported : yes
- pthread-supports-robust-mutexes : yes
- compiler-supports-ssse3 : yes
- compiler-supports-avx2 : yes
- gcc visibility : yes
- long double support : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
- libbacktrace builds : yes
- addr2line builds : yes
- WinDbg builds : no
- WinDbgCached builds : no
- BOOST_COMP_GNUC >= 4.3.0 : yes
- zlib : yes
- bzip2 : yes
- lzma : yes
- zstd : no
再编译cartographer_ros,通过。