-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
136 lines (125 loc) · 4.42 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
language: cpp
# against hwloc error (travis-ci/travis-ci#10019)
sudo: required
stages:
- canary
- test
jobs:
include:
- stage: canary
env: BACKENDS="OpenMP" WERROR=ON
env:
global:
- CCACHE_CPP2=yes # for clang
matrix: # note this matrix only applies to the "test" stage
- BACKENDS="OPENMP" WERROR=ON CMAKE_BUILD_TYPE=Release
- BACKENDS="SERIAL" WERROR=ON CMAKE_BUILD_TYPE=Release
- BACKENDS="SERIAL OpenMP" WERROR=ON CMAKE_BUILD_TYPE=Release
- BACKENDS="OPENMP" COVERAGE=ON HYPRE=ON CMAKE_BUILD_TYPE=Debug
- BACKENDS="SERIAL" COVERAGE=ON HYPRE=ON CMAKE_BUILD_TYPE=Debug
before_script:
- sudo ln -s /usr/bin/ccache /usr/lib/ccache/clang++
- ccache -z
- KOKKOS_OPTS=( --with-hwloc=/usr --gcc-toolchain=/usr )
- for i in ${BACKENDS}; do KOKKOS_OPTS+=( --with-${i,,[A-Z]} ); done
# LD_LIBRARY_PATH workaround for 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; export OMPI_CXX=clang++; export OMPI_CC=clang; export OMPI_FC=gfortran-6; export CXX=mpicxx; export CC=mpicc; export FC=mpif90; fi
- if [[ ${CC} = gcc ]]; then export OMPI_CXX=g++-6; export OMPI_CC=gcc-6; export OMPI_FC=gfortran-6; export CXX=mpicxx; export CC=mpicc; export FC=mpif90; fi
- git clone --depth=1 https://github.com/kokkos/kokkos.git &&
pushd kokkos &&
mkdir build &&
pushd build &&
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kokkos ${KOKKOS_OPTS[@]} .. &&
make -j2 &&
make install &&
popd &&
popd
- if [[ ${HYPRE} ]]; then
git clone --depth=1 https://github.com/hypre-space/hypre.git &&
pushd hypre &&
git fetch --all --tags &&
git checkout v2.18.2 &&
pushd src &&
./configure --prefix=$HOME/hypre &&
make -j2 &&
make install &&
popd &&
popd;
fi
- if [[ ${HEFFTE} ]]; then
git clone --depth=1 https://bitbucket.org/icl/heffte.git &&
pushd heffte &&
mkdir build &&
pushd build &&
cmake -DCMAKE_INSTALL_PREFIX="$HOME/heffte" -DFFTW_USE_STATIC_LIBS=ON -DBUILD_GPU=OFF .. &&
make -j2 VERBOSE=1&&
make install &&
popd &&
popd;
fi
- if [[ ${COVERAGE} ]]; then
pip install --user coverxygen &&
mkdir -p $HOME/.local/bin && wget -O $HOME/.local/bin/codecov https://codecov.io/bash && chmod +x $HOME/.local/bin/codecov;
fi
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libhwloc-dev
- openmpi-bin
- libopenmpi-dev
- libgsl0-dev
- python-pip
- g++-6
- gfortran-6
- libfftw3-dev
script:
- export CXXFLAGS="-Wall -Wextra -pedantic ${WERROR:+-Werror}"
- export FFLAGS="-Wall -Wextra -pedantic ${WERROR:+-Werror}"
- mkdir build && pushd build &&
cmake -DCMAKE_PREFIX_PATH="$HOME/kokkos;$HOME/hypre;$HOME/heffte"
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
${CMAKE_OPTS[@]}
-DCajita_ENABLE_TESTING=ON
${CMAKE_BUILD_TYPE:+-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}}
${COVERAGE:+-DCajita_ENABLE_COVERAGE_BUILD=ON} .. &&
make -k -j2 VERBOSE=1 &&
make test CTEST_OUTPUT_ON_FAILURE=1 &&
make format && git diff --exit-code &&
make install DESTDIR=${PWD}/install && rm -rf ${PWD}/install/usr/local && rmdir ${PWD}/install/usr &&
popd
after_success:
- ccache -s
- test "${TRAVIS_BUILD_STAGE_NAME}" = "Test" || travis_terminate 0
- if [[ ${COVERAGE} ]]; then
pushd build &&
if [[ ${CC} = clang ]]; then
codecov -x "llvm-cov gcov" -F "${CC}";
else
codecov -x gcov-6 -F "${CC}";
fi &&
popd;
fi
- if [[ ${TRAVIS_JOB_NUMBER} = *.2 ]]; then
git fetch origin gh-pages && git checkout -b gh-pages FETCH_HEAD &&
if [[ ${TRAVIS_BRANCH} = master && ${encrypted_de2ca53a1b69_key} && ${encrypted_de2ca53a1b69_iv} && ${TRAVIS_PULL_REQUEST} == false ]]; then
git config --global user.name "Automatic Deployment (Travis CI)";
git config --global user.email "[email protected]";
git commit -m "Documentation Update";
openssl aes-256-cbc -K $encrypted_de2ca53a1b69_key -iv $encrypted_de2ca53a1b69_iv -in deploy.enc -out ~/.ssh/id_rsa -d;
chmod 600 ~/.ssh/id_rsa;
git push [email protected]:${TRAVIS_REPO_SLUG} gh-pages:gh-pages;
else
git status;
git diff --cached --no-color | head -n 500;
fi;
fi
branches:
only:
- master
cache:
- ccache
compiler:
- gcc
- clang