2015-09-23 11:43:36 -04:00
|
|
|
# Based on https://github.com/ldionne/hana/blob/master/.travis.yml
|
|
|
|
|
|
|
|
language: cpp
|
|
|
|
sudo: false
|
2017-10-25 14:36:31 -04:00
|
|
|
notifications:
|
|
|
|
email: false
|
|
|
|
|
|
|
|
# Use Linux unless specified otherwise
|
|
|
|
os: linux
|
|
|
|
dist: trusty
|
2015-09-23 11:43:36 -04:00
|
|
|
|
2016-09-28 01:02:49 -04:00
|
|
|
cache:
|
|
|
|
directories:
|
2017-10-25 14:36:31 -04:00
|
|
|
- ${TRAVIS_BUILD_DIR}/deps
|
2016-09-28 01:02:49 -04:00
|
|
|
|
2015-09-23 11:43:36 -04:00
|
|
|
matrix:
|
|
|
|
include:
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# Clang on OSX
|
|
|
|
# Travis seems to take longer to start OSX instances,
|
|
|
|
# so leave this first for the overall build to be faster
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
# XCode 8.3
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++ BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2017-10-25 14:36:31 -04:00
|
|
|
os: osx
|
|
|
|
osx_image: xcode8.3
|
|
|
|
compiler: clang
|
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++ BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
os: osx
|
2017-10-25 14:36:31 -04:00
|
|
|
osx_image: xcode8.3
|
2016-09-28 01:02:49 -04:00
|
|
|
compiler: clang
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
# XCode 9.1
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++ BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
os: osx
|
2017-10-25 14:36:31 -04:00
|
|
|
osx_image: xcode9.1
|
2015-09-23 11:43:36 -04:00
|
|
|
compiler: clang
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++ BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2017-10-25 14:36:31 -04:00
|
|
|
os: osx
|
|
|
|
osx_image: xcode9.1
|
|
|
|
compiler: clang
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# Clang on Linux
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
# Clang 3.6
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.6 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: &clang36
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.6
|
2015-10-15 16:00:10 -04:00
|
|
|
- g++-5
|
2017-10-25 14:36:31 -04:00
|
|
|
sources:
|
2015-09-23 11:43:36 -04:00
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.6
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.6 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: *clang36
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
# Clang 3.7
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.7 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
addons: &clang37
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.7
|
|
|
|
- g++-5
|
2017-10-25 14:36:31 -04:00
|
|
|
sources:
|
2016-09-28 01:02:49 -04:00
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.7
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.7 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
addons: *clang37
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
# Clang 3.8
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.8 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
addons: &clang38
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.8
|
|
|
|
- g++-5
|
2017-10-25 14:36:31 -04:00
|
|
|
sources:
|
2016-09-28 01:02:49 -04:00
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.8
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.8 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
addons: *clang38
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
# Clang 3.9
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.9 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2017-07-13 16:53:56 -04:00
|
|
|
addons: &clang39
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.9
|
|
|
|
- g++-5
|
2017-10-25 14:36:31 -04:00
|
|
|
sources:
|
2017-07-13 16:53:56 -04:00
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.9
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-3.9 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2017-07-13 16:53:56 -04:00
|
|
|
addons: *clang39
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
# Clang 4.0
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-4.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2017-10-25 14:36:31 -04:00
|
|
|
addons: &clang40
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-4.0
|
|
|
|
- g++-5
|
|
|
|
sources:
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-trusty-4.0
|
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-4.0 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2017-10-25 14:36:31 -04:00
|
|
|
addons: *clang40
|
|
|
|
|
|
|
|
# Clang 5.0
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-5.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2018-05-06 18:18:08 -04:00
|
|
|
addons: &clang50
|
2017-10-25 14:36:31 -04:00
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-5.0
|
|
|
|
- g++-5
|
|
|
|
sources:
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-trusty-5.0
|
2018-06-07 16:36:56 -04:00
|
|
|
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main'
|
2017-10-25 14:36:31 -04:00
|
|
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=clang++-5.0 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
|
|
|
addons: *clang50
|
|
|
|
|
|
|
|
# Clang 6.0
|
|
|
|
- env: COMPILER=clang++-6.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
|
|
|
addons: &clang60
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-6.0
|
|
|
|
- g++-6
|
|
|
|
sources:
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-trusty-6.0
|
|
|
|
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main'
|
|
|
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
|
|
|
|
|
|
|
- env: COMPILER=clang++-6.0 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
|
|
|
addons: *clang60
|
|
|
|
|
|
|
|
# Does not work due to #695
|
|
|
|
# Clang 6.0 c++17
|
|
|
|
#- env: COMPILER=clang++-6.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=17
|
|
|
|
# addons: *clang60
|
|
|
|
|
|
|
|
#- env: COMPILER=clang++-6.0 BUILD_TYPE=Release GSL_CXX_STANDARD=17
|
|
|
|
# addons: *clang60
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# GCC on Linux
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
# GCC 5
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=g++-5 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: &gcc5
|
|
|
|
apt:
|
|
|
|
packages: g++-5
|
2017-10-25 14:36:31 -04:00
|
|
|
sources:
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=g++-5 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: *gcc5
|
2017-10-25 14:36:31 -04:00
|
|
|
|
|
|
|
# GCC 6
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=g++-6 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
addons: &gcc6
|
|
|
|
apt:
|
|
|
|
packages: g++-6
|
2017-10-25 14:36:31 -04:00
|
|
|
sources:
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=g++-6 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2016-09-28 01:02:49 -04:00
|
|
|
addons: *gcc6
|
2015-09-23 11:43:36 -04:00
|
|
|
|
2018-06-08 14:41:06 -04:00
|
|
|
# GCC 7
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=g++-7 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
|
2018-06-08 14:41:06 -04:00
|
|
|
addons: &gcc7
|
|
|
|
apt:
|
|
|
|
packages: g++-7
|
|
|
|
sources:
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
- env: COMPILER=g++-7 BUILD_TYPE=Release GSL_CXX_STANDARD=14
|
2018-06-08 14:41:06 -04:00
|
|
|
addons: *gcc7
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
# GCC 7 c++17
|
|
|
|
- env: COMPILER=g++-7 BUILD_TYPE=Debug GSL_CXX_STANDARD=17
|
|
|
|
addons: *gcc7
|
|
|
|
|
|
|
|
- env: COMPILER=g++-7 BUILD_TYPE=Release GSL_CXX_STANDARD=17
|
|
|
|
addons: *gcc7
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2015-09-23 11:43:36 -04:00
|
|
|
install:
|
2017-10-25 14:36:31 -04:00
|
|
|
# Set the ${CXX} variable properly
|
|
|
|
- export CXX=${COMPILER}
|
|
|
|
- ${CXX} --version
|
|
|
|
|
|
|
|
# Dependencies required by the CI are installed in ${TRAVIS_BUILD_DIR}/deps/
|
2015-09-23 11:43:36 -04:00
|
|
|
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
2017-10-25 14:36:31 -04:00
|
|
|
- mkdir -p "${DEPS_DIR}"
|
|
|
|
- cd "${DEPS_DIR}"
|
|
|
|
|
|
|
|
# Travis machines have 2 cores
|
|
|
|
- JOBS=2
|
2016-09-28 01:02:49 -04:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Install a recent CMake (unless already installed on OS X)
|
|
|
|
############################################################################
|
2017-10-25 14:36:31 -04:00
|
|
|
- CMAKE_VERSION=3.7.2
|
2016-09-28 01:02:49 -04:00
|
|
|
- |
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
2017-10-25 14:36:31 -04:00
|
|
|
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
|
|
|
|
mkdir cmake && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
|
|
|
|
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
|
2016-09-28 01:02:49 -04:00
|
|
|
else
|
2017-10-25 14:36:31 -04:00
|
|
|
brew install cmake || brew upgrade cmake
|
2016-09-28 01:02:49 -04:00
|
|
|
fi
|
2017-10-25 14:36:31 -04:00
|
|
|
- cmake --version
|
2016-09-28 01:02:49 -04:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# [linux]: Install the right version of libc++
|
|
|
|
############################################################################
|
2015-09-23 11:43:36 -04:00
|
|
|
- |
|
2017-10-25 14:36:31 -04:00
|
|
|
LLVM_INSTALL=${DEPS_DIR}/llvm/install
|
|
|
|
# if in linux and compiler clang and llvm not installed
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" == "linux" && "${CXX%%+*}" == "clang" && -n "$(ls -A ${LLVM_INSTALL})" ]]; then
|
|
|
|
if [[ "${CXX}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2";
|
|
|
|
elif [[ "${CXX}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.1";
|
|
|
|
elif [[ "${CXX}" == "clang++-3.8" ]]; then LLVM_VERSION="3.8.1";
|
|
|
|
elif [[ "${CXX}" == "clang++-3.9" ]]; then LLVM_VERSION="3.9.1";
|
|
|
|
fi
|
2015-09-23 11:43:36 -04:00
|
|
|
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
|
|
|
|
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
|
|
|
|
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
|
2017-10-25 14:36:31 -04:00
|
|
|
mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi
|
|
|
|
travis_retry wget -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm
|
|
|
|
travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
|
|
|
|
travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
|
|
|
|
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL})
|
|
|
|
(cd llvm/build/projects/libcxx && make install -j2)
|
|
|
|
(cd llvm/build/projects/libcxxabi && make install -j2)
|
|
|
|
export CXXFLAGS="-isystem ${LLVM_INSTALL}/include/c++/v1"
|
|
|
|
export LDFLAGS="-L ${LLVM_INSTALL}/lib -l c++ -l c++abi"
|
|
|
|
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_INSTALL}/lib"
|
2015-09-23 11:43:36 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
before_script:
|
2017-10-25 14:36:31 -04:00
|
|
|
# have CMake to generate build files
|
2016-09-28 01:02:49 -04:00
|
|
|
- cd "${TRAVIS_BUILD_DIR}"
|
2017-10-25 14:36:31 -04:00
|
|
|
- mkdir build && cd build
|
2018-06-15 13:13:11 -04:00
|
|
|
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DGSL_CXX_STANDARD=$GSL_CXX_STANDARD
|
2017-10-25 14:36:31 -04:00
|
|
|
|
2015-09-23 11:43:36 -04:00
|
|
|
script:
|
2017-10-25 14:36:31 -04:00
|
|
|
# build and run tests
|
|
|
|
- cmake --build . -- -j${JOBS}
|
|
|
|
- ctest --output-on-failure -j${JOBS}
|