-
Notifications
You must be signed in to change notification settings - Fork 20
/
.travis.yml
205 lines (171 loc) · 8.62 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
#TODO: container based build
# getting g++-4.9 in container build: http://stackoverflow.com/questions/29312015/building-with-more-than-one-version-of-a-compiler/32127147#32127147
stages:
- precache
- test
language: cpp
dist: xenial
sudo: required
os:
- linux
compiler:
- gcc
# - clang
env:
- TEST_SUITE=cuda MPI=none
- TEST_SUITE=tests MPI=none
- TEST_SUITE=parcel MPI=none
- TEST_SUITE=icicle MPI=none
- TEST_SUITE=KidA MPI=none
- TEST_SUITE=UWLCM_MT MPI=none
- TEST_SUITE=UWLCM_unit_iles MPI=none
- TEST_SUITE=UWLCM_unit_smg MPI=none
- TEST_SUITE=tests MPI=mvapich2
- TEST_SUITE=UWLCM_MT MPI=mvapich2
#TODO: MPI icicle test once libmpdata++ has mpi
#TODO: MPI UWLCM test once libmpdata++ and UWLCM have mpi
cache:
packages: true
pip: true
directories:
- ${TRAVIS_BUILD_DIR}/deps/mvapich2-2.3b
- ${TRAVIS_BUILD_DIR}/deps/boost
- ${TRAVIS_BUILD_DIR}/deps/hdf5
# define the precache stage
# empty phases mean that default phases (before_install, install, ...) from the test stage are used (?)
# TODO: precache stage has a lot of unnecessary before_install and install code common to the (default) test stage;
# add after_success, after_failure to precache, remove building of caches from the test stage, make the build error instead;
aliases:
# YAML alias for the options common to precache jobs
- &precache_tests_mpi
stage: precache
install:
- . ./.travis_scripts/deps_install/mpi_dependencies.sh
- . ./.travis_scripts/deps_install/boost.sh
script: echo "Preparing cache finished"
- &precache_uwlcm_mpi
stage: precache
install:
- . ./.travis_scripts/deps_install/mpi_dependencies.sh
- . ./.travis_scripts/deps_install/boost.sh
- . ./.travis_scripts/deps_install/mpi_hdf5.sh
script: echo "Preparing cache finished"
- &precache_boost
stage: precache
install:
- . ./.travis_scripts/deps_install/boost.sh
script: echo "Preparing cache finished"
jobs:
include:
- <<: *precache_tests_mpi
env: TEST_SUITE=tests MPI=mvapich2
compiler: gcc
# clang MPI_tests disabled due to issues with manually built boost python libstdc++ / libc++ issues
# - <<: *precache_default
# env: TEST_SUITE=MPI_tests
# compiler: clang
- <<: *precache_uwlcm_mpi
env: TEST_SUITE=UWLCM_MT MPI=mvapich2
- <<: *precache_boost
env: TEST_SUITE=tests MPI=none
- <<: *precache_boost
env: TEST_SUITE=KidA MPI=none
exclude:
- compiler: clang
env: TEST_SUITE=cuda MPI=none
- compiler: clang
env: TEST_SUITE=tests MPI=mvapich2
- compiler: clang
env: TEST_SUITE=UWLCM_MT MPI=mvapich2
# UWLCM is not tested on clang yet
- compiler: clang
env: TEST_SUITE=UWLCM_MT MPI=none
- compiler: clang
env: TEST_SUITE=UWLCM_unit_iles MPI=none
- compiler: clang
env: TEST_SUITE=UWLCM_unit_smg MPI=none
addons:
apt:
update: true
packages:
# - g++-7
# - gcc-7
# - clang-4.0
# - boost1.61
- python3-dev
- python3-pip
- python3-six
- python3-setuptools
- python3-numpy
# - python3-scipy
- libblitz0-dev
- libthrust-dev
- cmake # installs new cmake from kitware repo, NOTE: the travis cmake (v. 3.12) is still the default, hence we need to call full path to get the new cmake (e.g. /usr/bin/cmake) - a cmake env var added for that
sources: &sources
# - sourceline: 'ppa:mhier/libboost-latest'
- sourceline: 'ppa:rakhimov/boost'
- sourceline: 'deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe multiverse restricted'
- sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
# - ubuntu-toolchain-r-test
# - llvm-toolchain-xenial-4.0
before_install:
# if added in cuda, it upgrades to gcc-5.5, which is not supported by cuda 10-1
# - if [[ $TEST_SUITE != 'cuda' ]]; then sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"; fi
# define a compiler variable for use in if statements
- if [[ $CXX == 'clang++' ]]; then export COMPILER=clang++; fi
- if [[ $CXX == 'g++' ]]; then export COMPILER=g++; fi
- export apt_get_install="apt-get install -t xenial --no-install-recommends -y"
- export cmake="/usr/bin/cmake"
# cuda 10 installation, requires Boost >= 1.65.1
# - if [[ $TEST_SUITE == 'cuda' ]]; then wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_10.1.168-1_amd64.deb; fi
# - if [[ $TEST_SUITE == 'cuda' ]]; then sudo dpkg -i cuda-repo-ubuntu1604_10.1.168-1_amd64.deb; fi
# - if [[ $TEST_SUITE == 'cuda' ]]; then sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub; fi
# cuda 8 installation
- if [[ $TEST_SUITE == 'cuda' ]]; then wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb; fi
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb; fi
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo apt-get update; fi
# add runtime path to clang libomp
- if [[ $CXX == 'clang++' ]]; then export LD_LIBRARY_PATH=/usr/local/clang/lib/:$LD_LIBRARY_PATH; fi
# locally installed stuff comes first
- export PATH=/usr/local/bin:$PATH
install:
- if [[ ($TEST_SUITE == 'tests' || $TEST_SUITE == 'KidA') && $MPI == 'none' ]]; then . ./.travis_scripts/deps_install/boost.sh; fi
# order matters!
- if [[ $MPI != 'none' ]]; then . ./.travis_scripts/deps_install/mpi_dependencies.sh; fi
- if [[ $MPI != 'none' ]]; then . ./.travis_scripts/deps_install/boost.sh; fi
- if [[ $MPI != 'none' && $TEST_SUITE == 'UWLCM_MT' ]]; then . ./.travis_scripts/deps_install/mpi_hdf5.sh; fi
- sudo -H pip3 install --upgrade pip
- sudo -H pip3 install -U pytest --ignore-installed six
- sudo -H pip3 install -U numpy==1.18.5 --ignore-installed six # newer versions require python >= 3.6
- sudo -H pip3 install -U scipy==1.4.1 six # ditto
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo apt-get install -y cuda-toolkit-8-0; fi
- if [[ $TEST_SUITE == 'cuda' ]]; then export CUDA_HOME=/usr/local/cuda; fi
- if [[ $TEST_SUITE == 'cuda' ]]; then export PATH=${CUDA_HOME}/bin:${PATH}; fi
- if [[ $TEST_SUITE == 'KidA' ]]; then sudo $apt_get_install gfortran nco libnetcdf-dev libnetcdff-dev python3-cffi; fi
# boost from a package - only when no MPI and python bindings are not used (because of issues with boost_python3 pre 1.65) - definately in tests, not sure about parcel and KidA
- if [[ $MPI == 'none' && ($TEST_SUITE != 'tests' || $TEST_SUITE != 'KidA') ]]; then sudo $apt_get_install boost1.61; fi
# - if [[ $TEST_SUITE != 'MPI_UWLCM_MT' && $TEST_SUITE != 'MPI_tests' && $TRAVIS_OS_NAME == 'linux' ]]; then dpkg-query -L libboost-python1.61-dev; fi
# - if [[ $TEST_SUITE != 'MPI_UWLCM_MT' && $TEST_SUITE != 'MPI_tests' && $TRAVIS_OS_NAME == 'linux' ]]; then dpkg-query -L libboost-python1.61.0; fi
- if [[ $MPI == 'none' && ($TEST_SUITE != 'tests' || $TEST_SUITE != 'KidA') ]]; then sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_python-py35.so /usr/lib/x86_64-linux-gnu/libboost_python3.so; fi # different naming conventions for boost python with python 3
# thrust
- git clone --depth=1 git://github.com/thrust/thrust.git --branch 1.9.10-1;
- sudo ln -s `pwd`/thrust/thrust /usr/local/include/thrust;
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo ln -s `pwd`/thrust/thrust /usr/local/cuda/include/thrust; fi
before_script:
- chmod -R +x ./.travis_scripts/
script:
# compile with nvcc
- if [[ $TEST_SUITE == 'cuda' ]]; then . ./.travis_scripts/cuda.sh; fi # called like that to pass env vars
# unit tests and drops.py
- if [[ $TEST_SUITE == 'tests' ]]; then . ./.travis_scripts/tests.sh; fi
# parcel
- if [[ $TEST_SUITE == 'parcel' ]]; then . ./.travis_scripts/parcel.sh; fi
# icicle
- if [[ $TEST_SUITE == 'icicle' ]]; then . ./.travis_scripts/icicle.sh; fi
# UWLCM
- if [[ $TEST_SUITE == 'UWLCM_MT' ]]; then . ./.travis_scripts/UWLCM.sh moist_thermal; fi
- if [[ $TEST_SUITE == 'UWLCM_unit_iles' ]]; then . ./.travis_scripts/UWLCM.sh unit_iles; fi
- if [[ $TEST_SUITE == 'UWLCM_unit_smg' ]]; then . ./.travis_scripts/UWLCM.sh unit_smg; fi
# KiD-A 1D
- if [[ $TEST_SUITE == 'KidA' ]]; then . ./.travis_scripts/KidA.sh; fi