forked from UCL/STIR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
178 lines (159 loc) · 5.95 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
# Language selection
language: cpp
cache: ccache
# Environment variables:
# To avoid too many builds, we mix some options (although independent tests would have been better)
matrix:
include:
#### linux
- os: linux
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=0 -DSTIR_OPENMP:BOOL=OFF" CC=gcc-6 CXX=g++-6
- os: linux
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=OFF -DDISABLE_HDF5=ON" CC=gcc-5 CXX=g++-5
- os: linux
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=0 -DSTIR_OPENMP:BOOL=ON" CC=gcc-7 CXX=g++-7
- os: linux
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=0 -DSTIR_OPENMP:BOOL=ON" CC=gcc-8 CXX=g++-8
- os: linux
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=0 -DSTIR_OPENMP:BOOL=ON -DCMAKE_CXX_STANDARD=11" CC=gcc-5 CXX=g++-5
- os: linux
python: 3
# need -Wno-deprecated-declarations to avoid log-file limit due to tons of warnings about auto_ptr
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=OFF" CXXFLAGS="-Wno-deprecated-declarations" CC=clang-5.0 CXX=clang++-5.0
# no clang-6 on trusty, so disabled
# - os: linux
# python: 3
# # OPENMP on Travis seemed to be version 1 (???), so don't build it
# env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=OFF -DCMAKE#_CXX_STANDARD=11" CXXFLAGS="-Wno-deprecated-declarations" CC=clang-6.0 CXX=clang++-6.0
#### osx
# note: cannot use OpenMP on OSX yet, see https://github.com/UCL/STIR/issues/117
- os: osx
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=OFF" CC=gcc CXX=g++
# Disable as ROOT is currently failing via brew (as it wants to build it, and which causes a timeout)
#- os: osx
# python: 3
# env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=0 -DSTIR_OPENMP:BOOL=OFF" CC=gcc CXX=g++
- os: osx
osx_image: xcode11.3
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=OFF -DSTIR_ENABLE_EXPERIMENTAL:BOOL=ON" CC=clang CXX=clang++
# osx, OpenMP using llvm clang
- os: osx
osx_image: xcode11.3
python: 3
env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=ON -DSTIR_ENABLE_EXPERIMENTAL:BOOL=ON -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang"
env:
global:
- BUILD_FLAGS="-DBUILD_SWIG_PYTHON:BOOL=On -DSTIR_MPI:BOOL=Off -DCMAKE_BUILD_TYPE=Release"
# Ubuntu 14.04 LTS (trusty)
dist: trusty
# No need for sudo
sudo: false
# Compilation dependencies
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
# - llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- g++-5
- g++-6
- g++-7
- g++-8
- libboost-dev
- libhdf5-serial-dev
- swig3.0
- python3-dev
- python3-numpy
- python3-pytest
- libgomp1
- clang-5.0
# - clang-6.0 # no clang-6 on trusty, so disabled
- root-system-bin
- libroot-tree-dev
- libroot-tree-treeplayer-dev
- libroot-io-dev
# Actual compilation script
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
#now upgrade to avoid problems with outdated packages
brew upgrade
# check if we're using LLVM
if [[ $EXTRA_BUILD_FLAGS == *"llvm"* ]]; then
brew install llvm
brew install libomp
export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:"/usr/local/opt/llvm/lib"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
fi
brew install ccache
export PATH="/usr/local/opt/ccache/libexec:$PATH"
# Install ROOT, unless disabled
case "$EXTRA_BUILD_FLAGS" in
*DISABLE_CERN_ROOT=1*)
echo "Not installing ROOT to save some time (and potential time-outs)";;
*)
brew install root;;
esac
brew install swig
# use Python3 on Mac
brew upgrade python || true # don't fail if upgrading doesn't do anything
# find exact location of Python executable to pass to CMake
PYMVER=3
PY_EXE=$(which python${PYMVER})
if [ ! -x "$PY_EXE" ]; then
echo "Something wrong with finding Python executable for OSX"
echo "PY_EXE = $PY_EXE"
travis_terminate 1
fi
# Next lines are not necessary if we give the actual path for the executable to cmake
#PY_LIB=$PY_INST/Python
#PY_INC=$PY_INST/Headers
# BUILD_FLAGS="$BUILD_FLAGS -DPYTHON_LIBRARY=$PY_LIB -DPYTHON_INCLUDE_DIR=$PY_INC"
${PY_EXE} -m pip install -U pip
${PY_EXE} -m pip install pytest numpy
else
PY_EXE=`which python3`
# needed for OPENMP support on Travis
# see https://github.com/travis-ci/travis-ci/issues/8613
export LD_LIBRARY_PATH=/usr/local/clang/lib:$LD_LIBRARY_PATH
fi
${PY_EXE} --version
BUILD_FLAGS="$BUILD_FLAGS -DPYTHON_EXECUTABLE=${PY_EXE}"
install:
- mkdir build install
- cd build
- cmake $BUILD_FLAGS $EXTRA_BUILD_FLAGS -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/install ..
- make -j 2 all
- make install
script:
- ctest --output-on-failure
- export PATH=$PATH:$TRAVIS_BUILD_DIR/install/bin
- cd $TRAVIS_BUILD_DIR/recon_test_pack
- ./run_test_simulate_and_recon.sh
- ./run_test_listmode_recon.sh
- ./run_test_simulate_and_recon_with_motion.sh
- ./run_scatter_tests.sh
- ./run_tests.sh --nointbp
- ./run_test_zoom_image.sh
- if [[ $EXTRA_BUILD_FLAGS == *"DDISABLE_CERN_ROOT=0"* ]]; then ./run_root_GATE.sh; fi
- ./run_tests_modelling.sh
- cd $TRAVIS_BUILD_DIR/recon_test_pack/SPECT
- ./run_SPECT_tests.sh
# Run examples to see if they work
- cd $TRAVIS_BUILD_DIR/examples/PET_simulation
- ./run_simulation.sh 1> /dev/null
- cd $TRAVIS_BUILD_DIR/src
# Run Python tests, making sure we're using the correct Python interpreter
- export PYTHON=$(cmake -LA -N $TRAVIS_BUILD_DIR/build |awk -F= '/PYTHON_EXECUTABLE/ {print $2}')
- echo Using Python executable "$PYTHON"
- export PYTHONPATH=$TRAVIS_BUILD_DIR/install/python
- ${PYTHON} -m pytest .