Skip to content

Instantly share code, notes, and snippets.

@doevelopper
Created December 26, 2021 17:58
Show Gist options
  • Save doevelopper/e5d49355d6d2c6b43db95361c69e62f2 to your computer and use it in GitHub Desktop.
Save doevelopper/e5d49355d6d2c6b43db95361c69e62f2 to your computer and use it in GitHub Desktop.
    #!/usr/bin/env bash

install-boost.sh: Download Boost (version 1.65.1), build from source, install, and clean-up. Tested on Ubuntu. Dependencies:

  • build-essential
  • echo
  • rm
  • tar
  • wget
    $> wget https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz
    $> extract boost_1_78_0.tar.gz

Build Boost from source

    $> cd ./boost_1_78_0
    $> ./bootstrap.sh --show-libraries # /bootstrap.sh --prefix=/home/hroland/developpements/logslibs/ --show-libraries
    $> ./b2 toolset=gcc cxxflags=-std=gnu++17
    $> ./b2 install --prefix=/usr

Define BOOST_ROOT

    $> echo "export BOOST_ROOT=/usr/include/boost" >> ~/.profile

Clean-up

    $> cd ../
    $> rm -rf boost_1_78_0 && rm -rf boost_1_78_0.tar.gz
@doevelopper
Copy link
Author

https://www.boost.org/doc/libs/1_78_0/more/getting_started/unix-variants.html

    $> ./bootstrap --prefix=$HOME

    $> ./b2 link=shared runtime-link=shared threading=multi,single variant=release \
                 debug-symbols=on toolset=gcc -a -q -j3 --layout=versioned architecture=power host-os=linux stage

    $> ./b2 link=shared runtime-link=shared threading=multi,single variant=release \
                 debug-symbols=on toolset=gcc -q -j3 --layout=versioned architecture=power host-os=linux install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment