forked from openPMD/openPMD-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
341 lines (336 loc) · 10.9 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
sudo: required
dist: trusty
cache:
apt: true
directories:
- $HOME/.cache/spack
- $HOME/.cache/cmake-3.10.0
- $HOME/Library/Caches/Homebrew
pip: true
env:
global:
- BUILD: ~/buildTmp
- CXXFLAGS: "-std=c++11"
- SPACK_ROOT: $HOME/.cache/spack
- PATH: $PATH:$HOME/.cache/spack/bin
addons:
apt:
&apt_common_sources
sources:
- ubuntu-toolchain-r-test
jobs:
fast_finish: true
include:
###########################################################################
# Stage: Style #
###########################################################################
- &style_python
stage: 'Style'
language: python
python: "2.7"
install: pip install -U flake8
script:
# Test Python Files for PEP8 conformance
- flake8 --exclude=thirdParty .
- <<: *style_python
python: "3.6"
# TODO: C++ clang-format checks
###########################################################################
# Stage: Static Code Analysis #
###########################################################################
- &static_code_python
stage: 'Static Code Analysis'
language: python
python: "2.7"
install: pip install -U pyflakes
script:
# Warnings, unused code, etc.
- pyflakes docs/ examples/ test/
- <<: *static_code_python
python: "3.6"
###########################################################################
# Stage: C++ Unit Tests #
###########################################################################
# Clang 5.0.0
- &test-cpp-unit
stage: 'C++ Unit Tests'
language: cpp
env:
- USE_MPI=OFF USE_PYTHON=OFF USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: clang
addons:
apt:
<<: *apt_common_sources
packages: &clang50_deps
- environment-modules
- gfortran-4.9
- g++-4.9 # CMake build
before_install: &clang50_init
- COMPILERSPEC="%[email protected]"
script: &script-cpp-unit
- mkdir -p $HOME/build
- cd $HOME/build
- if [ ! -d samples/git-sample/ ]; then
if [ "$USE_SAMPLES" = "ON" ]; then
$TRAVIS_BUILD_DIR/.travis/download_samples.sh;
fi
fi
- if [ "$USE_PYTHON" == "ON" ]; then
export EXTRA_CMAKE_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=$(which python)";
if [ "$USE_INTERNAL_PYBIND11" == "OFF" ]; then
export EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DopenPMD_USE_INTERNAL_PYBIND11=OFF";
fi;
fi
- CXXFLAGS="-Werror" CXX=$CXX CC=$CC
cmake
-DCMAKE_BUILD_TYPE=Debug
-DopenPMD_USE_MPI=$USE_MPI
-DopenPMD_USE_HDF5=$USE_HDF5
-DopenPMD_USE_ADIOS1=$USE_ADIOS1
-DopenPMD_USE_ADIOS2=$USE_ADIOS2
-DopenPMD_USE_PYTHON=$USE_PYTHON
$EXTRA_CMAKE_FLAGS
-DCMAKE_INSTALL_PREFIX=$HOME/openPMD-test-install
$TRAVIS_BUILD_DIR
- make -j 2
- CTEST_OUTPUT_ON_FAILURE=1 make test
- make install
# - make package
# - dpkg -i openPMD*.deb
- ls -R $HOME/openPMD-test-install | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
- <<: *test-cpp-unit
language: python
python: "2.7"
env:
- USE_MPI=ON USE_PYTHON=OFF USE_HDF5=ON USE_ADIOS1=ON USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: clang
addons:
apt:
<<: *apt_common_sources
packages:
- *clang50_deps
- libopenmpi-dev
- openmpi-bin
before_install: *clang50_init
script: *script-cpp-unit
# Clang 8.1.0-apple + Python 2.7.10 @ OSX
- <<: *test-cpp-unit
os: osx
language: generic
env:
- USE_MPI=OFF USE_PYTHON=ON USE_HDF5=ON USE_ADIOS1=ON USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: clang
before_install:
- COMPILERSPEC="%[email protected]"
script: *script-cpp-unit
# GCC 4.9.4
- <<: *test-cpp-unit
language: python
python: "2.7"
env:
- USE_MPI=OFF USE_PYTHON=OFF USE_HDF5=ON USE_ADIOS1=ON USE_ADIOS2=OFF USE_SAMPLES=OFF
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages: &gcc49_deps
- environment-modules
- gfortran-4.9
- gcc-4.9
- g++-4.9
before_install: &gcc49_init
- CXX=g++-4.9 && CC=gcc-4.9 && COMPILERSPEC="%[email protected]"
script: *script-cpp-unit
- <<: *test-cpp-unit
language: python
python: "2.7"
env:
- USE_MPI=ON USE_PYTHON=OFF USE_HDF5=ON USE_ADIOS1=ON USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages:
- *gcc49_deps
- libopenmpi-dev
- openmpi-bin
before_install: *gcc49_init
script: *script-cpp-unit
# GCC 7.3.0
- <<: *test-cpp-unit
language: python
python: "2.7"
env:
- USE_MPI=OFF USE_PYTHON=OFF USE_HDF5=ON USE_ADIOS1=ON USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages: &gcc73_deps
- environment-modules
- gfortran-7
- gcc-7
- g++-7
before_install: &gcc73_init
- CXX=g++-7 && CC=gcc-7 && COMPILERSPEC="%[email protected]"
script: *script-cpp-unit
- <<: *test-cpp-unit
language: python
python: "2.7"
env:
- USE_MPI=ON USE_PYTHON=OFF USE_HDF5=ON USE_ADIOS1=ON USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages:
- *gcc73_deps
- libopenmpi-dev
- openmpi-bin
before_install: *gcc73_init
script: *script-cpp-unit
# GCC 6.4.0 + Python 2.7
- <<: *test-cpp-unit
language: python
python: "2.7"
env:
- USE_MPI=OFF USE_PYTHON=ON USE_HDF5=ON USE_ADIOS1=ON [email protected] USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages: &gcc64_deps
- environment-modules
- gfortran-6
- gcc-6
- g++-6
before_install: &gcc64_init
- CXX=g++-6 && CC=gcc-6 && COMPILERSPEC="%[email protected]"
script: *script-cpp-unit
# GCC 6.4.0 + Python 3.6
- <<: *test-cpp-unit
language: python
python: "3.6"
env:
- USE_MPI=OFF USE_PYTHON=ON USE_INTERNAL_PYBIND11=OFF USE_HDF5=ON [email protected] USE_ADIOS1=OFF USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages:
- *gcc64_deps
before_install: *gcc64_init
script: *script-cpp-unit
# GCC 4.8.5 + Python 3.5.5
- <<: *test-cpp-unit
language: python
python: "3.5"
env:
- USE_MPI=OFF USE_PYTHON=ON USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF USE_SAMPLES=ON
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages:
- environment-modules
- gfortran
- g++
- libopenmpi-dev
- openmpi-bin
before_install: &gcc48_init
- CXX=g++-4.8 && CC=gcc-4.8 && COMPILERSPEC="%[email protected]"
script: *script-cpp-unit
install:
# spack install
- SPACK_FOUND=$(which spack >/dev/null && { echo 0; } || { echo 1; })
- if [ $SPACK_FOUND -ne 0 ]; then
mkdir -p $SPACK_ROOT &&
git clone --depth 50 https://github.com/spack/spack.git $SPACK_ROOT;
fi
# spack setup
- source /etc/profile
- cp $TRAVIS_BUILD_DIR/.travis/spack/*.yaml
$SPACK_ROOT/etc/spack/
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
travis_wait brew install modules &&
brew info modules &&
source /usr/local/opt/modules/init/bash &&
export TRAVIS_PYTHON_VERSION=2.7.10;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then
export TRAVIS_PYTHON_VERSION=2.7.14;
fi;
fi
- source $SPACK_ROOT/share/spack/setup-env.sh
# fresh (cache-cleaned) travis runs seem to not properly init environment-modules
- echo $MODULEPATH
- if [[ ! $MODULEPATH = *"spack"* ]]; then
export MODULEPATH=$SPACK_ROOT/share/spack/modules/$(spack arch):$MODULEPATH;
fi
- SPACK_VAR_MPI="~mpi";
# required dependencies - CMake 3.10.0
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ ! -f $HOME/.cache/cmake-3.10.0/bin/cmake ]; then
wget -O cmake.sh https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh &&
sh cmake.sh --skip-license --exclude-subdir --prefix=$HOME/.cache/cmake-3.10.0 &&
rm cmake.sh;
fi;
else
if [ ! -d /Applications/CMake.app/Contents/ ]; then
curl -L -s -o cmake.dmg https://cmake.org/files/v3.10/cmake-3.10.0-Darwin-x86_64.dmg &&
yes | hdiutil mount cmake.dmg &&
sudo cp -R "/Volumes/cmake-3.10.0-Darwin-x86_64/CMake.app" /Applications &&
hdiutil detach /dev/disk1s1 &&
rm cmake.dmg;
fi;
fi
- spack install
$COMPILERSPEC
- spack load [email protected] $COMPILERSPEC
# diagnostics: modules created and visible?
- module av
- module li
# optional dependencies - MPI, HDF5, ADIOS1, ADIOS2
- if [ $USE_MPI == "ON" ]; then
travis_wait spack install
$COMPILERSPEC &&
spack load [email protected] $COMPILERSPEC;
SPACK_VAR_MPI="+mpi";
fi
- if [ $USE_PYTHON == "ON" ]; then
travis_wait spack install
python@$TRAVIS_PYTHON_VERSION
$COMPILERSPEC &&
spack load python@$TRAVIS_PYTHON_VERSION $COMPILERSPEC;
if [ "$USE_INTERNAL_PYBIND11" == "OFF" ]; then
travis_wait spack install
[email protected] ^python@$TRAVIS_PYTHON_VERSION
$COMPILERSPEC &&
spack load [email protected] ^python@$TRAVIS_PYTHON_VERSION $COMPILERSPEC;
fi;
fi
- if [ $USE_HDF5 == "ON" ]; then
travis_wait spack install
hdf5$HDF5_VERSION
$SPACK_VAR_MPI
$COMPILERSPEC &&
spack load hdf5$HDF5_VERSION $SPACK_VAR_MPI $COMPILERSPEC;
fi
- if [ $USE_ADIOS1 == "ON" ]; then
travis_wait spack install
adios$ADIOS1_VERSION
$SPACK_VAR_MPI ^python@$TRAVIS_PYTHON_VERSION
$COMPILERSPEC &&
spack load adios$ADIOS1_VERSION $SPACK_VAR_MPI ^python@$TRAVIS_PYTHON_VERSION $COMPILERSPEC;
fi
- if [ $USE_ADIOS2 == "ON" ]; then
travis_wait spack install
adios2
$SPACK_VAR_MPI
$COMPILERSPEC &&
spack load adios2 $SPACK_VAR_MPI $COMPILERSPEC;
fi
- spack clean -a