travis: use clang-9
parent
60d820e042
commit
087221ac95
49
.travis.sh
49
.travis.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# common tasks before either build or test
|
# common tasks before either build or test
|
||||||
function prepare ()
|
function configure()
|
||||||
{
|
{
|
||||||
set -e # Make sure any error makes the script to return an error code
|
set -e # Make sure any error makes the script to return an error code
|
||||||
set -x # echo
|
set -x # echo
|
||||||
|
@ -14,21 +14,23 @@ function prepare ()
|
||||||
rm -fr $BUILD_DIR || true
|
rm -fr $BUILD_DIR || true
|
||||||
mkdir $BUILD_DIR && cd $BUILD_DIR
|
mkdir $BUILD_DIR && cd $BUILD_DIR
|
||||||
|
|
||||||
if [ -z "$CMAKE_BUILD_TYPE" ]; then
|
|
||||||
CMAKE_BUILD_TYPE=Debug
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$GTSAM_ALLOW_DEPRECATED_SINCE_V4" ]; then
|
|
||||||
GTSAM_ALLOW_DEPRECATED_SINCE_V4=OFF
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -z "$GCC_VERSION" ]; then
|
if [ ! -z "$GCC_VERSION" ]; then
|
||||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 60 \
|
export CC=gcc-$GCC_VERSION
|
||||||
--slave /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION
|
export CXX=g++-$GCC_VERSION
|
||||||
sudo update-alternatives --set gcc /usr/bin/gcc-$GCC_VERSION
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# GTSAM_BUILD_WITH_MARCH_NATIVE=OFF: to avoid crashes in builder VMs
|
||||||
|
cmake $SOURCE_DIR \
|
||||||
|
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} \
|
||||||
|
-DGTSAM_BUILD_TESTS=${GTSAM_BUILD_TESTS:-OFF} \
|
||||||
|
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
|
||||||
|
-DGTSAM_BUILD_EXAMPLES_ALWAYS=${GTSAM_BUILD_EXAMPLES_ALWAYS:-ON} \
|
||||||
|
-DGTSAM_ALLOW_DEPRECATED_SINCE_V4=${GTSAM_ALLOW_DEPRECATED_SINCE_V4:-OFF} \
|
||||||
|
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
|
||||||
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# common tasks after either build or test
|
# common tasks after either build or test
|
||||||
function finish ()
|
function finish ()
|
||||||
{
|
{
|
||||||
|
@ -41,17 +43,12 @@ function finish ()
|
||||||
# compile the code with the intent of populating the cache
|
# compile the code with the intent of populating the cache
|
||||||
function build ()
|
function build ()
|
||||||
{
|
{
|
||||||
prepare
|
export GTSAM_BUILD_EXAMPLES_ALWAYS=ON
|
||||||
|
export GTSAM_BUILD_TESTS=OFF
|
||||||
|
|
||||||
cmake $SOURCE_DIR \
|
configure
|
||||||
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
|
|
||||||
-DGTSAM_BUILD_TESTS=OFF \
|
|
||||||
-DGTSAM_BUILD_UNSTABLE=$GTSAM_BUILD_UNSTABLE \
|
|
||||||
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON \
|
|
||||||
-DGTSAM_ALLOW_DEPRECATED_SINCE_V4=$GTSAM_ALLOW_DEPRECATED_SINCE_V4
|
|
||||||
|
|
||||||
# Actual build:
|
make -j2
|
||||||
VERBOSE=1 make -j2
|
|
||||||
|
|
||||||
finish
|
finish
|
||||||
}
|
}
|
||||||
|
@ -59,14 +56,10 @@ function build ()
|
||||||
# run the tests
|
# run the tests
|
||||||
function test ()
|
function test ()
|
||||||
{
|
{
|
||||||
prepare
|
export GTSAM_BUILD_EXAMPLES_ALWAYS=OFF
|
||||||
|
export GTSAM_BUILD_TESTS=ON
|
||||||
|
|
||||||
cmake $SOURCE_DIR \
|
configure
|
||||||
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
|
|
||||||
-DGTSAM_BUILD_TESTS=ON \
|
|
||||||
-DGTSAM_BUILD_UNSTABLE=$GTSAM_BUILD_UNSTABLE \
|
|
||||||
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
|
|
||||||
-DGTSAM_ALLOW_DEPRECATED_SINCE_V4=OFF
|
|
||||||
|
|
||||||
# Actual build:
|
# Actual build:
|
||||||
make -j2 check
|
make -j2 check
|
||||||
|
|
80
.travis.yml
80
.travis.yml
|
@ -7,11 +7,12 @@ addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
- sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||||
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
packages:
|
packages:
|
||||||
- g++-8
|
- g++-9
|
||||||
- clang-3.8
|
- clang-9
|
||||||
- build-essential
|
- build-essential pkg-config
|
||||||
- pkg-config
|
|
||||||
- cmake
|
- cmake
|
||||||
- libpython-dev python-numpy
|
- libpython-dev python-numpy
|
||||||
- libboost-all-dev
|
- libboost-all-dev
|
||||||
|
@ -28,8 +29,14 @@ stages:
|
||||||
- compile
|
- compile
|
||||||
- test
|
- test
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- MAKEFLAGS="-j2"
|
||||||
|
- CCACHE_SLOPPINESS=pch_defines,time_macros
|
||||||
|
|
||||||
# Compile stage without building examples/tests to populate the caches.
|
# Compile stage without building examples/tests to populate the caches.
|
||||||
jobs:
|
jobs:
|
||||||
|
# -------- STAGE 1: COMPILE -----------
|
||||||
include:
|
include:
|
||||||
# on Mac, GCC
|
# on Mac, GCC
|
||||||
- stage: compile
|
- stage: compile
|
||||||
|
@ -68,46 +75,45 @@ jobs:
|
||||||
- stage: compile
|
- stage: compile
|
||||||
os: linux
|
os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF
|
env: CC=clang-9 CXX=clang++-9 CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF
|
||||||
script: bash .travis.sh -b
|
script: bash .travis.sh -b
|
||||||
- stage: compile
|
- stage: compile
|
||||||
os: linux
|
os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: CMAKE_BUILD_TYPE=Release
|
env: CC=clang-9 CXX=clang++-9 CMAKE_BUILD_TYPE=Release
|
||||||
script: bash .travis.sh -b
|
script: bash .travis.sh -b
|
||||||
# on Linux, with deprecated ON to make sure that path still compiles
|
# on Linux, with deprecated ON to make sure that path still compiles
|
||||||
- stage: compile
|
- stage: compile
|
||||||
os: linux
|
os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF GTSAM_ALLOW_DEPRECATED_SINCE_V4=ON
|
env: CC=clang-9 CXX=clang++-9 CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF GTSAM_ALLOW_DEPRECATED_SINCE_V4=ON
|
||||||
script: bash .travis.sh -b
|
script: bash .travis.sh -b
|
||||||
|
# -------- STAGE 2: TESTS -----------
|
||||||
# Matrix configuration:
|
# on Mac, GCC
|
||||||
os:
|
- stage: test
|
||||||
- osx
|
os: osx
|
||||||
- linux
|
compiler: clang
|
||||||
compiler:
|
env: CMAKE_BUILD_TYPE=Release
|
||||||
- gcc
|
script: bash .travis.sh -t
|
||||||
- clang
|
- stage: test
|
||||||
env:
|
os: osx
|
||||||
global:
|
compiler: clang
|
||||||
- MAKEFLAGS="-j2"
|
env: CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF
|
||||||
- CCACHE_SLOPPINESS=pch_defines,time_macros
|
script: bash .travis.sh -t
|
||||||
- GTSAM_ALLOW_DEPRECATED_SINCE_V4=OFF
|
- stage: test
|
||||||
- GTSAM_BUILD_UNSTABLE=ON
|
os: linux
|
||||||
matrix:
|
compiler: gcc
|
||||||
- CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF
|
env: CMAKE_BUILD_TYPE=Release
|
||||||
- CMAKE_BUILD_TYPE=Release
|
script: bash .travis.sh -t
|
||||||
script:
|
# Exclude g++ debug on Linux as it consistently times out
|
||||||
- bash .travis.sh -t
|
# - stage: test
|
||||||
|
# os: linux
|
||||||
matrix:
|
# compiler: gcc
|
||||||
exclude:
|
# env: CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF
|
||||||
# Exclude g++ debug on Linux as it consistently times out
|
# script: bash .travis.sh -t
|
||||||
- os: linux
|
# Exclude clang on Linux/clang in release until issue #57 is solved
|
||||||
compiler: gcc
|
# - stage: test
|
||||||
env : CMAKE_BUILD_TYPE=Debug GTSAM_BUILD_UNSTABLE=OFF
|
# os: linux
|
||||||
# Exclude clang on Linux/clang in release until issue #57 is solved
|
# compiler: clang
|
||||||
- os: linux
|
# env: CC=clang-9 CXX=clang++-9 CMAKE_BUILD_TYPE=Release
|
||||||
compiler: clang
|
# script: bash .travis.sh -t
|
||||||
env : CMAKE_BUILD_TYPE=Release
|
|
||||||
|
|
|
@ -434,7 +434,7 @@ add_subdirectory(timing)
|
||||||
# Build gtsam_unstable
|
# Build gtsam_unstable
|
||||||
if (GTSAM_BUILD_UNSTABLE)
|
if (GTSAM_BUILD_UNSTABLE)
|
||||||
add_subdirectory(gtsam_unstable)
|
add_subdirectory(gtsam_unstable)
|
||||||
endif(GTSAM_BUILD_UNSTABLE)
|
endif()
|
||||||
|
|
||||||
# Matlab toolbox
|
# Matlab toolbox
|
||||||
if (GTSAM_INSTALL_MATLAB_TOOLBOX)
|
if (GTSAM_INSTALL_MATLAB_TOOLBOX)
|
||||||
|
|
Loading…
Reference in New Issue