Update Travis CI configuration.
The Travis configuration: 1) Installs recent versions of clang and GCC. 2) Sets up the environment so that CMake picks up the installed compilers. Previously, the pre-installed clang compiler was used instead. 3) Requests a modern macOS image that has all the headers needed by GCC. The CL also removes now-unnecessary old workarounds from the Travis configuration. PiperOrigin-RevId: 245832795
This commit is contained in:
committed by
Chris Mumford
parent
877cc86f0e
commit
0af4349bf0
67
.travis.yml
67
.travis.yml
@@ -2,46 +2,39 @@
|
|||||||
# http://about.travis-ci.org/docs/user/build-configuration/
|
# http://about.travis-ci.org/docs/user/build-configuration/
|
||||||
# This file can be validated on: http://lint.travis-ci.org/
|
# This file can be validated on: http://lint.travis-ci.org/
|
||||||
|
|
||||||
dist: xenial
|
|
||||||
language: cpp
|
language: cpp
|
||||||
|
dist: xenial
|
||||||
|
osx_image: xcode10.2
|
||||||
|
|
||||||
compiler:
|
compiler:
|
||||||
- gcc
|
- gcc
|
||||||
- clang
|
- clang
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- BUILD_TYPE=Debug CPU_LEVEL=AVX
|
- BUILD_TYPE=Debug CPU_LEVEL=AVX
|
||||||
- BUILD_TYPE=Debug CPU_LEVEL=AVX2
|
- BUILD_TYPE=Debug CPU_LEVEL=AVX2
|
||||||
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX
|
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX
|
||||||
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
|
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
exclude:
|
exclude:
|
||||||
# GCC fails on recent Travis OSX images.
|
# Travis OSX servers seem to run on pre-Haswell CPUs. Attempting to use AVX2
|
||||||
# https://github.com/travis-ci/travis-ci/issues/9640
|
# results in crashes.
|
||||||
- compiler: gcc
|
- env: BUILD_TYPE=Debug CPU_LEVEL=AVX2
|
||||||
os: osx
|
os: osx
|
||||||
# Travis OSX servers seem to run on pre-Haswell CPUs. Attempting to use AVX2
|
- env: BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
|
||||||
# results in crashes.
|
os: osx
|
||||||
- env: BUILD_TYPE=Debug CPU_LEVEL=AVX2
|
|
||||||
os: osx
|
|
||||||
- env: BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
|
|
||||||
os: osx
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
# List of whitelisted in travis packages for ubuntu-trusty can be found here:
|
|
||||||
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-trusty
|
|
||||||
# List of whitelisted in travis apt-sources:
|
|
||||||
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
|
|
||||||
sources:
|
sources:
|
||||||
- llvm-toolchain-xenial-7
|
- llvm-toolchain-xenial-8
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- clang-7
|
- clang-8
|
||||||
- cmake
|
- cmake
|
||||||
- gcc-8
|
- gcc-8
|
||||||
- g++-8
|
- g++-8
|
||||||
@@ -50,18 +43,26 @@ addons:
|
|||||||
packages:
|
packages:
|
||||||
- cmake
|
- cmake
|
||||||
- gcc@8
|
- gcc@8
|
||||||
|
- llvm@8
|
||||||
- ninja
|
- ninja
|
||||||
|
update: true
|
||||||
before_install:
|
|
||||||
# The Travis VM image for Mac already has a link at /usr/local/include/c++,
|
|
||||||
# causing Homebrew's gcc installation to error out. This was reported to
|
|
||||||
# Homebrew maintainers at https://github.com/Homebrew/brew/issues/1742 and
|
|
||||||
# removing the link emerged as a workaround.
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then rm -f /usr/local/include/c++ ; fi
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# /usr/bin/gcc is stuck to old versions on both Linux and OSX.
|
# The following Homebrew packages aren't linked by default, and need to be
|
||||||
|
# prepended to the path explicitly.
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||||
|
export PATH="$(brew --prefix llvm)/bin:$PATH";
|
||||||
|
fi
|
||||||
|
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
|
||||||
- if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi
|
- if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi
|
||||||
|
# /usr/bin/clang points to an older compiler on both Linux and macOS.
|
||||||
|
#
|
||||||
|
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
|
||||||
|
# below don't work on macOS. Fortunately, the path change above makes the
|
||||||
|
# default values (clang and clang++) resolve to the correct compiler on macOS.
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
||||||
|
if [ "$CXX" = "clang++" ]; then export CXX="clang++-8" CC="clang-8"; fi;
|
||||||
|
fi
|
||||||
- echo ${CC}
|
- echo ${CC}
|
||||||
- echo ${CXX}
|
- echo ${CXX}
|
||||||
- ${CXX} --version
|
- ${CXX} --version
|
||||||
|
|||||||
Reference in New Issue
Block a user