language: c

env:

addons:
  apt:
    packages: &default_packages
      - libfftw3-dev
      - libblas-dev
      - libpng-dev

matrix:
  allow_failures:
    - env: MAYFAIL=1
  include:
    - name: "Makefile PARALLEL"
      env: PARALLEL=1
      os: linux
      compiler: gcc-5
      sudo: required
      dist: trusty
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - *default_packages
            - gcc-5
            - liblapacke-dev

    - name: "Makefile + test + utest"
      env:
      os: linux
      compiler: gcc-5
      sudo: required
      dist: trusty
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - *default_packages
            - gcc-5
            - liblapacke-dev
      script:
        - make test
        - make utest

    - name: "Makefile Clang"
      env: OMP=0
      os: linux
      compiler: clang
      sudo: required
      dist: trusty
      addons:
        apt:
          packages:
            - *default_packages
            - liblapacke-dev
            - libblocksruntime-dev
      script:
        - make
        - make utest

    - name: "Makefile OpenMP"
      env: OMP=1
      os: linux
      compiler: gcc-5
      sudo: required
      dist: trusty
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - *default_packages
            - gcc-5
            - liblapacke-dev
      script:
        - make
        - make test
        - make utest

    - name: "Makefile NOLAPACKE"
      env: NOLAPACKE=1
      os: linux
      compiler: gcc-5
      sudo: required
      dist: trusty
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - *default_packages
            - gcc-5
            - gfortran
            - liblapack-dev

script:
  - make bart
  - make all
