How to install and use Boost.Program_options library?

Viewed 660

I am trying to build the following package: https://github.com/kahypar/kahypar

In the requirement section, it asks for Boost.Program_options and I don't really know what that is and how I should deal with that. I appreciate that if you help me with that. I am using a macOS and I already installed boost by using:

brew install boost

but it still doesn't work.

1 Answers

NOTICE

Because some people don't seem to realize, the manual instructions apply 100% for macOS (except for how to get the build-essentials, but apparently OP already has them)

However, I cannot demo on macOS because I don't own a Mac. Sorry

The normal way is to install boost following either your distro or manually:

Distro

For example 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

Make some coffee. Profit.

Manual Build

This uses Boost libraries - build only what I need to save on time:

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

LIVE DEMO

Screencasts of

Of course you might just get away with pointing BOOST_ROOT at wherever the brew install resides, but I can't help you with that because I can't test it. In all likelihood you would need to set include/link paths separately.

Related