-
Notifications
You must be signed in to change notification settings - Fork 11
/
.travis.yml
113 lines (95 loc) · 5.61 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
language: cpp
dist: trusty
sudo: required
os:
- linux
- osx
compiler:
- gcc
- clang
matrix:
exclude:
- os: osx
compiler: gcc
addons:
apt:
packages:
- g++-5
- gcc-5
- clang-4.0
sources: &sources
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
before_install:
# 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/ trusty main universe multiverse restricted"; 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 sudo apt-get update; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew update; 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
install:
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'clang++' ]]; then export CXX=clang++-4.0; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export CXX=g++-5; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo $apt_get_install libblitz0-dev cmake libboost-python-dev python-numpy python-scipy libthrust-dev python-pytest; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo apt-get install --no-install-recommends gnuplot-nox python-gnuplot python-tk python-matplotlib; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then git clone --depth=1 https://github.com/boostorg/odeint.git; fi # get boost odeint > 1.58
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo rm -f /usr/include/boost/numeric/odeint.hpp; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo rm -rf /usr/include/boost/numeric/odeint; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo ln -s `pwd`/odeint/include/boost/numeric/odeint.hpp /usr/include/boost/numeric/odeint.hpp; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo ln -s `pwd`/odeint/include/boost/numeric/odeint /usr/include/boost/numeric/; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew install blitz boost-python; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew install gnuplot; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then sudo -H pip2 install http://prdownloads.sourceforge.net/gnuplot-py/gnuplot-py-1.8.tar.gz?download; fi
- 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 command curl -sSL https://rvm.io/mpapis.asc | gpg --import - ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm get stable; fi
- git clone --depth=1 git://github.com/thrust/thrust.git;
- sudo ln -s `pwd`/thrust/thrust /usr/local/include/thrust;
script:
# install libcloudphxx in Debug mode
- cd ..
- git clone --depth=1 git://github.com/igfuw/libcloudphxx.git
- cd libcloudphxx
- mkdir build
- cd build
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ ../; fi
# Travis default is not the packaged one
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake .. -DPYTHON_LIBRARY=${PY_LIB} -DPYTHON_INCLUDE_DIR=${PY_INC}; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug ..; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..; fi
- make
- sudo make install
- cd ../..
# run parcel tests using Debug mode of libcloudphxx
- cd parcel
- mkdir plots/outputs/
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then py.test -v unit_test/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then py.test -v unit_test_debug/; fi
# install libcloudphxx in Release mode with asserts on
- cd ..
- cd libcloudphxx/build
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; fi
- make
- sudo make install
- cd ../..
# run parcel unit tests using Debug mode of libcloudphxx
- cd parcel
- py.test -v unit_test/
- py.test -v long_test/