-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
221 lines (209 loc) · 7.64 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
# Language selection
# Note: with `language: cpp`, `cache: ccache` works
# but `cache: pip` and `python:` is ignored
language: cpp
# Currently commented out as set with environment flags
# Both clang and gcc can be tested. More is the better.
#compiler:
# - clang
# - gcc
# Environment variables
# Note: On trusty we need to build Armadillo ourselves (the system version is too old)
# Note: altering the matrix here will cause re-building of caches,
# so try to keep this concise to avoid need to update
matrix:
include:
# linux g{cc,++}-5 py{27,3}
- os: linux
python: 3
# +boost +fftw3 +hdf5
env: EXTRA_BUILD_FLAGS="-DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON" CC=gcc-5 CXX=g++-5 PYMVER=3
- os: linux
python: 2.7
# +boost +fftw3 +hdf5 +siemens_to_ismrmrd +swig
env: EXTRA_BUILD_FLAGS="-DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON" CC=gcc-5 CXX=g++-5 PYMVER=2
- os: linux
python: 3
# +DEVEL +boost -hdf5 -fftw3 +siemens_to_ismrmrd
env: EXTRA_BUILD_FLAGS="-DDEVEL_BUILD=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_FFTW3=OFF -DBUILD_siemens_to_ismrmrd=ON" CC=gcc-5 CXX=g++-5 PYMVER=3
- os: linux
python: 2.7
# +DEVEL -boost -fftw3 -hdf5 -swig
env: EXTRA_BUILD_FLAGS="-DDEVEL_BUILD=ON -DUSE_SYSTEM_Boost=OFF -DUSE_SYSTEM_FFTW3=OFF -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_SWIG=OFF" CC=gcc-5 CXX=g++-5 PYMVER=2
# osx g{cc,++} py{27,36}
- os: osx
python: 2.7
# +boost -hdf5 -swig
env: EXTRA_BUILD_FLAGS="-DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_SWIG=OFF" CC=gcc CXX=g++ PYMVER=2
- os: osx
# -boost -hdf5 -swig
python: 3
env: EXTRA_BUILD_FLAGS="-DUSE_SYSTEM_Boost=OFF -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_SWIG=OFF" CC=gcc CXX=g++ PYMVER=3
- os: osx
python: 2.7
# +DEVEL +boost -hdf5 +swig
env: EXTRA_BUILD_FLAGS="-DDEVEL_BUILD=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_SWIG=ON" CC=gcc CXX=g++ PYMVER=2
- os: osx
python: 2.7
# +DEVEL +boost -fftw3 -hdf5 +swig
env: EXTRA_BUILD_FLAGS="-DDEVEL_BUILD=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=OFF -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_SWIG=ON" CC=gcc CXX=g++ PYMVER=2
# itk
- os: linux
python: 3
# +boost +itk +fftw3 +hdf5
env: EXTRA_BUILD_FLAGS="-DUSE_SYSTEM_Boost=ON -DUSE_ITK=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON" CC=gcc-5 CXX=g++-5 PYMVER=3
- os: osx
python: 2.7
# +boost +itk -hdf5 +swig
env: EXTRA_BUILD_FLAGS="-DUSE_SYSTEM_Boost=ON -DUSE_ITK=ON -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_SWIG=ON" CC=gcc CXX=g++ PYMVER=2
env:
global:
- BUILD_FLAGS="-DCMAKE_BUILD_TYPE=Release"
# don't use too many threads - may crash
- MAKEFLAGS="-j 2"
# Ubuntu 14.04 LTS
dist: trusty
# No need for sudo
sudo: false
# Compilation dependencies
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- git-core
- build-essential
- g++-5
- libboost-all-dev
- libhdf5-serial-dev
- libfftw3-dev
- python-dev
- python3-dev
- python-tk
- python3-tk
- liblapack-dev
- libxml2-dev
- libarmadillo-dev
- libgtest-dev
- libplplot-dev
- swig
- ccache
# not in whitelist
- libxslt-dev
- libace-dev
# - root-system-bin
# cache C/C++/pip
cache:
- ccache
- pip
before_install:
- mkdir -p ~/.local/bin
- pushd ~/.local/bin
# Note: use ( set -ev; ... ) to echo commands and exit immediately on failure
# in compounds statements (note that export/cd etc won't persist).
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
BUILD_FLAGS="$BUILD_FLAGS -DSHARED_LIBS_ABS_PATH=ON"
if [ $PYMVER == 2 ]; then
PYINST=/System/Library/Frameworks/Python.framework/Versions
PY_EXE=$PYINST/$PYMVER.7/bin/python2.7
BUILD_FLAGS="$BUILD_FLAGS -DPYTHON_LIBRARY=$PYINST/2.7/lib/libpython2.7.dylib"
BUILD_FLAGS="$BUILD_FLAGS -DPYTHON_INCLUDE_DIR=$PYINST/2.7/include/python2.7"
else
brew upgrade python || travis_terminate 1
# find exact location of Python executable to pass to CMake
PY_INST=`echo /usr/local/Cellar/python/3.*/Frameworks/Python.framework/Versions/3.*`
PY_EXE=$PY_INST/bin/python3
PY_LIB=$PY_INST/Python
PY_INC=$PY_INST/Headers
# This is not necessary if we give the actual path for the executable
# BUILD_FLAGS="$BUILD_FLAGS -DPYTHON_LIBRARY=$PY_LIB -DPYTHON_INCLUDE_DIR=$PY_INC"
fi
BUILD_FLAGS="$BUILD_FLAGS -DPYTHON_EXECUTABLE=$PY_EXE"
( set -ev
# boost is already installed but 1.65 doesn't work so update
brew upgrade boost
# we currently need boost-python
# brew install boost-python
brew install ace
brew install swig
brew install ccache
# brew install scipy matplotlib
# need curl to get more recent cmake
brew install curl
curl -0 https://cmake.org/files/v3.8/cmake-3.8.0-Darwin-x86_64.tar.gz -o cmake.tar.gz
tar xzf cmake.tar.gz
mv cmake-*/CMake.app/Contents/* cmake-*
)
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
PY_EXE=python$PYMVER
curl -0 https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz -o cmake.tar.gz
tar xzf cmake.tar.gz
fi
# cmake override
- pushd cmake-*/bin
- export PATH="$PWD:$PATH"
- popd
# get pip
- curl -0 https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- $PY_EXE get-pip.py --user
# setuptools may be out of date on osx
- $PY_EXE -m pip install --user -U pip setuptools wheel
# ensure python bin dir exists (and coverage dependencies installed)
- $PY_EXE -m pip install --user -U nose codecov coveralls
# for counting clones, excluding ours
- git clone https://[email protected]/ccp-petmr-codebot/github-stats --branch CCPPETMR/SIRF-SuperBuild
# update with last fortnight's clones from GitHub API
- TRAVIS_REPO_SLUG=CCPPETMR/SIRF-SuperBuild source github-stats/setup.sh
# count unique clones, excluding travis, and print total
- TRAVIS_REPO_SLUG=CCPPETMR/SIRF-SuperBuild gh_stats_count -k uniques
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# pip path fix
# show lib/site-packages path
$PY_EXE -m pydoc pip | grep -i -A 1 file
$PY_EXE -m pydoc codecov | grep -i -A 1 file
# append python bin dir to path (consult output from previous lines)
pushd $HOME/Library/Python/$PYMVER*/bin
export PATH="$PWD:$PATH"
popd
fi
- $PY_EXE --version
- $PY_EXE -m pip --version
- $PY_EXE -m pip freeze
# ccache compiler override
- ln -s "$(which ccache)" g++
- ln -s "$(which ccache)" g++-5
- ln -s "$(which ccache)" gcc
- ln -s "$(which ccache)" gcc-5
- export PATH="$PWD:$PATH"
- popd
# Use Travis' currently checked-out SIRF commit ID to build.
# Also no point re-downloading SIRF - just use local URL.
# N.B.: don't put into build matrix to allow caching.
- BUILD_FLAGS="$BUILD_FLAGS -DPYVER=$PYMVER -DSIRF_URL=$PWD -DSIRF_TAG=$TRAVIS_COMMIT"
# get SuperBuild
- cd ..
- git clone https://github.com/CCPPETMR/SIRF-SuperBuild --recursive -b master
- cd SIRF-SuperBuild
install:
- $PY_EXE -m pip install --user --only-binary=numpy,scipy,matplotlib numpy scipy matplotlib
- cmake $BUILD_FLAGS $EXTRA_BUILD_FLAGS .
# Job may timeout (>50min) if no ccache, otherwise should be <1min:
- make
- mv INSTALL/share/gadgetron/config/gadgetron.xml.example INSTALL/share/gadgetron/config/gadgetron.xml
- source $PWD/INSTALL/bin/env_ccppetmr.sh
script:
- ./INSTALL/bin/gadgetron >& gadgetron.log&
# print for debugging
- cat builds/SIRF/build/CMakeCache.txt
- ctest -VV
# print for debugging
- cat builds/SIRF/build/Testing/Temporary/LastTest.log
# may exceed 4MB travis log limit
- cat gadgetron.log
after_success:
- cd SIRF
- codecov
- coveralls