# Cinder + Boost

## Introduction

The Boost libraries are a collection of peer-reviewed open source C++ libraries. Cinder primarily relies on Boost.filesystem, and it in turn requires Boost.system. Also note that VC 2015 does not depend on any Boost binaries.

## Setting up Boost

Cinder ships with the required binaries for Boost and in general you should not need to build Boost itself, even if you're working from GitHub. However if you would like to upgrade your copy of Boost from the included version, these instructions will guide you through the process.

If you want to download the same version as the one we're using in Cinder, grab version 1.60. You can do so from this site: www.boost.org/users/download/

Cinder ships the subset of Boost generated by the `bcp` tool, with the following parameters:

    bcp filesystem geometry preprocessor container lexical_cast logic circular_buffer cinder_boost/

## Building Boost (Advanced Users)

Here's how to compile Boost yourself:

### OS X & iOS:

You'll need to create ~/user-config.jam with the following (and possibly correct the paths to the iOS SDKs):

    using clang : osx
    : xcrun clang -arch i386 -arch x86_64 -stdlib=libc++ -std=c++11 -mmacosx-version-min=10.8 -fvisibility-inlines-hidden
    ;

    using clang : ios
    : xcrun clang -arch armv7 -arch arm64 -stdlib=libc++ -std=c++11 -miphoneos-version-min=6.0 -fvisibility-inlines-hidden -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/
    ;

    using clang : ios_sim
    : xcrun clang -arch i386 -arch x86_64 -stdlib=libc++ -std=c++11 -miphoneos-version-min=6.0 -fvisibility-inlines-hidden -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/
    ;

### OS X:

    cd cinder/boost
    ./bootstrap.sh -with-libraries=filesystem,system
    ./b2 -a -j4 toolset=clang-osx link=static stage
    cp stage/lib/*.a ../lib/macosx

### iOS:

    rm -rf stage
    rm -rf bin.v2
    ./b2 -a -j4 toolset=clang-ios link=static stage
    cp stage/lib/*.a ../lib/ios

### iOS Simulator:

    rm -rf stage
    rm -rf bin.v2
    ./b2 -a -j4 toolset=clang-ios_sim link=static stage
    cp stage/lib/*.a ../lib/ios-sim

### Visual C++ 2013:

From the Command Prompt, start by running

    C: Files (x86) Visual Studio 12.0.bat:
    cd cinder\boost
    bootstrap
    b2 runtime-link=static debug-symbols=off optimization=space --with-filesystem --with-system

### Visual C++ 2013 x64:

From the Command Prompt, start by running:

    C: Files (x86) Visual Studio 12.0.bat x86_amd64:
    cd cinder\boost
    bootstrap
    b2 runtime-link=static address-model=64 debug-symbols=off optimization=space --with-filesystem --with-system

### Visual C++ 2015:

Cinder does not have any binary dependencies when using VC 2015.

### Android:

You'll need to copy tools/android/scripts/user-config.jam to your home directory, and also ensure that `$NDK_ROOT` is set properly. From the Terminal:

    cd tools/android/scripts
    ./build-boost.sh

### Linux:

    ./bootstrap
    ./b2 debug-symbols=off optimization=space --with-filesystem --with-system define=_GLIBCXX_USE_CXX11_ABI=0 stage