找不到以下加速库:boost_fiber
Could not find the following Boost libraries: boost_fiber
我不熟悉boost。我想在 boost 中使用这个类,比如 boost::context::fiber 和 boost::context::continuation。因此,我下载了最新版本的boost 1.68。按照官方网站上的说明构建它。
首先,运行引导程序并生成 b2 文件。
$ ./bootstrap.sh --with-libraries=all --prefix=/usr/local/boost_168_build
然后通过安装运行它。
@--:/usr/local/boost_1_68_0$ ./b2 --show-libraries
The following libraries require building:
- atomic
- chrono
- container
- context
- contract
- coroutine
- date_time
- exception
- fiber
- filesystem
- graph
- graph_parallel
- iostreams
- locale
- log
- math
- mpi
- program_options
- python
- random
- regex
- serialization
- signals
- stacktrace
- system
- test
- thread
- timer
- type_erasure
- wave
@--:/usr/local/boost_1_68_0$ sudo ./b2 install
我做了一个cmake项目,创建了一个Cmakelist。
cmake_minimum_required(VERSION 3.12)
project(boost_context)
set(Boost_USE_STATIC_LIBS OFF) # only find static libs
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set (BOOST_ROOT
"/usr/local/boost_1_68_0")
set (BOOST_LIBRARYDIR
"/usr/local/boost_1_68_0/lib")
find_package( Boost REQUIRED COMPONENTS context fiber)
if(Boost_FOUND)
ADD_DEFINITIONS( "-DHAS_BOOST" )
message(STATUS ${Boost_INCLUDE_DIRS})
# include_directories(${Boost_INCLUDE_DIRS})
message(STATUS ${Boost_LIBRARIES})
message(STATUS ${BOOST_LIBRARYDIR})
message(STATUS ${Boost_LIBRARIES})
message(STATUS ${Boost_LIBRARIES})
message(STATUS ${Boost_LIBRARIES})
endif()
add_executable(boost_context main.cpp)
但是当我打开Boost_USE_STATIC_LIBS
CMAKE将报告:
/clion-2018.2.5/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles"
/Other_Project/boost-context
CMake Error at /clion-2018.2.5/bin/cmake/linux/share/cmake-
3.12/Modules/FindBoost.cmake:2048 (message):
Unable to find the requested Boost libraries.
Boost version: 1.68.0
Boost include path: /usr/local/boost_168_build/include
Could not find the following static Boost libraries:
boost_fiber
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:15 (find_package)
关闭Boost_USE_STATIC_LIBS
CMAKE将报告:
/clion-2018.2.5/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Other_Project/boost-context
CMake Error at /clion-2018.2.5/bin/cmake/linux/share/cmake-3.12/Modules/FindBoost.cmake:2048 (message):
Unable to find the requested Boost libraries.
Boost version: 1.68.0
Boost include path: /usr/local/boost_168_build/include
Could not find the following Boost libraries:
boost_fiber
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:15 (find_package)
最后,你知道我为什么能找到它的真正困惑了???
@--0:/usr/local/boost_168_build/include/boost/fiber$ pwd
/usr/local/boost_168_build/include/boost/fiber
@--0:/usr/local/boost_168_build/include/boost/fiber$ ls
algo condition_variable.hpp fiber.hpp hip pooled_fixedsize_stack.hpp scheduler.hpp
all.hpp context.hpp fixedsize_stack.hpp mutex.hpp properties.hpp segmented_stack.hpp
barrier.hpp cuda fss.hpp numa protected_fixedsize_stack.hpp timed_mutex.hpp
buffered_channel.hpp detail future operations.hpp recursive_mutex.hpp type.hpp
channel_op_status.hpp exceptions.hpp future.hpp policy.hpp recursive_timed_mutex.hpp unbuffered_channel.hpp
但是lib中没有任何纤维或延续
@--0:/usr/local/boost_168_build/lib$ pwd
/usr/local/boost_168_build/lib
@--0:/usr/local/boost_168_build/lib$ ls
libboost_atomic.a libboost_iostreams.so libboost_numpy27.a libboost_stacktrace_backtrace.so.1.68.0
libboost_atomic.so libboost_iostreams.so.1.68.0 libboost_numpy27.so libboost_stacktrace_basic.a
libboost_atomic.so.1.68.0 libboost_locale.a libboost_numpy27.so.1.68.0 libboost_stacktrace_basic.so
libboost_chrono.a libboost_locale.so libboost_prg_exec_monitor.a libboost_stacktrace_basic.so.1.68.0
libboost_chrono.so libboost_locale.so.1.68.0 libboost_prg_exec_monitor.so libboost_stacktrace_noop.a
libboost_chrono.so.1.68.0 libboost_log.a libboost_prg_exec_monitor.so.1.68.0 libboost_stacktrace_noop.so
libboost_container.a libboost_log_setup.a libboost_program_options.a libboost_stacktrace_noop.so.1.68.0
libboost_container.so libboost_log_setup.so libboost_program_options.so libboost_system.a
libboost_container.so.1.68.0 libboost_log_setup.so.1.68.0 libboost_program_options.so.1.68.0 libboost_system.so
libboost_context.a libboost_log.so libboost_python27.a libboost_system.so.1.68.0
libboost_context.so libboost_log.so.1.68.0 libboost_python27.so libboost_test_exec_monitor.a
libboost_context.so.1.68.0 libboost_math_c99.a libboost_python27.so.1.68.0 libboost_thread.a
libboost_contract.a libboost_math_c99f.a libboost_random.a libboost_thread.so
libboost_contract.so libboost_math_c99f.so libboost_random.so libboost_thread.so.1.68.0
libboost_contract.so.1.68.0 libboost_math_c99f.so.1.68.0 libboost_random.so.1.68.0 libboost_timer.a
libboost_coroutine.a libboost_math_c99l.a libboost_regex.a libboost_timer.so
libboost_coroutine.so libboost_math_c99l.so libboost_regex.so libboost_timer.so.1.68.0
libboost_coroutine.so.1.68.0 libboost_math_c99l.so.1.68.0 libboost_regex.so.1.68.0 libboost_type_erasure.a
libboost_date_time.a libboost_math_c99.so libboost_serialization.a libboost_type_erasure.so
libboost_date_time.so libboost_math_c99.so.1.68.0 libboost_serialization.so libboost_type_erasure.so.1.68.0
libboost_date_time.so.1.68.0 libboost_math_tr1.a libboost_serialization.so.1.68.0 libboost_unit_test_framework.a
libboost_exception.a libboost_math_tr1f.a libboost_signals.a libboost_unit_test_framework.so
libboost_filesystem.a libboost_math_tr1f.so libboost_signals.so libboost_unit_test_framework.so.1.68.0
libboost_filesystem.so libboost_math_tr1f.so.1.68.0 libboost_signals.so.1.68.0 libboost_wave.a
libboost_filesystem.so.1.68.0 libboost_math_tr1l.a libboost_stacktrace_addr2line.a libboost_wave.so
libboost_graph.a libboost_math_tr1l.so libboost_stacktrace_addr2line.so libboost_wave.so.1.68.0
libboost_graph.so libboost_math_tr1l.so.1.68.0 libboost_stacktrace_addr2line.so.1.68.0 libboost_wserialization.a
libboost_graph.so.1.68.0 libboost_math_tr1.so libboost_stacktrace_backtrace.a libboost_wserialization.so
libboost_iostreams.a libboost_math_tr1.so.1.68.0 libboost_stacktrace_backtrace.so libboost_wserialization.so.1.68.0
有人可以告诉我我错过了哪里。谢谢
您可以使用:
b2 cxxflags="-std=c++14" --reconfigure --with-fiber
编译 libboost_fiber.a
fiber
是一个仅标题库,因此无需链接,也无需将其添加为要查找的组件。
编译库的列表在文档中: https://www.boost.org/doc/libs/1_68_0/more/getting_started/unix-variants.html#header-only-libraries
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- boost::进程间消息队列引发错误
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- cmake如何在fedora工作站中找到boost静态库包
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- Boost Graph Library,修复节点大小
- 什么是"#include <boost/functional/hash.hpp> "?
- 基于boost的程序的静态链接——zlib问题
- C++:如何在CLion IDE中安装Boost
- C++Boost Asio Pool线程,带有lambda函数和传递引用变量
- 如何在boost beast http请求中设置http头
- Boost Spirit,获取迭代器内部语义动作
- boost::asio::steady_timer()与sleep()我应该使用哪一个
- 在 Boost::fiber 中引发的BOOST_ASSERT故障 Visual Studio "Debug" 构建
- 将 Boost.Fiber 与 Goroutines 进行比较可以纠正可用性
- 多个共享工作池,带 Boost::Fiber
- 如何构建Boost Fiber库以进行分段堆栈支持
- 在Linux上用于Windows的Linux上的Boost Fiber库
- goroutines 和 boost.fiber 之间的区别
- 如何与其他boost库一起构建boost::fiber