forked from plumed/plumed2
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
306 lines (298 loc) · 12.8 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
language: cpp
cache: ccache
matrix:
include:
# list of configurations to be attempted:
# MPI + doc
# this is the "master" one, it is going to update the manual every time
# Variable PLUMED_ALL_TESTS=yes ensures that all the regtests can be run.
# If some of them is not enabled, the whole suite will fail.
- name: Run all tests and build doc on ubuntu 18. All features enabled (system blas and lapack + asmjit)
os: linux
dist: bionic
sudo: required
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKEDOC=yes PLUMED_ALL_TESTS=yes LAPACK=yes ASMJIT=yes
- name: Run all tests and scan coverage
os: linux
dist: trusty
sudo: required
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKECOVERAGE=yes PLUMED_ALL_TESTS=yes
- name: Debug flags, no MPI
os: linux
dist: trusty
sudo: required
env: PLUMED_CC=gcc PLUMED_CXX=g++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx"
- name: Debug flags, MPI
os: linux
dist: trusty
sudo: required
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx"
- name: Cppcheck and codecheck
os: linux
dist: trusty
sudo: required
env: CPPCHECK=yes CPPCHECK_VERSION=1.90
- name: External blas with internal lapack, including asmjit
os: linux
if: branch =~ ^test- OR type IN(pull_request)
dist: trusty
sudo: required
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ PLUMED_CXXFLAGS=-O3 LAPACK=yes CONFIG_FLAGS="--disable-external-lapack" ASMJIT=yes
- name: Docker image (ubuntu 17, with gcc6)
sudo: required
if: branch =~ ^test- OR type IN(pull_request)
services: docker
env: PLUMED_DOCKER=yes
- name: MacOS, serial build
os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode8.3
env: PLUMED_CC=clang PLUMED_CXX=clang++ PLUMED_CXXFLAGS=-O3
# this should not be required. I add it since it looks like with OSX it does not work otherwise
cache:
directories:
- $HOME/.ccache
- name: MacOS, MPI build
os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode8.3
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ PLUMED_CXXFLAGS=-O3
# this should not be required. I add it since it looks like with OSX it does not work otherwise
cache:
directories:
- $HOME/.ccache
- name: MacPorts, default modules
os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode8.3
env: PLUMED_MACPORTS="plumed" PLUMED_PYTHON="3.6 3.7"
cache:
directories:
- $HOME/.macports-ci-ccache
- name: MacPorts, all modules
os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode8.3
env: PLUMED_MACPORTS="plumed +allmodules" PLUMED_PYTHON="3.6 3.7"
cache:
directories:
- $HOME/.macports-ci-ccache
- name: MacPorts, Xcode 9.4, all modules
os: osx
osx_image: xcode9.4
env: PLUMED_MACPORTS="plumed +allmodules" PLUMED_PYTHON="3.6 3.7"
cache:
directories:
- $HOME/.macports-ci-ccache
# linux conda package
- name: Conda build, linux
os: linux
if: branch =~ ^test- OR tag IS present OR type IN(pull_request) OR type IN(cron)
dist: trusty
sudo: required
env: PLUMED_CONDA=yes
# osx conda package
- name: Conda build, MacOS
os: osx
if: branch =~ ^test- OR tag IS present OR type IN(pull_request) OR type IN(cron)
osx_image: xcode9.4
env: PLUMED_CONDA=yes
# I don't put any mpi variant with macports since it takes too long to compile
## This command can be used to allow failures:
allow_failures:
# I allow this to fail temporarily
- env: PLUMED_DOCKER=yes
# this is failing due to problems in installing MPI, should be allowed to fail until we fix it.
- env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ PLUMED_CXXFLAGS=-O3
## Possible additional variables:
# VALGRIND=yes to make valgrind tests, only when log contains string [valgrind]
install:
# setup environment to allow install on the home directory
- export PATH="$HOME/opt/bin:$PATH"
- export CPATH="$HOME/opt/include:$HOME/opt/arrayfire/include:$CPATH"
- export INCLUDE="$HOME/opt/include:$HOME/opt/arrayfire/include:$INCLUDE"
- export LIBRARY_PATH="$HOME/opt/lib:$HOME/opt/arrayfire/lib:$LIBRARY_PATH"
- export LD_LIBRARY_PATH="$HOME/opt/lib:$HOME/opt/arrayfire/lib:$LD_LIBRARY_PATH"
- export PYTHONPATH="$HOME/opt/lib/plumed/python:$PYTHONPATH"
# Setting the TMPDIR in this way allegedly prevents problems with the compilation of
# PLUMED + Python on macos
- export TMPDIR="/tmp"
# on travis, better dump stack trace in case there is an error
- export PLUMED_STACK_TRACE=yes
- export PLUMED_NUM_THREADS=2
- ./.travis/check.log valgrind || VALGRIND=no
# update packages
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && test -n "$PLUMED_CXX" ; then
brew update > /dev/null ;
brew install ccache ;
brew install gawk ;
export PLUMED_MPIRUN="mpirun --oversubscribe" ;
fi
- if [[ "$TRAVIS_DIST" == xenial ]] || [[ "$TRAVIS_DIST" == bionic ]] ; then
export PLUMED_MPIRUN="mpirun.openmpi" ;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq ; fi
# install some package - these are fast, we install them anyway
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libfftw3-dev gsl-bin libgsl0-dev ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$CONFIG_FLAGS" == *debug* ]] ; then
.travis/install.boost ;
else
sudo apt-get install -y libboost-serialization-dev ;
fi
fi
- if test "$PLUMED_CXX" ; then ./.travis/install.xdrfile ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
./.travis/install.ccache v3.5 ;
fi
# cppcheck:
# I use 1.71 since 1.72 seems to report a lot of false positive
- if test "$CPPCHECK" == yes ; then ./.travis/install.cppcheck $CPPCHECK_VERSION ; fi
# for plumedcheck I need latest gawk
- if test "$CPPCHECK" == yes ; then ./.travis/install.gawk 5.0.1 ; fi
# for plumedcheck I need astyle
- if test "$CPPCHECK" == yes ; then make -j 4 -C astyle ; fi
# installation of these packages takes a lot of time
# we do it only when needed
- if test "$PLUMED_CXX" == "mpic++" -a "$TRAVIS_OS_NAME" == "linux" ; then sudo apt-get install -y libopenmpi-dev openmpi-bin ; fi
- if test "$PLUMED_CXX" == "mpic++" -a "$TRAVIS_OS_NAME" == "osx" ; then brew install openmpi ; fi
- export OMPI_MCA_btl="^openib"
- if test "$MAKEDOC" == yes ; then sudo apt-get install -y graphviz ; fi
# install doxygen-latex
- if test "$MAKEDOC" == yes ; then sudo apt-get install -y doxygen-latex ; fi
# install aspell
- if test "$MAKEDOC" == yes ; then sudo apt-get install -y aspell aspell-en ; fi
# install lcov
- if test "$MAKECOVERAGE" == yes ; then ./.travis/install.lcov v1.14 ; fi
# install cython for python interface
# nose and other packages are needed for running tests
# only for linux
# with homebrew I currently have problem in installing python 3 so I leave it out
# pandas: needed by mdtraj and by plumed
- if test "$PLUMED_CXX" ; then
if test "$TRAVIS_OS_NAME" == "linux" ; then
pyenv global 3.6;
pip install --user Cython ;
pip install --user nose ;
pip install --user numpy ;
pip install --user six ;
pip install --user pandas ;
pip install --user mdtraj ;
pip install --user MDAnalysis ;
python -c "import MDAnalysis" ;
python -c "import mdtraj" ;
fi ;
fi
# then replace doxygen with the desided version
# I use 1.8.10 instead of 1.8.11 since it looks like 1.8.11 have troubles with
# non case sensitive files (it writes capitalized filenames)
- if test "$MAKEDOC" == yes ; then ./.travis/install.doxygen Release_1_8_14 ; fi
- if test "$VALGRIND" == yes ; then sudo apt-get install -y valgrind ; fi
- if test "$LAPACK" == yes ; then sudo apt-get -y install libatlas-base-dev ; fi
# moreover, we hardcode path to dynamic library, required for xdrfile to link properly
# I do it only when LD_LIBRARY_PATH is non blank, since otherwise clang gives problems
- if test -n "$LD_LIBRARY_PATH" ; then PLUMED_LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" ; fi
# arrayfire
- if test "$ARRAYFIRE" == yes; then ./.travis/install.arrayfire ; fi
# macports related stuff
# configure macports
- if test -n "$PLUMED_MACPORTS" ; then
export COLUMNS=80 ;
wget https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci ;
chmod +x ./macports-ci ;
./macports-ci install ;
PATH="/opt/local/bin:$PATH" ;
make macports ;
./macports-ci localports macports ;
./macports-ci ccache ;
fi
script:
# make sure all modules are enabled
- CONFIG_FLAGS="$CONFIG_FLAGS --enable-modules=all"
# disable tracking dependencies, to build faster
- CONFIG_FLAGS="$CONFIG_FLAGS --disable-dependency-tracking"
# we enable fftw, which is off by default
- CONFIG_FLAGS="$CONFIG_FLAGS --enable-fftw"
# enable boost_serialization to test drr module
- CONFIG_FLAGS="$CONFIG_FLAGS --enable-boost_serialization"
- if test "$MAKEDOC" == yes ; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-pdfdoc" ; fi
- if test "$MAKECOVERAGE" == yes ; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-gcov" ; fi
- if test "$ARRAYFIRE" == yes; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-af_cpu"; fi
# when running lcov plumed use moderate optimization
- if test "$MAKECOVERAGE" == yes ; then PLUMED_CXXFLAGS=-O ; fi
- if test "$ASMJIT" == yes ; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-asmjit" ; fi
# BUILD:
# this is done only if PLUMED_CXX is defined
- if test "$PLUMED_CXX" ; then
ccache -s ;
./configure CXX="ccache $(which $PLUMED_CXX)" CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="$PLUMED_LDFLAGS" CPPFLAGS="$PLUMED_CPPFLAGS" $CONFIG_FLAGS --prefix="$HOME/opt" ;
make -j 4 ;
make install ;
ccache -s ;
fi
# build using macports
- if test -n "$PLUMED_MACPORTS" ; then
travis_wait sudo port -N -k install $PLUMED_MACPORTS ;
plumed config show ;
./macports-ci ccache --save ;
for p in $PLUMED_PYTHON ; do
travis_wait sudo port -N install py${p//./}-plumed ;
done
fi
- CONDA_VERSION=none
- export CONDA_LABEL=
# set CONDA_VERSION to TRAVIS_TAG, if available
- if test -n "${TRAVIS_TAG}" ; then
CONDA_VERSION="${TRAVIS_TAG//-/_}" ;
CONDA_VERSION="${CONDA_VERSION#v}" ;
CONDA_LABEL=tags ;
fi
# set CONDA_VERSION to branch + date when on nightly build
- if test "$TRAVIS_EVENT_TYPE" = cron ; then
if test "$TRAVIS_BRANCH" = master ; then CONDA_VERSION=2.99.$(date +%y%m%d) ; fi ;
if [[ "$TRAVIS_BRANCH" =~ ^v2.[0-9]+$ ]] ; then CONDA_VERSION=${TRAVIS_BRANCH#v}.$(date +%y%m%d) ; fi ;
CONDA_LABEL=nightly ;
fi
# build conda package
- if test -n "$PLUMED_CONDA" ; then VERSION="$CONDA_VERSION" make -C conda ; fi
# build docker container
- if test "$PLUMED_DOCKER" = yes ; then make -C docker ; fi
# TEST:
- if test "$VALGRIND" == yes ; then OPT=valgrind ; else OPT="" ; fi
# --no-print-directory make it more silent
- if test "$PLUMED_CXX" ; then make --no-print-directory -C regtest $OPT ; fi
# test with gcc6
- if test "$PLUMED_DOCKER" = yes ; then docker run -v "$PWD/regtest":/home/plumed/regtest -it plumed /bin/bash -c "make -C regtest" ; fi
# currently, gcc6 fails for numerical reasons. Once this is fixed we can add the "make -C regtest checkfail" command below
- if test "$MAKEDOC" == yes ; then make -C regtest copytodoc ; fi
- if test "$MAKECOVERAGE" == yes ; then make -C developer-doc coverage ; fi
- if test "$MAKEDOC" == yes ; then make doc >/dev/null ; fi
- if test "$MAKEDOC" == yes ; then make -C user-doc spelling ; fi
- if test "$PLUMED_CXX" ; then make -C regtest checkfail ; fi
# OpenBLAS is needed for numpy, I install it separately since it takes a long time
- if test -n "$PLUMED_MACPORTS" ; then
travis_wait sudo port -N -d test $PLUMED_MACPORTS ;
travis_wait sudo port -N install OpenBLAS ;
for p in $PLUMED_PYTHON ; do
travis_wait sudo port test py${p//./}-plumed ;
done
fi
- if test "$PLUMED_CXX" ; then
if test "$TRAVIS_OS_NAME" == "linux" ; then
nosetests -v -w python ;
fi ;
fi
# CPPCHECK:
# this is required so as to have all the include files inplace:
# notice that this is done automatically in build
- if test "$CPPCHECK" == yes ; then make -C src/lib/ dirslinks ; fi
# then we do cppcheck
# notice that with make codecheck we also run the maketools/plumedcheck
# script which check if coding policies are satisfied
- if test "$CPPCHECK" == yes ; then make codecheck ; fi
after_success:
- if test "$MAKEDOC" == yes ; then ./.travis/push doc ; fi
- if test "$MAKECOVERAGE" == yes ; then ./.travis/push coverage ; fi
- if test "$MAKECOVERAGE" == yes ; then bash <(curl -s https://codecov.io/bash) > /dev/null ; fi
# upload conda package
- if test -n "$PLUMED_CONDA" && test -n "$CONDA_LABEL" ; then make -C conda upload ; fi