Skip to content

Instantly share code, notes, and snippets.

@jimporter
Last active August 7, 2022 20:10
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jimporter/10442880 to your computer and use it in GitHub Desktop.
Save jimporter/10442880 to your computer and use it in GitHub Desktop.
Build Boost against libc++
#!/bin/sh
# First, build libc++ See <http://libcxx.llvm.org/>, "Build on Linux using CMake
# and libsupc++." and substitute libsupc++ for libstdc++. NOTE: You'll probably
# need to explicitly link libsupc++ when you compile your own code!
#
# Next, download Boost and extract it somewhere. Set SRC_DIR to that location.
SRC_DIR=$HOME/src/boost_1_55_0
# Set this to be the install prefix. "/usr" is also a good choice.
INSTALL_DIR=$HOME
cd $SRC_DIR
./bootstrap.sh --with-toolset=clang --prefix=$INSTALL_DIR
./b2 clean
./b2 toolset=clang cxxflags="-std=c++1y -stdlib=libc++" linkflags="-stdlib=libc++" --prefix=$INSTALL_DIR -j 4 stage release
./b2 install toolset=clang cxxflags="-std=c++1y -stdlib=libc++" linkflags="-stdlib=libc++" --prefix=$INSTALL_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment