From bc0e432e116705dab6a508ca29a7b82ac8c645bc Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 2 Oct 2017 14:17:24 +0200 Subject: [PATCH] Changed compilers in travis --- .travis.yml | 74 +++++++++++++++++++-------------------- travis/build-helper.sh | 51 +++++---------------------- travis/generate_travis.py | 6 ++-- travis/install_linux.sh | 2 +- travis/install_osx.sh | 19 ++++------ 5 files changed, 56 insertions(+), 96 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b5f50657..697118347 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ branches: only: - master - stable +sudo: required dist: trusty language: cpp @@ -20,7 +21,6 @@ cache: # Enable docker support services: - docker -sudo: required notifications: email: @@ -42,8 +42,8 @@ jobs: # osx - stage: Build (1st run) os: osx - compiler: clang - env: CONFIG=DefaultDebug COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultDebug COMPILER=apple-clang STL=libc++ install: - rm -rf build - travis/install_osx.sh @@ -53,8 +53,8 @@ jobs: - find build -iname '*err*.log' -type f -print -exec cat {} \; - stage: Build (1st run) os: osx - compiler: clang - env: CONFIG=DefaultRelease COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultRelease COMPILER=apple-clang STL=libc++ install: - rm -rf build - travis/install_osx.sh @@ -66,7 +66,7 @@ jobs: - stage: Build (1st run) os: linux compiler: gcc - env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc install: - rm -rf build - travis/install_linux.sh @@ -79,7 +79,7 @@ jobs: - stage: Build (1st run) os: linux compiler: gcc - env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc install: - rm -rf build - travis/install_linux.sh @@ -97,8 +97,8 @@ jobs: # osx - stage: Build (2nd run) os: osx - compiler: clang - env: CONFIG=DefaultDebug COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultDebug COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -107,8 +107,8 @@ jobs: - find build -iname '*err*.log' -type f -print -exec cat {} \; - stage: Build (2nd run) os: osx - compiler: clang - env: CONFIG=DefaultRelease COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultRelease COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -119,7 +119,7 @@ jobs: - stage: Build (2nd run) os: linux compiler: gcc - env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -131,7 +131,7 @@ jobs: - stage: Build (2nd run) os: linux compiler: gcc - env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -148,8 +148,8 @@ jobs: # osx - stage: Build (3rd run) os: osx - compiler: clang - env: CONFIG=DefaultDebug COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultDebug COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -158,8 +158,8 @@ jobs: - find build -iname '*err*.log' -type f -print -exec cat {} \; - stage: Build (3rd run) os: osx - compiler: clang - env: CONFIG=DefaultRelease COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultRelease COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -170,7 +170,7 @@ jobs: - stage: Build (3rd run) os: linux compiler: gcc - env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -182,7 +182,7 @@ jobs: - stage: Build (3rd run) os: linux compiler: gcc - env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -199,8 +199,8 @@ jobs: # osx - stage: Build (4th run) os: osx - compiler: clang - env: CONFIG=DefaultDebug COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultDebug COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -209,8 +209,8 @@ jobs: - find build -iname '*err*.log' -type f -print -exec cat {} \; - stage: Build (4th run) os: osx - compiler: clang - env: CONFIG=DefaultRelease COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultRelease COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -221,7 +221,7 @@ jobs: - stage: Build (4th run) os: linux compiler: gcc - env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -233,7 +233,7 @@ jobs: - stage: Build (4th run) os: linux compiler: gcc - env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -250,8 +250,8 @@ jobs: # osx - stage: Build (5th run) os: osx - compiler: clang - env: CONFIG=DefaultDebug COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultDebug COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -260,8 +260,8 @@ jobs: - find build -iname '*err*.log' -type f -print -exec cat {} \; - stage: Build (5th run) os: osx - compiler: clang - env: CONFIG=DefaultRelease COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultRelease COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -272,7 +272,7 @@ jobs: - stage: Build (5th run) os: linux compiler: gcc - env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -284,7 +284,7 @@ jobs: - stage: Build (5th run) os: linux compiler: gcc - env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -301,8 +301,8 @@ jobs: # osx - stage: Test all os: osx - compiler: clang - env: CONFIG=DefaultDebug COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultDebug COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -311,8 +311,8 @@ jobs: - find build -iname '*err*.log' -type f -print -exec cat {} \; - stage: Test all os: osx - compiler: clang - env: CONFIG=DefaultRelease COMPILER=clang-4.0 STL=libc++ + compiler: apple-clang + env: CONFIG=DefaultRelease COMPILER=apple-clang STL=libc++ install: - travis/install_osx.sh script: @@ -323,7 +323,7 @@ jobs: - stage: Test all os: linux compiler: gcc - env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultDebug LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: @@ -335,7 +335,7 @@ jobs: - stage: Test all os: linux compiler: gcc - env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc-6 + env: CONFIG=DefaultRelease LINUX=ubuntu-16.10 COMPILER=gcc install: - travis/install_linux.sh script: diff --git a/travis/build-helper.sh b/travis/build-helper.sh index 8d73c87e7..5e1b589e3 100755 --- a/travis/build-helper.sh +++ b/travis/build-helper.sh @@ -66,57 +66,17 @@ run() { export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" case $COMPILER in -gcc-4.8) - export CC=gcc-4.8 - export CXX=g++-4.8 - ;; - -gcc-4.9) - export CC=gcc-4.9 - export CXX=g++-4.9 - ;; - -gcc-5) - export CC=gcc-5 - export CXX=g++-5 - ;; - gcc-6) export CC=gcc-6 export CXX=g++-6 ;; -gcc-default) +gcc) export CC=gcc export CXX=g++ ;; -clang-3.5) - export CC=clang-3.5 - export CXX=clang++-3.5 - ;; - -clang-3.6) - export CC=clang-3.6 - export CXX=clang++-3.6 - ;; - -clang-3.7) - export CC=clang-3.7 - export CXX=clang++-3.7 - ;; - -clang-3.8) - export CC=clang-3.8 - export CXX=clang++-3.8 - ;; - -clang-3.9) - export CC=clang-3.9 - export CXX=clang++-3.9 - ;; - -clang-4.0) +clang-4) case "$OS" in linux) export CC=clang-4.0 @@ -130,7 +90,12 @@ clang-4.0) esac ;; -clang-default) +clang) + export CC=clang + export CXX=clang++ + ;; + +apple-clang) export CC=clang export CXX=clang++ ;; diff --git a/travis/generate_travis.py b/travis/generate_travis.py index 14e058a85..9fe6f82d0 100644 --- a/travis/generate_travis.py +++ b/travis/generate_travis.py @@ -2,14 +2,14 @@ # Configuration for Linux configs_linux = [ # OS, compiler - ("ubuntu-16.10", "gcc", "-6"), + ("ubuntu-16.10", "gcc", ""), #("debian-9", "gcc", "-6"), ] # Configurations for Mac configs_mac = [ # OS, compiler - ("osx", "clang", "-4.0"), + ("osx", "apple-clang", ""), ] # Build types @@ -41,6 +41,7 @@ if __name__ == "__main__": s += " only:\n" s += " - master\n" s += " - stable\n" + s += "sudo: required\n" s += "dist: trusty\n" s += "language: cpp\n" s += "\n" @@ -54,7 +55,6 @@ if __name__ == "__main__": s += "# Enable docker support\n" s += "services:\n" s += "- docker\n" - s += "sudo: required\n" s += "\n" s += "notifications:\n" diff --git a/travis/install_linux.sh b/travis/install_linux.sh index c7ef04886..62a7d75f6 100755 --- a/travis/install_linux.sh +++ b/travis/install_linux.sh @@ -8,4 +8,4 @@ then exit 0 fi -sudo apt-get install -qq -y docker +#sudo apt-get install -qq -y docker diff --git a/travis/install_osx.sh b/travis/install_osx.sh index 8d703a82a..e7fea4dec 100755 --- a/travis/install_osx.sh +++ b/travis/install_osx.sh @@ -18,8 +18,7 @@ install_brew_package() { brew outdated "$1" || brew upgrade "$@" else # Package not installed yet, install. - # If there are conflicts, try overwriting the files (these are in /usr/local anyway so it should be ok). - brew install "$@" || brew link --overwrite gcc49 + brew install "$@" || brew link --overwrite "$@" fi } @@ -40,19 +39,15 @@ install_brew_package md5sha1sum # For `timeout' install_brew_package coreutils -which cmake &>/dev/null || install_brew_package cmake +install_brew_package cmake # Install compiler case "${COMPILER}" in -gcc-4.8) install_brew_package gcc@4.8 ;; -gcc-4.9) install_brew_package gcc@4.9 ;; -gcc-5) install_brew_package gcc@5 ;; -gcc-6) install_brew_package gcc@6 ;; -clang-default) ;; -clang-3.7) install_brew_package llvm@3.7 --with-clang --with-libcxx;; -clang-3.8) install_brew_package llvm@3.8 --with-clang --with-libcxx;; -clang-3.9) install_brew_package llvm@3.9 --with-clang --with-libcxx;; -clang-4.0) install_brew_package llvm --with-clang --with-libcxx;; +gcc) install_brew_package gcc ;; +gcc-6) install_brew_package gcc@6 ;; +clang) install_brew_package llvm --with-clang --with-libcxx;; +clang-4) install_brew_package llvm@4 --with-clang --with-libcxx;; +apple-clang) ;; *) echo "Compiler not supported: ${COMPILER}. See travis/install_osx.sh"; exit 1 ;; esac travis_fold end brew_install_util