forked from ecmwf/atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
257 lines (225 loc) · 8.64 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
language: cpp
cache:
directories:
- ${HOME}/deps/cmake
- ${HOME}/deps/openmpi
- ${HOME}/deps/mpich
- ${HOME}/deps/eckit
- ${HOME}/deps/fckit
jobs:
include:
- os: linux
compiler: clang
env:
- CACHE_NAME=linux-clang38-mpich
- CXX_COMPILER='clang++-3.8' C_COMPILER='clang-3.8' Fortran_COMPILER='gfortran'
- MPI='mpich'
- ATLAS_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG"
addons:
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'gfortran']
- os: linux
compiler: gcc
env:
- CACHE_NAME=linux-gcc5-openmpi
- CXX_COMPILER='g++-5' C_COMPILER='gcc-5' Fortran_COMPILER='gfortran-5'
- MPI='openmpi'
- ATLAS_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'gcc-5', 'gfortran-5', 'libfftw3-dev']
- os: linux
compiler: gcc
env:
- CACHE_NAME=linux-gcc7-mpich
- CXX_COMPILER='g++-7' C_COMPILER='gcc-7' Fortran_COMPILER='gfortran-7'
- MPI='mpich'
- ATLAS_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_GPROF=ON"
- COVERAGE=ON
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'gcc-7', 'gfortran-7', 'libfftw3-dev', 'lcov']
- os: osx
env:
- CACHE_NAME=osx-clang-openmpi
- CXX_COMPILER='clang++' C_COMPILER='clang' Fortran_COMPILER='gfortran'
- MPI=openmpi
- ATLAS_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG"
- ATLAS_CTEST_OPTIONS="-E atlas_test_stencil_parallel_mpi16"
osx_image: xcode12
- os: osx
env:
- CACHE_NAME=osx-clang-mpich
- CXX_COMPILER='clang++' C_COMPILER='clang' Fortran_COMPILER='gfortran'
- MPI=mpich
osx_image: xcode12
- os: linux
compiler: gcc
env:
- CACHE_NAME=linux-pgi-openmpi
- CXX_COMPILER='pgc++' C_COMPILER='pgcc' Fortran_COMPILER='pgfortran'
- MPI='openmpi'
- PGI_VERSION="CommunityEdition"
- ECKIT_CMAKE_OPTIONS="-DENABLE_ECKIT-395=OFF -DRT_LIB=/usr/lib/x86_64-linux-gnu/librt.so -DCURSES_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurses.so -DMPI_ARGS=--oversubscribe"
- ATLAS_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DMPI_ARGS=--oversubscribe"
before_install:
#################################################################
# Set compilers
#################################################################
- |
### Set compilers
export CC=${C_COMPILER}
export CXX=${CXX_COMPILER}
export FC=${Fortran_COMPILER}
- |
### Load scripts
source ${TRAVIS_BUILD_DIR}/tools/source-me.sh
install:
#################################################################
# All dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
#################################################################
- DEPS_DIR=${HOME}/deps
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- |
DEPS_BRANCH="master"
if [[ "${TRAVIS_BRANCH}" != "master" ]]; then
DEPS_BRANCH="develop"
fi
#################################################################
# Install Compilers
#################################################################
- |
### Install gcc (homebrew)
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export HOMEBREW_NO_AUTO_UPDATE=1
brew install gcc
brew link gcc
fi
- |
### Install PGI community edition
if [[ "${PGI_VERSION:-notset}" == "CommunityEdition" ]]; then
install-pgi.sh --prefix ${DEPS_DIR}/pgi
source ${DEPS_DIR}/pgi/env.sh
fi
#################################################################
# Install MPI
#################################################################
- |
### Install MPI
install-mpi.sh ${MPI}
source ${DEPS_DIR}/${MPI}/env.sh
echo "${MPI_HOME}"
echo "${PATH}"
#################################################################
# Install CMake
#################################################################
- |
### Install CMake
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_VERSION=3.18.4
if [[ -z "$(ls -A ${DEPS_DIR}/cmake)" ]]; then
if [[ "${TRAVIS_ARCH}" == "amd64" ]]; then
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
mkdir -p ${DEPS_DIR}/cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake
fi
if [[ "${TRAVIS_ARCH}" = "ppc64le" ]]; then
# Build from source
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}.tar.gz"
mkdir -p ${DEPS_DIR}/cmake-source && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake-source
(
cd ${DEPS_DIR}/cmake-source
mkdir -p build && cd build
../bootstrap --prefix=${DEPS_DIR}/cmake && make -j4 install
)
fi
else
echo "CMake already found in cache"
fi
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew upgrade cmake || brew install cmake
brew install openssl
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
fi
cmake --version
#################################################################
# Install FFTW
#################################################################
# - |
# ### Install FFTW
# if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# brew ls --versions fftw || brew install fftw
# fi
#################################################################
# Install CGAL
#################################################################
# - |
# ### Install CGAL
# if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# brew ls --versions cgal || brew install cgal
# fi
#################################################################
# Install ecbuild
#################################################################
- |
### Install ecbuild
git clone --depth 1 -b ${DEPS_BRANCH} https://github.com/ecmwf/ecbuild ${DEPS_DIR}/ecbuild
export PATH=${DEPS_DIR}/ecbuild/bin:${PATH}
export ECBUILD_MODULE_PATH=${DEPS_DIR}/ecbuild/cmake
ecbuild --version
#################################################################
# Install eckit
#################################################################
- |
### Install eckit
install-dep.sh --repo eckit --branch ${DEPS_BRANCH} --prefix ${DEPS_DIR}/eckit --cmake "-DENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=DEBUG ${ECKIT_CMAKE_OPTIONS}"
- export ECKIT_PATH=${DEPS_DIR}/eckit
- ${DEPS_DIR}/eckit/bin/eckit-version
#################################################################
# Install fckit
#################################################################
- |
### Install fckit
install-dep.sh --repo fckit --branch ${DEPS_BRANCH} --prefix ${DEPS_DIR}/fckit --cmake "-DENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=DEBUG" --depends "eckit"
- export FCKIT_PATH=${DEPS_DIR}/fckit
script:
#################################################################
# Environment variables
#################################################################
- echo ${CXX}
- echo ${CC}
- echo ${FC}
- echo ${MPI_HOME}
- echo ${PATH}
- |
ATLAS_SOURCE_DIR=${TRAVIS_BUILD_DIR}
ATLAS_BUILD_DIR=${TRAVIS_BUILD_DIR}/builds/atlas
#################################################################
# Build Atlas
#################################################################
- mkdir -p ${ATLAS_BUILD_DIR} && cd ${ATLAS_BUILD_DIR}
- cmake -DCMAKE_MODULE_PATH=${ECBUILD_MODULE_PATH} ${ATLAS_CMAKE_OPTIONS} ${ATLAS_SOURCE_DIR}
- make -j$(nproc)
- bin/atlas --info
#################################################################
# Test Atlas
#################################################################
- ATLAS_TRACE=1 ATLAS_DEBUG=1 ctest --output-on-failure --timeout 300 ${ATLAS_CTEST_OPTIONS}
after_success:
- |
if [[ "${COVERAGE}" == "ON" ]]; then
# Creating report
cd ${ATLAS_BUILD_DIR}
lcov --directory . --capture --output-file coverage.info # capture coverage info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
lcov --list coverage.info #debug info
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -t 9c489980-d292-499c-8615-af02df3b20d1 || echo "Codecov did not collect coverage reports"
fi
after_failure:
- cd ${ATLAS_BUILD_DIR}
- ATLAS_TRACE=1 ctest -VV --rerun-failed --timeout 60 ${ATLAS_CTEST_OPTIONS}
- cat ecbuild.log