forked from SciRuby/nmatrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
executable file
·140 lines (120 loc) · 3.25 KB
/
travis.sh
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
#!/bin/bash
set -ev #fail at the first command that returns non-zero exit value
# Use rbenv on OSX iff ruby_version is given
if [ -n "$ruby_version" -a "$TRAVIS_OS_NAME" = "osx" ]; then
export PATH="$HOME/.rbenv/bin:$PATH"
if [ -x $HOME/.rbenv/bin/rbenv ]; then
eval "$(rbenv init -)"
fi
export RBENV_VERSION=$ruby_version
unset GEM_PATH GEM_HOME
fi
if [ "$1" = "install" ]
then
bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
fi
if [ "$1" = "before_install" ]
then
case "$TRAVIS_OS_NAME" in
linux)
sudo apt-get update -qq
;;
osx)
brew update >/dev/null
;;
esac
# Installing ruby by using rbenv on OSX iff ruby_version is given
if [ -n "$ruby_version" -a "$TRAVIS_OS_NAME" = "osx" ]; then
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
eval "$(rbenv init -)"
# Install ruby
(
brew install bison openssl readline
brew link --force openssl
RBENV_VERSION=system
MAKEOPTS='-j 4'
CONFIGURE_OPTS="--disable-install-doc --with-out-ext=tk,tk/tkutil --with-opt-dir=/usr/local"
rbenv install --verbose $ruby_version
)
gem pristine --all
gem update --no-document --system
gem update --no-document
fi
gem install --no-document bundler -v '~> 1.6'
if [ -n "$USE_ATLAS" ]
then
case "$TRAVIS_OS_NAME" in
linux)
sudo apt-get install -y libatlas-base-dev
;;
osx)
echo "FIXME: ATLAS on OSX environment is not supported, currently" >2
exit 1
;;
esac
fi
# travis-ci runs on Ubuntu 12.04, where the openblas package doesn't
# provide a liblapack.so, so we test using the blas from openblas
# and the reference lapack implementation. Not entirely sure if
# this will work.
if [ -n "$USE_OPENBLAS" ]
then
case "$TRAVIS_OS_NAME" in
linux)
sudo apt-get install -y libopenblas-dev
# Since we install libopenblas first, liblapack won't try to install
# libblas (the reference BLAS implementation).
sudo apt-get install -y liblapack-dev
;;
osx)
brew install homebrew/science/openblas
;;
esac
fi
if [ -n "$USE_REF" ]
then
case "$TRAVIS_OS_NAME" in
linux)
sudo apt-get install -y liblapack-dev
;;
osx)
brew install homebrew/dupes/lapack
;;
esac
fi
fi
if [ "$1" = "script" ]
then
nmatrix_plugins_opt=''
if [ -n "$USE_ATLAS" ]
then
# Need to put these commands on separate lines (rather than use &&)
# so that bash set -e will work.
nmatrix_plugins_opt='nmatrix_plugins=atlas'
fi
if [ -n "$USE_OPENBLAS" ]
then
nmatrix_plugins_opt='nmatrix_plugins=lapacke'
fi
if [ -n "$USE_REF" ]
then
nmatrix_plugins_opt='nmatrix_plugins=lapacke'
fi
if [ -n "$NO_EXTERNAL_LIB" ]
then
nmatrix_plugins_opt=''
fi
bundle exec rake travis:env
if [[ "$TRAVIS_RUBY_VERSION" =~ "jruby" ]];then
bundle exec rake jruby
bundle exec rake spec
else
bundle exec rake compile $nmatrix_plugins_opt || {
echo === Contents of mkmf.log ===
cat tmp/*/nmatrix/*/mkmf.log
exit 1
}
bundle exec rake spec $nmatrix_plugins_opt
fi
fi