language: cpp

sudo: false

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
      - sourceline: 'ppa:boost-latest/ppa'
      - sourceline: 'ppa:kubuntu-ppa/backports'
      - sourceline: 'ppa:roblib/ppa'
    packages:
      - cmake
      - g++-4.8
      - g++-6
      - g++-4.6
      - libboost1.55-dev
      - libboost-date-time1.55-dev
      - libboost-filesystem1.55-dev
      - libboost-graph1.55-dev
      - libboost-iostreams1.55-dev
      - libboost-math1.55-dev
      - libboost-program-options1.55-dev
      - libboost-random1.55-dev
      - libboost-regex1.55-dev
      - libboost-serialization1.55-dev
      - libboost-system1.55-dev
      - libboost-test1.55-dev
      - libboost-thread1.55-dev

matrix:
  include:
    - os: linux
      env: 
        - COMPILER=g++-6
        - OMP_NUM_THREADS=2

    - os: linux
      env: 
        - COMPILER=g++-4.8
        - OMP_NUM_THREADS=2

    - os: linux
      env: 
        - COMPILER=g++-4.6
        - OMP_NUM_THREADS=2

    - os: osx
      env: 
        - COMPILER=clang++
        - OMP_NUM_THREADS=2

before_install:
  - if [ "$TRAVIS_OS_NAME" != "linux" ]; then brew update && brew unlink cmake && brew install cmake; brew link cmake; fi
  
before_script:  
  - echo $COMPILER
  - export CXX=$COMPILER
  - mkdir build
  - cd build
  - cmake ..
  
script:
  - make -j2
  - CTEST_OUTPUT_ON_FAILURE=TRUE make test
