forked from plumed/plumed2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
93 lines (90 loc) · 5.14 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
language: cpp
env:
# list of configurations to be attempted:
# MPI + doc
# this is the "master" one, it is going to update the manual if log contains [makedoc]
- PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKEDOC=yes ALMOST=yes
# the following are with debug flags
# I think clang does not support debug-glibcxx, so I skip it here
- PLUMED_CC=gcc PLUMED_CXX=g++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx"
# with debug flags there are issues with openmp+mpi on travis - I disable openmp here
- PLUMED_CC=mpicc PLUMED_CXX=mpic++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx --disable-openmp"
# then I try serial compilers
- PLUMED_CC=clang PLUMED_CXX=clang++
- PLUMED_CC=gcc PLUMED_CXX=g++
# then check with different optimization flags
- PLUMED_CC=clang PLUMED_CXX=clang++ PLUMED_CXXFLAGS=-O3 LAPACK=yes
- PLUMED_CC=gcc PLUMED_CXX=g++ PLUMED_CXXFLAGS=-O3 LAPACK=yes
# test using external blas with internal lapack
- PLUMED_CC=mpicc PLUMED_CXX=mpic++ PLUMED_CXXFLAGS=-O3 LAPACK=yes CONFIG_FLAGS="--disable-external-lapack"
# cppcheck
- CPPCHECK=yes
# with debug flags there are issues with openmp+mpi on travis - I disable openmp here
# I leave this test here to monitor if things change in the future, allowing it to fail
- PLUMED_CC=mpicc PLUMED_CXX=mpic++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx"
matrix:
allow_failures:
- env: CPPCHECK=yes
- env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx"
# 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"
# build the manual, only if log contains string [makedoc]
- export PLUMED_NUM_THREADS=2
- ./.travis/check.log makedoc || MAKEDOC=no
- ./.travis/check.log valgrind || VALGRIND=no
- ./.travis/check.log almost || ALMOST=no
# install some package - these are fast, we install them anyway
- sudo apt-get update -qq
- sudo apt-get install -y libmatheval-dev
- if test "$PLUMED_CXX" ; then ./.travis/install.xdrfile ; fi
# cppcheck:
- if test "$CPPCHECK" == yes ; then ./.travis/install.cppcheck 1.69 ; fi
# installation of these packages takes a lot of time
# we do it only when needed
- if test "$PLUMED_CXX" == "mpic++" ; then sudo apt-get install -y libopenmpi1.5-dev openmpi1.5-bin ; fi
- if test "$MAKEDOC" == yes ; then sudo apt-get install -y graphviz ; fi
# doxygen from its repository (apt-get gets an old version)
# - test "$MAKEDOC" == yes && ./.travis/install.doxygen || true
# it seems that here we can get precompiled doxygen and latex
- if test "$MAKEDOC" == yes ; then sudo apt-add-repository -y ppa:libreoffice/ppa ; fi
- if test "$MAKEDOC" == yes ; then sudo apt-get update -qq ; fi
- if test "$MAKEDOC" == yes ; then sudo apt-get install -y doxygen doxygen-latex ; fi
- if test "$VALGRIND" == yes ; then sudo apt-get install -y valgrind ; fi
- if test "$LAPACK" == yes ; then sudo apt-get install libatlas-base-dev ; fi
- if test "$ALMOST" == yes ; then ./.travis/install.almost ; fi
- if test "$ALMOST" == yes ; then ENALMOST="--enable-almost" ; fi
- if test "$ALMOST" == yes ; then PLUMED_CPPFLAGS="$INCLUDE -I/usr/local/include -I/usr/local/include/almost" ; 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
script:
# we enable crystallization and manyrestraints modules
- CONFIG_FLAGS="$CONFIG_FLAGS --enable-modules=crystallization:manyrestraints"
# BUILD:
# this is done only if PLUMED_CXX is defined
# we have to pass the full path since on travis machines sudo does not have compilers in the path
- if test "$PLUMED_CXX" ; then ./configure CXX=$(which $PLUMED_CXX) CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="$PLUMED_LDFLAGS" CPPFLAGS="$PLUMED_CPPFLAGS" $ENALMOST $CONFIG_FLAGS ; fi
- if test "$PLUMED_CXX" ; then make -j 2 ; fi
# we install plumed so that it is in the path
- if test "$PLUMED_CXX" ; then make install prefix="$HOME/opt" ; fi
# TEST:
- if test "$VALGRIND" == yes ; then OPT=valgrind ; else OPT="" ; fi
- if test "$PLUMED_CXX" ; then make -C regtest $OPT ; fi
- if test "$MAKEDOC" == yes ; then make -C regtest copytodoc ; fi
- if test "$MAKEDOC" == yes ; then make doc >/dev/null ; fi
- if test "$MAKEDOC" == yes ; then make -C regtest checkfail ; 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
- if test "$CPPCHECK" == yes ; then make cppcheck ; fi
after_success:
- if test "$MAKEDOC" == yes ; then ./.travis/pushdoc ; fi