forked from scottbiersdorff/kokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
109 lines (96 loc) · 3.35 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
sudo: false
language: cpp
os:
- linux
compiler:
- gcc
- clang
cache:
- ccache
stages:
- canary
- test
jobs:
include:
- stage: canary
env: CMAKE_BUILD_TYPE=Release BACKEND="OPENMP"
os: linux
branches:
only:
- master
- develop
- /^release/
env:
-
# - BACKEND="OPENMP"
- BACKEND="PTHREAD"
- CMAKE_BUILD_TYPE=Debug COVERAGE=yes GTEST_FILTER="-*DeathTest*"
- CMAKE_BUILD_TYPE=Debug BACKEND="OPENMP" COVERAGE=yes GTEST_FILTER="-*DeathTest*"
# - CMAKE_BUILD_TYPE=Debug BACKEND="PTHREAD" COVERAGE=yes
- CMAKE_BUILD_TYPE=Release
- CMAKE_BUILD_TYPE=Release BACKEND="OPENMP"
# - CMAKE_BUILD_TYPE=Release BACKEND="PTHREAD"
matrix:
exclude:
- os: linux
compiler: gcc
env: CMAKE_BUILD_TYPE=Release BACKEND="OPENMP"
# Install newer CMake. The distribution comes with CMake 3.12.4 but we require at least 3.16
install:
- CMAKE_VERSION=3.17.1
- CMAKE_DIR=/opt/cmake
- CMAKE_KEY=2D2CEF1034921684 &&
CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} &&
CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh &&
CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt &&
wget --quiet ${CMAKE_URL}/${CMAKE_SHA256} &&
wget --quiet ${CMAKE_URL}/${CMAKE_SHA256}.asc &&
wget --quiet ${CMAKE_URL}/${CMAKE_SCRIPT} &&
#gpg --keyserver pool.sks-keyservers.net --recv-keys ${CMAKE_KEY} &&
#gpg --verify ${CMAKE_SHA256}.asc ${CMAKE_SHA256} &&
#grep ${CMAKE_SCRIPT} ${CMAKE_SHA256} | sha256sum --check &&
mkdir -p ${CMAKE_DIR} &&
sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} &&
rm cmake*
- PATH=${CMAKE_DIR}/bin:$PATH
- cd ${TRAVIS_BUILD_DIR}
before_script:
- ccache -z
- if [[ ${COVERAGE} ]]; then export CXX="${CXX} --coverage"; export BUILD_NAME_SUFFIX="-Coverage"; fi
- if [[ ! ${CMAKE_BUILD_TYPE} ]]; then export CXXFLAGS="${CXXFLAGS} -O2"; fi
script:
- export OMP_NUM_THREADS=2
- export OMP_PLACES=threads
- export OMP_PROC_BIND=spread
- export BUILD_JOBS=2
# LD_LIBRARY_PATH workaround to find clang's libomp: https://github.com/travis-ci/travis-ci/issues/8613
- if [[ ${CC} = clang ]]; then export LD_LIBRARY_PATH=/usr/local/clang/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH; fi
# enable ccache for clang on linux and add CCACHE_CPP2 to avoid 'Argument unused during compilation -I...' warning
- if [[ ${TRAVIS_OS_NAME} = linux && ${CC} = clang ]]; then
ln -s /usr/bin/ccache $HOME/bin/clang++;
export CCACHE_CPP2=yes;
fi
- cmake
${BACKEND:+-DKokkos_ENABLE_${BACKEND}=On}
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -Werror"
-DCMAKE_CXX_STANDARD=14
-DKokkos_ENABLE_COMPILER_WARNINGS=ON
-DKokkos_ENABLE_TESTS=On
${CMAKE_BUILD_TYPE:+-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}}
-DBUILD_NAME="${CC}-${BACKEND}${BUILD_NAME_SUFFIX}"
-DSITE=Travis
-P cmake/KokkosCI.cmake &&
pushd build &&
make install DESTDIR=${PWD}/install && rm -rf ${PWD}/install/usr/local && rmdir ${PWD}/install/usr &&
popd
after_success:
- ccache -s
- if [[ ${COVERAGE} ]]; then
mkdir -p $HOME/.local/bin && wget -O $HOME/.local/bin/codecov https://codecov.io/bash && chmod +x $HOME/.local/bin/codecov;
pushd build &&
if [[ ${CC} = clang* ]]; then
codecov -x "llvm-cov gcov" -F "${CC}";
else
codecov -x gcov -F "${CC}";
fi;
fi