language: c++

sudo: true

addons:
    apt:
        sources:
            - ubuntu-toolchain-r-test
        packages:
            - make
            - g++-5

before_install:
    # Use GCC 5
    - export CXX="g++-5" CC="gcc-5"

install:
    # Install Boost 1.61
    - cd ..
    - wget https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2
    - tar --bzip2 -xf boost_1_61_0.tar.bz2
    - cd boost_1_61_0
    - ./bootstrap.sh
    - sudo ./b2 install
    - sudo ldconfig
    - cd ../BFGenerator

script:
    - make test

language: c++

sudo: true

addons:
    apt:
        sources:
            - ubuntu-toolchain-r-test
        packages:
            - make
            - g++-5

before_install:
    # Use GCC 5
    - sudo update-alternatives --remove-all gcc
    - sudo update-alternatives --remove-all g++
    - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10
    - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 10
    - sudo update-alternatives --install /usr/bin/cc  cc  /usr/bin/gcc   20
    - sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++   20
    - sudo update-alternatives --set cc  /usr/bin/gcc
    - sudo update-alternatives --set c++ /usr/bin/g++

install:
    # Install Boost 1.61
    - cd ..
    - wget https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2
    - tar --bzip2 -xf boost_1_61_0.tar.bz2
    - cd boost_1_61_0
    - ./bootstrap.sh
    - sudo ./b2 install
    - sudo ldconfig
    - cd ../BFGenerator

script:
    - make test

Use "update-alternatives" to set GCC 5.
Use "update-alternatives" to set GCC 5.
