forked from plumed/plumed2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
224 lines (217 loc) · 9.26 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
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.
- os: linux
dist: trusty
sudo: required
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKEDOC=yes PLUMED_ALL_TESTS=yes LAPACK=yes
# coverage scan
- os: linux
dist: trusty
sudo: required
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKECOVERAGE=yes PLUMED_ALL_TESTS=yes
# the following are with debug flags
- os: linux
dist: trusty
sudo: required
env: PLUMED_CC=gcc PLUMED_CXX=g++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx"
- os: linux
dist: trusty
sudo: required
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx"
# cppcheck
- os: linux
dist: trusty
sudo: required
env: CPPCHECK=yes CPPCHECK_VERSION=1.81
# test using external blas with internal lapack
- 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"
# test using docker image.
# currently it means ubuntu 17, with gcc6
- sudo: required
if: branch =~ ^test- OR type IN(pull_request)
services: docker
env: PLUMED_DOCKER=yes
# osx serial
- os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode7.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
# osx parallel
- os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode7.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
# osx serial macports
- os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode7.3
env: PLUMED_MACPORTS="plumed +python36"
cache:
directories:
- $HOME/.macports-ci-ccache
# osx serial macports debug variant
- os: osx
if: branch =~ ^test- OR type IN(pull_request)
osx_image: xcode7.3
env: PLUMED_MACPORTS="plumed +allmodules"
cache:
directories:
- $HOME/.macports-ci-ccache
# osx serial macports debug variant
- os: osx
osx_image: xcode8.3
env: PLUMED_MACPORTS="plumed +allmodules +python27"
cache:
directories:
- $HOME/.macports-ci-ccache
# 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
## 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:$CPATH"
- export INCLUDE="$HOME/opt/include:$INCLUDE"
- export LIBRARY_PATH="$HOME/opt/lib:$LIBRARY_PATH"
- export LD_LIBRARY_PATH="$HOME/opt/lib:$LD_LIBRARY_PATH"
# 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 -z "$PLUMED_MACPORTS" ; then
brew update > /dev/null ;
brew install ccache ;
export PLUMED_MPIRUN="mpirun --oversubscribe" ;
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 libboost-serialization-dev ; fi
- if test "$PLUMED_CXX" ; then ./.travis/install.xdrfile ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
./.travis/install.ccache v3.4.2 ;
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 4.1.4 ; 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
- 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 lcov
- if test "$MAKECOVERAGE" == yes ; then ./.travis/install.lcov v1.13 ; fi
# install numpy and cython for python interface
# only for linux and homebrew (no macports)
- if test "$PLUMED_CXX" ; then
sudo pip install --upgrade pip ;
sudo pip install numpy ;
sudo pip install Cython ;
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
# 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
# when running lcov plumed should be compiled with -O0
- if test "$MAKECOVERAGE" == yes ; then PLUMED_CXXFLAGS=-O0 ; 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
sudo port -N -k install $PLUMED_MACPORTS ;
plumed config show ;
./macports-ci ccache --save ;
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 "$PLUMED_CXX" ; then make -C regtest checkfail ; fi
- if test -n "$PLUMED_MACPORTS" ; then sudo port -N -d test $PLUMED_MACPORTS ; 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 bash <(curl -s https://codecov.io/bash) ; fi
- if test "$MAKECOVERAGE" == yes ; then ./.travis/push coverage ; fi