# Specify c language to get right CXX compiler (Travis bug https://github.com/travis-ci/travis-ci/issues/3871)
language: c

# Ubuntu 14.04 Trusty support
sudo: required
dist: trusty

compiler:
  - clang
  - gcc

before_install:
  - sudo apt-get -qq update
  - sudo apt-get install -y libeigen3-dev
  - sudo apt-get install -y libopenmpi-dev
  - sudo apt-get install -y libboost-all-dev

script:
  - mkdir build
  - cd build
  - cmake -DTesting=ON -DProgs=ON -Dprogs_list="anderson;hubbard2d" ..
  - make
  - make test

matrix:
  include:
    - compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
      env: CXX=g++-4.9
    - compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-5
      env: CXX=g++-5
    - compiler: clang
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-precise-3.6
          packages:
            - clang-3.6
      env: CXX=clang++-3.6 
    - compiler: clang
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-precise-3.7
          packages:
            - clang-3.7
      env: CXX=clang++-3.7


language: cpp

# Ubuntu 16.04 Xenial support
os: linux
dist: xenial

compiler:
  - clang
  - gcc

before_install:
  - sudo apt-get -qq update
  - sudo apt-get install -y libeigen3-dev
  - sudo apt-get install -y libopenmpi-dev
  - sudo apt-get install -y libboost-all-dev

script:
  # Stop on first error
  - set -e
  - mkdir build
  - cd build
  - cmake -DTesting=ON -DProgs=ON -Dprogs_list="anderson;hubbard2d" ..
  - make
  - make test

jobs:
  include:
    - compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
      env: CXX=g++-4.9
    - compiler: clang
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - clang-3.6
      env: CXX=clang++-3.6
    - compiler: clang
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - clang-3.7
      env: CXX=clang++-3.7


Upgrade Travis CI configuration to Ubuntu Xenial
Upgrade Travis CI configuration to Ubuntu Xenial

The dedicated g++-5 build has been excluded as it is the default
compiler in Ubuntu Xenial anyway.
