c++ - 如何安装和使用 Boost.Program_options 库?
问题描述
我正在尝试构建以下软件包: https ://github.com/kahypar/kahypar
在需求部分,它要求 Boost.Program_options我真的不知道那是什么以及我应该如何处理它。如果您能帮助我,我将不胜感激。我正在使用 macOS,并且我已经通过以下方式安装了 boost:
brew install boost
但它仍然不起作用。
解决方案
注意
因为有些人似乎没有意识到,手动说明适用于 macOS 100%(除了如何获取构建必需品,但显然 OP 已经有了它们)
但是,我无法在 macOS 上演示,因为我没有 Mac。对不起
正常的方法是在您的发行版之后或手动安装 boost:
发行版
例如 Ubuntu 20.04
apt -qq update
apt -qqyy install build-essential libboost-all-dev cmake git
git clone --recurse-submodules https://github.com/kahypar/kahypar
cmake -B build kahypar/
cmake --build build -j5
煮点咖啡。利润。
手动构建
这使用了 Boost 库 - 只构建我需要节省时间的东西:
apt -qqyy install build-essential cmake git python3-dev wget
wget https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.bz2
tar xf boost_1_75_0.tar.bz2
(cd boost_1_75_0; ./bootstrap.sh; ./b2 --with-program_options)
git clone --recurse-submodules https://github.com/kahypar/kahypar
BOOST_ROOT="$PWD/boost_1_75_0" cmake -B build kahypar/
cmake --build build -j5
现场演示
的截屏
当然,您可能只是指向BOOST_ROOT
brew install 所在的位置,但我无法帮助您,因为我无法测试它。您很可能需要单独设置包含/链接路径。
推荐阅读
- javascript - 尝试在对象的 v-for 循环中添加 v-model 文本框
- python - 我该如何解决这个问题:'NameError: name 'outpt_attr' is not defined'
- mongodb - 我需要关闭 MongoDB 客户端吗?
- python - 我想将 django 表头表示为复选框
- firebase - 当通过该深度链接从 Playstore 安装颤振应用程序时,未检测到 Firebase 深度链接
- c# - 在 GrapCity 活动报表中编写输入字段脚本
- math - 如何在 Rust 中使用 num_bigint 计算多重阶乘?
- selenium-webdriver - 如何为 web 和 andorid 本机应用程序的失败截取屏幕截图
- sql - 加入具有重复值的列时避免重复
- oracle - 我们如何在 Oracle Merge 语句中使用 use parallel (10) 提示