forked from sourceryinstitute/OpenCoarrays
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
170 lines (162 loc) · 4.92 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
language: generic
env:
global:
- CACHE="$HOME/.local"
- MPICH_VER="3.2"
- MPICH_URL_HEAD="http://www.mpich.org/static/downloads/$MPICH_VER"
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
- MPICH_DIR="$HOME/.local/usr/mpich"
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/452136/"
- MPICH_BOT_URL_TAIL="mpich-3.2_2.yosemite.bottle.1.tar.gz"
- FC=gfortran-6
- CC=gcc-6
- CXX=g++-6
matrix:
include:
- os: osx
env:
- BUILD_TYPE="CodeCoverage"
OSX_PACKAGES="gcc cmake"
- os: osx
env:
- BUILD_TYPE="Release"
OSX_PACKAGES="gcc cmake"
- os: osx
env:
- BUILD_TYPE="InstallScript"
OSX_PACKAGES="gcc"
- &ubuntu
os: linux
sudo: false
env:
- BUILD_TYPE="CodeCoverage"
cache:
apt: false
directories:
- "$CACHE"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
packages:
- gcc-6
- gfortran-6
- g++-6
- binutils
- cmake-data
- cmake
-
<<: *ubuntu
env:
- BUILD_TYPE="Release"
-
<<: *ubuntu
env:
- BUILD_TYPE="InstallScript"
cache: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- gfortran-6
- g++-6
before_install:
- |
set -o errexit
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
export PATH="$PATH:$HOME/Library/Python/2.7/bin"
else
[[ -d "$CACHE/bin" ]] || mkdir -p "$CACHE/bin"
[[ -d "$MPICH_DIR" ]] || mkdir -p "$MPICH_DIR"
export PATH="$CACHE/bin:$PATH"
$FC --version
$CC --version
$CXX --version
fi
set +o errexit
install:
- |
set -o errexit
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
brew update > /dev/null
for pkg in $OSX_PACKAGES; do
[[ "$(brew ls --versions $pkg)" ]] || brew install --force-bottle $pkg
brew outdated $pkg || brew upgrade --force-bottle $pkg
done
if ! [[ "$(brew ls --versions mpich)" ]] && [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then
wget ${MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}
brew install --force-bottle ${MPICH_BOT_URL_TAIL}
if ! [[ "$(brew ls --versions mpich)" ]]; then
brew install --force-bottle mpich
fi
mpif90 --version
mpicc --version
cmake --version
elif [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then # uninstall some stuff if present
[[ "$(brew ls --versions cmake)" ]] && brew rm cmake || true
[[ "$(brew ls --versions mpich)" ]] && brew rm mpich || true
[[ "$(brew ls --versions openmpi)" ]] && brew rm openmpi || true
fi
elif [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
if ! ( [[ -x "$HOME/.local/bin/mpif90" ]] && [[ -x "$HOME/.local/bin/mpicc" ]] ); then
# mpich install not cached
# could use prerequisites/build instead...
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
mv "$MPICH_URL_TAIL" "$MPICH_DIR/.."
pushd "$MPICH_DIR/.."
tar -xzvf "$MPICH_URL_TAIL"
cd "${MPICH_URL_TAIL%.tar.gz}"
./configure --prefix="$MPICH_DIR"
make -j 4
make install
popd
for f in "$MPICH_DIR/bin/"*; do
if [[ -x "$f" ]]; then
ln -fs "$f" "$HOME/.local/bin/${f##*/}"
fi
done
fi
mpif90 --version
mpicc --version
cmake --version
fi
set +o errexit
script:
- |
set -o errexit
if [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then
[[ -d "$HOME/opt" ]] || mkdir "$HOME/opt"
[[ -d "$HOME/bin" ]] || mkdir "$HOME/bin"
ln -fs "$(which gfortran-6)" "$HOME/bin/gfortran"
ln -fs "$(which gcc-6)" "$HOME/bin/gcc"
ln -fs "$(which g++-6)" "$HOME/bin/g++"
export PATH="$PATH:$HOME/bin"
./install.sh --yes-to-all -i "$HOME/opt/opencoarrays" -j 4 -f "$HOME/bin/gfortran" -c "$HOME/bin/gcc" -C "$HOME/bin/g++"
cd prerequisites/builds/opencoarrays/*
../../../installations/cmake/*/bin/ctest --output-on-failure
cd -
else
mkdir cmake-build
cd cmake-build
cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
make -j 4
ctest --output-on-failure
make install
cd ..
fi
set +o errexit
after_success:
- find . -name '*.gcno' -print
- gcov-6 --version
- bash <(curl -s https://codecov.io/bash) -x $(which gcov-6)
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/93dbafbdf76c1732a623
- https://webhooks.gitter.im/e/935231573bf1b9f2fe40
on_success: change # options: [always|never|change]
on_failure: always
on_start: always