forked from igfuw/libcloudphxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
185 lines (152 loc) · 9.97 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
#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
language: cpp
dist: xenial
sudo: required
os:
- linux
# - osx
compiler:
- gcc
- clang
env:
- TEST_SUITE=cuda
- TEST_SUITE=tests
- TEST_SUITE=parcel
- TEST_SUITE=icicle
- TEST_SUITE=KidA
- TEST_SUITE=UWLCM_MT
- TEST_SUITE=UWLCM_unit_iles
- TEST_SUITE=UWLCM_unit_smg
matrix:
exclude:
- os: osx
compiler: gcc
- os: osx
env: TEST_SUITE=KidA
- compiler: clang
env: TEST_SUITE=cuda
# UWLCM is not tested on clang yet
- compiler: clang
env: TEST_SUITE=UWLCM_MT
- compiler: clang
env: TEST_SUITE=UWLCM_unit_iles
- compiler: clang
env: TEST_SUITE=UWLCM_unit_smg
addons:
apt:
packages:
# - g++-7
# - gcc-7
- clang-4.0
- boost1.61
sources: &sources
- sourceline: 'ppa:rakhimov/boost'
# - 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 [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'clang++' ]]; then export COMPILER=clang++; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export COMPILER=g++; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export COMPILER=clang++; fi # only clang on osx
# to avoid python lib/interpreter mismatch; https://github.com/travis-ci/travis-ci/issues/5326
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe multiverse restricted"; fi
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test" ; fi
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install -t trusty --no-install-recommends -y"; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install -t xenial --no-install-recommends -y"; fi
# 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 [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew unlink python; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew upgrade python@2; fi
# first find brew python python-config
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export BREWPYCONFIG=`brew ls python2 | grep config | head -n1`; fi
# find python paths, taken from
# https://github.com/breannansmith/scisim/blob/master/.travis.yml
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export PY_INC=`$BREWPYCONFIG --includes | grep -o '\-I[^ ]*' | head -n 1 | cut -c 3-` ; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export PY_LIB=`$BREWPYCONFIG --ldflags | grep -o '\-L[^ ]*' | head -n 1 | cut -c 3- | xargs -I % find % -name libpython*.dylib` ; fi
# also find brew python executable dir and prepend it to PATH
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export PY_EXC=`$BREWPYCONFIG --exec-prefix`/bin; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export PATH=$PY_EXC:$PATH; fi
# leaving this for debug purposes, it's not like a few lines matter compared to the usual size of the log
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then echo $BREWPYCONFIG; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then echo $PY_INC; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then echo $PY_LIB; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then echo $PY_EXC; 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:
# redefine CXX to the actual version used
# - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'clang++' ]]; then export CXX=clang++-4.0; fi
# the C compiler is used by nvcc (why?). it needs to support custom omp reductions
# - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CC=gcc-5; fi
# - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CXX=g++-5; fi
# - if [[ $TEST_SUITE != 'cuda' && $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gcc-6 g++-6; fi
# - if [[ $TEST_SUITE != 'cuda' && $TRAVIS_OS_NAME == 'linux' ]]; then export CC=gcc-6; fi
# - if [[ $TEST_SUITE != 'cuda' && $TRAVIS_OS_NAME == 'linux' ]]; then export CXX=g++-6; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libblitz0-dev python-numpy python-scipy libthrust-dev; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo pip2 install -U pytest --ignore-installed six; fi
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo apt-get install -y cuda-toolkit-8-0; fi
#TODO: install only required parts of the toolkit to save time
# - if [[ $TEST_SUITE == 'cuda' ]]; then sudo apt-get install -y cuda-drivers cuda-core-8-0 cuda-cudart-dev-8-0 cuda-cufft-dev-8-0; fi
- if [[ $TEST_SUITE == 'cuda' ]]; then export CUDA_HOME=/usr/local/cuda; fi
# - if [[ $TEST_SUITE == 'cuda' ]]; then export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}; 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 python-cffi; fi
# recent boost is installed using addons functionality
# cmake
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo sh cmake-3.13.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir; fi
# thrust
- git clone --depth=1 git://github.com/thrust/thrust.git;
- 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
# get latest FindBoost.cmake
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then mkdir MyCmakeModules; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then wget https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindBoost.cmake -P MyCmakeModules; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}:${PWD}/MyCmakeModules; fi
# get blitz and python+packages
#- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages; fi
#- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install blitz boost-python; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi
# https://github.com/pypa/pip/issues/3165
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip2 install -U matplotlib --ignore-installed six; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip2 install -U pytest --ignore-installed six; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip2 install --only-binary=numpy,scipy numpy scipy --ignore-installed six; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip2 install http://prdownloads.sourceforge.net/gnuplot-py/gnuplot-py-1.8.tar.gz?download; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then \curl -sSL https://get.rvm.io | bash -s -- --branch stable; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm reload; fi
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install blitz [email protected]; fi
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo ln -sf /usr/local/opt/[email protected]/include/* /usr/local/include/; fi
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo ln -sf /usr/local/opt/[email protected]/lib/* /usr/local/lib/; fi
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export BOOST_INCLUDEDIR=/usr/local/opt/[email protected]/include ; fi
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export BOOST_LIBRARYDIR=/usr/local/opt/[email protected]/lib ; fi
before_script:
- chmod +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