1+ # TODO: precache could be done only with one job, but the compiled libs would need to be uploaded to some external storage (wizard? ams s3?);
2+ # then a problem with secure storage of credentials appears - they could be stored in encrypted env vars on travis, but that would make it impossible to start PRs from forked repos;
3+ # add an additional compile stage with jobs only for different os/compilers, not env vars (needs external storage as well)
4+ # example of a hack how to share cache among different jobs (might mean we do not need external storage):
5+ # - https://github.com/travis-ci/travis-ci/issues/7590
6+ # - https://github.com/qTox/qTox/blob/59b5578c7bffc56f6227c60bfcb38f97d39ec8d9/.travis.yml
7+
8+ stages :
9+ - precache
10+ - test
11+
112language : cpp
213os :
314 - linux
4- - osx
5- dist : trusty
15+ # - osx
16+ dist : xenial
617compiler :
718 - gcc
819 - clang
920env :
10- - TEST_SUITE=unit
11- - TEST_SUITE=sandbox
12- - TEST_SUITE=paper
13- - TEST_SUITE=elliptic_drop
14- - TEST_SUITE=nair_jablonowski_2008
15- - TEST_SUITE=pbl
16- - TEST_SUITE=osx_local_clang
17- - TEST_SUITE=UWLCM_MT
18- - TEST_SUITE=UWLCM_unit_iles
19- - TEST_SUITE=UWLCM_unit_smg
21+ # - MPI=none
22+ # - MPI=openmpi
23+ # not supported by Boost.MPI in Debian on amd64:
24+ # - MPI=lam
25+ # - MPI=mpich
26+
27+ - TEST_SUITE=unit MPI=none
28+ - TEST_SUITE=sandbox MPI=none
29+ - TEST_SUITE=paper MPI=none
30+ - TEST_SUITE=elliptic_drop MPI=none
31+ - TEST_SUITE=nair_jablonowski_2008 MPI=none
32+ - TEST_SUITE=UWLCM_MT MPI=none
33+ - TEST_SUITE=UWLCM_unit_iles MPI=none
34+ - TEST_SUITE=UWLCM_unit_smg MPI=none
35+ - TEST_SUITE=pbl MPI=none
36+ - TEST_SUITE=osx_local_clang MPI=none
37+ - TEST_SUITE=unit MPI=mvapich2
38+ - TEST_SUITE=sandbox MPI=mvapich2
39+ # MPI paper tests don't do file comparison and plotting; TODO: fix them
40+ - TEST_SUITE=paper MPI=mvapich2
41+ - TEST_SUITE=elliptic_drop MPI=mvapich2
42+ # disabled, because polar bconds dont work with MPI
43+ # - TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
44+ - TEST_SUITE=pbl MPI=mvapich2
45+ # bconds_div has to be ran separately with mpi because of timeouts
46+ - TEST_SUITE=bconds_div MPI=mvapich2
47+ # TODO: once libcloud MPI works, turn UWLCM MPI test on
48+ # - TEST_SUITE=UWLCM MPI=mvapich2
49+
50+ cache :
51+ directories :
52+ - ${TRAVIS_BUILD_DIR}/deps/mvapich2-2.3b
53+ - ${TRAVIS_BUILD_DIR}/deps/boost
54+ - ${TRAVIS_BUILD_DIR}/deps/hdf5
55+ - /home/travis/.rvm/ # following Travis cache documentation: try to cache installed ruby on osx
2056
2157matrix :
2258 exclude :
59+ # MPI with clang disabled due to difficulties with building boost with clang
60+ - compiler : clang
61+ env : TEST_SUITE=unit MPI=mvapich2
62+ - compiler : clang
63+ env : TEST_SUITE=sandbox MPI=mvapich2
64+ - compiler : clang
65+ env : TEST_SUITE=paper MPI=mvapich2
66+ - compiler : clang
67+ env : TEST_SUITE=elliptic_drop MPI=mvapich2
68+ - compiler : clang
69+ env : TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
70+ - compiler : clang
71+ env : TEST_SUITE=pbl MPI=mvapich2
72+ - compiler : clang
73+ env : TEST_SUITE=bconds_div MPI=mvapich2
74+
2375 - os : osx
24- compiler : gcc
25-
76+ env : TEST_SUITE=pbl MPI=none # pbl not tested on osx
2677 - os : osx
27- env : TEST_SUITE=pbl # pbl not tested on osx
78+ compiler : gcc
2879
2980 - compiler : clang
30- env : TEST_SUITE=UWLCM_MT
81+ env : TEST_SUITE=UWLCM_MT MPI=none
3182 - compiler : clang
32- env : TEST_SUITE=UWLCM_unit_iles
83+ env : TEST_SUITE=UWLCM_unit_iles MPI=none
3384 - compiler : clang
34- env : TEST_SUITE=UWLCM_unit_smg
85+ env : TEST_SUITE=UWLCM_unit_smg MPI=none
3586
3687 # local clang tests on osx
3788 - os : linux
38- env : TEST_SUITE=osx_local_clang
89+ env : TEST_SUITE=osx_local_clang MPI=none
3990 - compiler : gcc
40- env : TEST_SUITE=osx_local_clang
91+ env : TEST_SUITE=osx_local_clang MPI=none
4192addons :
4293 apt :
4394 packages :
4495 - g++-6
45- - clang-4.0
46- - boost1.61
96+ - clang-5.0
97+ - python3-pip
98+ - python3-setuptools
4799 sources : &sources
48100 - sourceline : ' ppa:rakhimov/boost'
49101 - ubuntu-toolchain-r-test
50- - llvm-toolchain-trusty-4.0
102+ - llvm-toolchain-xenial
51103
52104before_install :
53105 # define a compiler variable for use in if statements
@@ -56,20 +108,28 @@ before_install:
56108 - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export COMPILER=clang++; fi # only clang on osx
57109
58110# to avoid python lib/interpreter mismatch; https://github.com/travis-ci/travis-ci/issues/5326
59- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi
60- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi
61- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi
62- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi
63- - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi
111+ # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi
112+ # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi
113+ # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi
114+ - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t xenial -y"; fi
115+ # - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi
116+
117+ # - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/science; fi
118+ # - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm get stable; fi #see https://github.com/travis-ci/travis-ci/issues/6307
64119
65120 # Workaround for upgrading gcc, see https://github.com/travis-ci/travis-ci/issues/8826
66121 # Seems like this is now done by Travis, but leaving it (commented out) for now
67122 # - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew cask uninstall oclint; fi
123+
124+ - sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h
68125
69126 # needed to get rvm, see below
70127 - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then \curl -sSL https://get.rvm.io | bash -s -- --branch stable; fi
71128 # https://github.com/travis-ci/travis-ci/issues/10165
72129 - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm reload; fi
130+ - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm list known; fi
131+ - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm install ruby-2.6; fi
132+ - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm use 2.6; fi
73133
74134 # locally installed stuff comes first
75135 - export PATH=/usr/local/bin:$PATH
@@ -80,62 +140,60 @@ before_install:
80140 # to avoid problems with plotting by paraview on Travis
81141 - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then unset DISPLAY; fi
82142
83- # you may not believe it, but GCC (4.8.2) is giving ICEs otherwise!
84- - export make_j="make -j 2"
85- - if [[ $COMPILER == 'g++' ]]; then export make_j="make"; fi
143+ - export make_j="make -j 4"
86144
87- # testing both Python 2 and 3 on Linux (unrelated to compiler choice!)
145+ # testing Python 3 on Linux
88146 - export PY3DEB=""
89- - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then PY3DEB=3; fi
90- - if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi
147+ - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then PY3DEB=3; fi
148+ # - PY3DEB=3 # had problems with building h5py using python3-pip
149+ # - if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi
91150
92151 # upgrade pip
93- - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install --upgrade pip; fi
94-
95- install :
96- # silence the gazillion warnings coming from blitz headers when using the osx clang
97- - if [[ $TRAVIS_OS_NAME == 'osx' && $COMPILER == 'clang++' ]]; then export CXXFLAGS="-Wno-parentheses ${CXXFLAGS}"; fi
98-
99- # redefine CXX to the actual version used
100- - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'clang++' ]]; then export CXX=clang++-4.0; fi
101- - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CXX=g++-6; fi
102- # downloads and setups local clang on osx
103- - if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/setup_local_clang.sh; fi
104-
105- # latest boost is installed using addons functionality
106-
107- # cmake
108- - 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
109- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo sh cmake-3.13.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir; fi
152+ # - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install --upgrade pip; fi
153+ - sudo pip$PY3DEB install --upgrade pip
110154
111- # blitz
112- - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install blitz; fi
113- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libblitz0-dev; fi
155+ install :
156+ - . ./.travis_scripts/install_common.sh
114157
115- # hdf5
116- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi
117- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi
158+ # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi
159+ # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi
118160 - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install hdf5; fi
119161
120162 # gnuplot-iostream
121163 - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gnuplot-nox; fi
122164 - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi
123- - sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h
165+
166+ # Python modules
167+ # make Python 3 the default if requested
168+ - if [[ $TRAVIS_OS_NAME == 'linux' && $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi
124169
125170 # h5py
126- - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi
127- - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install h5py; fi
171+ - if [[ $TRAVIS_OS_NAME == 'linux' && $MPI == 'none' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi
172+ # build h5py with mpi support
173+ # - if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then sudo pip install mpi4py; fi
174+ - |
175+ if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then
176+ sudo pip$PY3DEB install Cython # to generate the C wrappers
177+ #sudo pip install https://bitbucket.org/mpi4py/mpi4py/get/master.tar.gz
178+ mkdir mpi4py
179+ cd mpi4py
180+ travis_retry wget --no-check-certificate --quiet -O - https://bitbucket.org/mpi4py/mpi4py/get/master.tar.gz | tar --strip-components=1 -xz
181+ python setup.py build
182+ sudo python setup.py install
183+ cd ..
184+ fi
185+ # h5py uninstallation following https://github.com/h5py/h5py/issues/672
186+ - if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then sudo -H pip$PY3DEB uninstall h5py; fi
187+ - if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then HDF5_DIR=$HDF5_ROOT HDF5_MPI="ON" sudo -H pip$PY3DEB install --no-cache-dir --no-binary=h5py h5py; fi
188+ - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install h5py; fi
128189
129190 # scipy
130191 - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-scipy; fi
131- - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install scipy; fi
192+ - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install scipy; fi
132193
133194 # matplotlib
134195 - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-matplotlib; fi
135- - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install matplotlib; fi
136-
137- # make Python 3 the default if requested
138- - if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi
196+ - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install matplotlib; fi
139197
140198script :
141199 # libmpdata++
@@ -146,7 +204,7 @@ script:
146204 - cd ../..
147205
148206 # compiling and running all unit tests in Debug & Release modes
149- - if [[ $TEST_SUITE == 'unit' ]]; then . ./.travis_scripts/unit.sh; fi
207+ - if [[ $TEST_SUITE == 'unit' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars
150208
151209 # compiling and running selected paper tests in Debug mode
152210 - if [[ $TEST_SUITE == 'paper' ]]; then . ./.travis_scripts/paper.sh; fi
@@ -166,6 +224,43 @@ script:
166224
167225 # running pbl tests in Release mode
168226 - if [[ $TEST_SUITE == 'pbl' ]]; then . ./.travis_scripts/pbl.sh; fi
169-
227+
228+ # running bconds_div tests in Release mode
229+ - if [[ $TEST_SUITE == 'bcond_div' ]]; then . ./.travis_scripts/bconds_div.sh; fi
230+
170231 # testing local clang on osx
171232 - if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars
233+
234+ # define the precache stage
235+ # empty phases mean that default phases (before_install, install, ...) from the test stage are used (?)
236+ # TODO: precache stage has a lot of unnecessary before_install and install code common to the (default) test stage;
237+ # add after_success, after_failure to precache, remove building of caches from the test stage, make the build error instead;
238+
239+ # YAML alias for the options common to precache jobs
240+ job_info : &precache_default
241+ stage : precache
242+ os : linux
243+ dist : xenial
244+ language : cpp
245+ compiler : gcc
246+ install :
247+ - . ./.travis_scripts/install_common.sh
248+ script : echo "Preparing cache finished"
249+
250+ jobs :
251+ include :
252+ - << : *precache_default
253+ env : TEST_SUITE=unit MPI=mvapich2
254+ - << : *precache_default
255+ env : TEST_SUITE=sandbox MPI=mvapich2
256+ - << : *precache_default
257+ env : TEST_SUITE=paper MPI=mvapich2
258+ - << : *precache_default
259+ env : TEST_SUITE=elliptic_drop MPI=mvapich2
260+ - << : *precache_default
261+ env : TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
262+ - << : *precache_default
263+ env : TEST_SUITE=pbl MPI=mvapich2
264+ - << : *precache_default
265+ env : TEST_SUITE=bconds_div MPI=mvapich2
266+
0 commit comments