sudo: required
dist: trusty
language: cpp

env:
  - ARMADILLO=latest
  - ARMADILLO=minimum

before_install:
  - sudo apt-get update
  - sudo apt-get install -y --allow-unauthenticated libopenblas-dev liblapack-dev g++
  - if [ $ARMADILLO == "latest" ]; then
      curl https://ftp.fau.de/macports/distfiles/armadillo/`curl https://ftp.fau.de/macports/distfiles/armadillo/ -- | grep '.tar.xz' | sed 's/^.*<a href="\(armadillo-[0-9]*.[0-9]*.[0-9]*.tar.xz\)".*$/\1/' | tail -1` | tar xvJ && cd armadillo*;
    fi
  - if [ $ARMADILLO == "minimum" ]; then
      curl https://ftp.fau.de/macports/distfiles/armadillo/armadillo-6.500.5.tar.gz | tar xvz && cd armadillo*;
    fi
  - cmake . && make && sudo make install && cd ..

install:
  - mkdir build && cd build && cmake .. && make -j2

script:
  - CTEST_OUTPUT_ON_FAILURE=1 travis_wait 30 ctest -j2

notifications:
  email:
    - mlpack-git@lists.mlpack.org
  irc:
    channels:
      - "chat.freenode.net#mlpack"
    on_success: change
    on_failure: always
