-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
334 lines (275 loc) · 16.2 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
env:
global:
- CASADIVERSION=3.0.0
# works from matplotlib 1.5 onwards
# - MPLBACKEND=Agg # Matplotlib backend; must be headless to run on travis
# Handle git submodules yourself
git:
submodules: false
before_install:
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
- git clone https://github.com/meco-group/bob.git
- pushd bob && source setup.sh && popd
- git clone https://github.com/casadi/testbot.git && pushd testbot && git checkout merged && source shellhelpers && popd
- set -e
- set -o pipefail # otherwise, piping with grep discards exit statuses
after_success:
- bob_putdir swig cpp_spline/$TRAVIS_BRANCH/$TARGET
matrix:
include:
- sudo: required
dist: trusty
language: minimal
script:
- ctest -V -R python
install:
- wget http://sourceforge.net/projects/casadi/files/CasADi/$CASADIVERSION/linux/casadi-py27-np1.9.1-v$CASADIVERSION.tar.gz/download -O casadi-py27-np1.9.1-v$CASADIVERSION.tar.gz
- mkdir $HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- tar -zxf casadi-py27-np1.9.1-v$CASADIVERSION.tar.gz -C $HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- sudo apt-get install -y python-numpy python-scipy python-matplotlib swig valgrind moreutils
- mkdir -p $HOME/.matplotlib/
- "echo 'backend : Agg' > $HOME/.matplotlib/matplotlibrc"
- export PYTHONPATH=$PYTHONPATH:$HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- export CASADI_PREFIX=$HOME/casadi-py27-np1.9.1-v$CASADIVERSION
# A little bit of hacks; future CasADi version should not rely on these
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/casadi.i -O $CASADI_PREFIX/include/casadi.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/doc_merged.i -O $CASADI_PREFIX/include/doc_merged.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/python/numpy.hpp -O $CASADI_PREFIX/include/numpy.hpp
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/test/internal/valgrind-python.supp -O $CASADI_PREFIX/include/valgrind-python.supp
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/test/internal/valgrind-casadi.supp -O $CASADI_PREFIX/include/valgrind-casadi.supp
# End of hacks
- cmake -DWITH_MATLAB=OFF -DWITH_COVERAGE=ON .
- make
- cp src/*.so swig
- sudo pip install cpp-coveralls
after_success:
- coveralls --exclude swig --exclude CMakeFiles --gcov-options '\-lp'
- env:
- TARGET=LINUX-PYTHON
sudo: required
dist: trusty
language: minimal
script:
- ctest -V -R python
- ctest -V -R valgrind
install:
- wget http://sourceforge.net/projects/casadi/files/CasADi/$CASADIVERSION/linux/casadi-py27-np1.9.1-v$CASADIVERSION.tar.gz/download -O casadi-py27-np1.9.1-v$CASADIVERSION.tar.gz
- mkdir $HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- tar -zxf casadi-py27-np1.9.1-v$CASADIVERSION.tar.gz -C $HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- sudo apt-get install -y python-numpy python-scipy python-matplotlib swig valgrind moreutils
- mkdir -p $HOME/.matplotlib/
- "echo 'backend : Agg' > $HOME/.matplotlib/matplotlibrc"
- export PYTHONPATH=$PYTHONPATH:$HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- export CASADI_PREFIX=$HOME/casadi-py27-np1.9.1-v$CASADIVERSION
# A little bit of hacks; future CasADi version should not rely on these
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/casadi.i -O $CASADI_PREFIX/include/casadi.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/doc_merged.i -O $CASADI_PREFIX/include/doc_merged.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/python/numpy.hpp -O $CASADI_PREFIX/include/numpy.hpp
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/test/internal/valgrind-python.supp -O $CASADI_PREFIX/include/valgrind-python.supp
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/test/internal/valgrind-casadi.supp -O $CASADI_PREFIX/include/valgrind-casadi.supp
# End of hacks
- |
cat <<EOF | cat - swig/CMakeLists.txt | sponge swig/CMakeLists.txt
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "\\\$ORIGIN/src:\\\$ORIGIN:$CASADI_PREFIX/casadi:.")
- cmake -DWITH_MATLAB=OFF .
- make
- cp src/*.so swig
- env:
- TARGET=LINUX-MATLAB
- MATLABRELEASE=R2014a
- MATLAB_ROOT=$HOME/matlab
sudo: required
dist: trusty
language: minimal
script:
- #ctest -V -R matlab
install:
- sudo apt-get install -y binutils gcc g++ gfortran git cmake liblapack-dev ipython python-dev python-numpy python-scipy python-matplotlib libmumps-seq-dev libblas-dev liblapack-dev libxml2-dev
- sudo apt-get install fakeroot rpm alien moreutils
- wget http://sourceforge.net/projects/casadi/files/CasADi/$CASADIVERSION/linux/casadi-matlab${MATLABRELEASE}-v$CASADIVERSION.tar.gz/download -O casadi-matlab${MATLABRELEASE}-v$CASADIVERSION.tar.gz
- mkdir $HOME/casadi-matlab${MATLABRELEASE}-v$CASADIVERSION
- tar -zxf casadi-matlab${MATLABRELEASE}-v$CASADIVERSION.tar.gz -C $HOME/casadi-matlab${MATLABRELEASE}-v$CASADIVERSION
- export CASADI_PREFIX=$HOME/casadi-matlab${MATLABRELEASE}-v$CASADIVERSION
- export swig_matlab_file=swig_matlab
- bob_get ${swig_matlab_file}.tar.gz && mkdir $HOME/swig && tar -xf ${swig_matlab_file}.tar.gz -C $HOME/swig
- mkdir -p /home/travis/build/casadi/testbot && pushd /home/travis/build/casadi/testbot && ln -s $HOME/swig swig-matlab-install && popd
- export SWIGMATLAB=$HOME/swig/bin
- export PATH=$HOME/swig/bin:$HOME/swig/share:$PATH
- bob_get matlab$MATLABRELEASE.tar.gz
- mkdir $HOME/matlab && tar -xf matlab$MATLABRELEASE.tar.gz -C $HOME/matlab > /dev/null
# A little bit of hacks; future CasADi version should not rely on these
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/casadi.i -O $CASADI_PREFIX/include/casadi.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/doc_merged.i -O $CASADI_PREFIX/include/doc_merged.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/python/numpy.hpp -O $CASADI_PREFIX/include/numpy.hpp
# End of hacks
- |
cat <<EOF | cat - swig/CMakeLists.txt | sponge swig/CMakeLists.txt
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "\\\$ORIGIN/src:\\\$ORIGIN:$CASADI_PREFIX:.")
- cmake -DWITH_PYTHON=OFF .
- make
- sudo bash -c "echo '127.0.0.1 $FLEX_SERVER' >> /etc/hosts;echo '127.0.0.1 $FLEX_HOSTNAME' >> /etc/hosts"
- sudo hostname $FLEX_HOSTNAME
- mkdir -p ~/.matlab/${MATLABRELEASE}_licenses/
- echo -e "SERVER $FLEX_SERVER ANY 1725\nUSE_SERVER" > ~/.matlab/${MATLABRELEASE}_licenses/license.lic
- ssh-keyscan $GATE_SERVER >> ~/.ssh/known_hosts
- ssh -i $HOME/id_rsa_bob $USER_GATE@$GATE_SERVER -L 1701:$FLEX_SERVER:1701 -L 1719:$FLEX_SERVER:1719 -L 1718:$FLEX_SERVER:1718 -L 2015:$FLEX_SERVER:2015 -L 1815:$FLEX_SERVER:1815 -L 1725:$FLEX_SERVER:1725 -N &
- export PATH=$HOME/matlab/bin/:$PATH
- cp src/*.so swig
- env:
- TARGET=WINDOWS-MATLAB
- compilerprefix=x86_64-w64-mingw32
- MATLABRELEASE=R2014a
- MATLAB_ROOT=$HOME/matlab
sudo: required
dist: trusty
language: minimal
script:
- echo "all fine"
install:
- wget http://sourceforge.net/projects/casadi/files/CasADi/$CASADIVERSION/windows/casadi-matlab$MATLABRELEASE-v$CASADIVERSION.zip/download -O casadi-matlab$MATLABRELEASE.zip
- mkdir $HOME/casadi-matlab$MATLABRELEASE
- unzip casadi-matlab$MATLABRELEASE.zip -d $HOME/casadi-matlab$MATLABRELEASE
- export CASADI_PREFIX=$HOME/casadi-matlab$MATLABRELEASE
# A little bit of hacks; future CasADi version should not rely on these
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/casadi.i -O $CASADI_PREFIX/include/casadi.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/doc_merged.i -O $CASADI_PREFIX/include/doc_merged.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/python/numpy.hpp -O $CASADI_PREFIX/include/numpy.hpp
# End of hacks
- sudo apt-get update
- sudo apt-get install -y binutils gcc g++ gfortran git cmake cmake-data liblapack-dev ipython python-dev libxml2-dev
- mingw_setup
- export swig_matlab_file=swig_matlab
- bob_get ${swig_matlab_file}.tar.gz && mkdir $HOME/swig && tar -xf ${swig_matlab_file}.tar.gz -C $HOME/swig
- mkdir -p /home/travis/build/casadi/testbot && pushd /home/travis/build/casadi/testbot && ln -s $HOME/swig swig-matlab-install && popd
- export PATH=$HOME/swig/bin:$HOME/swig/share:$PATH
- export SWIGMATLAB=$HOME/swig/bin
- bob_get matlab$MATLABRELEASE-win.zip
- mkdir $HOME/matlab && unzip matlab$MATLABRELEASE-win.zip -d $HOME/matlab > /dev/null
- |
cat <<EOF >> swig/Basis.i
%begin %{
#define UINT64_T unsigned long long int
%}
- |
cat <<EOF > CMakeLists2.txt
set(MATLAB_LIBRARIES $MATLAB_ROOT/bin/win64/libut.dll $MATLAB_ROOT/bin/win64/libmex.dll $MATLAB_ROOT/bin/win64/libmx.dll $MATLAB_ROOT/bin/win64/libeng.dll)
set(MATLAB_INCLUDE_DIR "$MATLAB_ROOT/extern/include")
set(MATLAB_EXTRA_CXXFLAGS "-D__STDC_UTF_16__")
set(MATLAB_MEX_EXT "mexw64")
- grep -v "find_package(MATLAB" swig/CMakeLists.txt >> CMakeLists2.txt
- rm swig/CMakeLists.txt && mv CMakeLists2.txt swig/CMakeLists.txt
- |
cat <<EOF >toolchain.cmake
# this one is important
SET(CMAKE_SYSTEM_NAME Windows)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
SET(PREFIX $compilerprefix)
# specify the cross compiler
SET(CMAKE_C_COMPILER $compilerprefix-gcc)
SET(CMAKE_CXX_COMPILER $compilerprefix-g++)
SET(CMAKE_Fortran_COMPILER $compilerprefix-gfortran)
set(CMAKE_RC_COMPILER $compilerprefix-windres)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/$compilerprefix)
SET(CMAKE_CXX_FLAGS "-fno-ipa-cp-clone" CACHE STRING "" FORCE)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
set(CMAKE_SHARED_LIBRARY_SUFFIX "dll")
- cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DWITH_PYTHON=OFF .
- make VERBOSE=1
- cp src/*.dll swig
- env:
- TARGET=WINDOWS-PYTHON
- PYTHONVERSION=27
- NUMPYVERSION=1.9.1
- compilerprefix=i686-w64-mingw32
- BITNESS=32
- NUMPYSUFFIX=win32
- EXTRA_FLAGS=""
- WINEENV=py27
sudo: required
dist: trusty
language: minimal
script:
- echo "all fine"
install:
- sudo apt-get install -y binutils gcc g++ gfortran git cmake liblapack-dev ipython python-dev python-numpy python-scipy python-matplotlib coinor-libipopt-dev libmumps-seq-dev libblas-dev liblapack-dev libslicot-dev libxml2-dev
- sudo dpkg --add-architecture i386
- sudo apt-get update
- sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 -y
- wget https://raw.githubusercontent.com/casadi/python-lib-template/master/.travis-setup.sh && chmod +x .travis-setup.sh
- "./.travis-setup.sh"
- wget -O numpy.exe https://github.com/casadi/testbot/releases/download/perpetual/numpy-$NUMPYVERSION-sse2.exe
- /opt/wine-staging/bin/wine C:/Python27/Scripts/easy_install.exe numpy.exe && rm numpy.exe
- mingw_setup
- |
cat <<EOF >toolchain.cmake
# this one is important
SET(CMAKE_SYSTEM_NAME Windows)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
SET(PREFIX $compilerprefix)
# specify the cross compiler
SET(CMAKE_C_COMPILER $compilerprefix-gcc)
SET(CMAKE_CXX_COMPILER $compilerprefix-g++)
SET(CMAKE_Fortran_COMPILER $compilerprefix-gfortran)
set(CMAKE_RC_COMPILER $compilerprefix-windres)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/$compilerprefix)
SET(CMAKE_CXX_FLAGS "$EXTRA_FLAGS" CACHE STRING "" FORCE)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
- |
cat <<EOF >>patch.txt
find_library(PYTHON_LIBRARY
NAMES
python27
PATHS
/home/travis/.wine/drive_c/Python27/libs
NO_SYSTEM_ENVIRONMENT_PATH
)
find_path(PYTHON_INCLUDE_DIR
NAMES Python.h
PATHS
/home/travis/.wine/drive_c/Python27/include
NO_SYSTEM_ENVIRONMENT_PATH
)
set(PYTHON_EXECUTABLE /home/travis/.wine/drive_c/Python27/python.exe)
set(NUMPY_INCLUDE_DIR /home/travis/.wine/drive_c/Python27/Lib/site-packages/numpy-1.9.1-py2.7-$NUMPYSUFFIX.egg/numpy/core/include)
set(NUMPY_INCLUDED_DIRS /home/travis/.wine/drive_c/Python27/Lib/site-packages/numpy-1.9.1-py2.7-$NUMPYSUFFIX.egg/numpy/core/include/numpy)
set(NUMPY_PATH /home/travis/.wine/drive_c/Python27/Lib/site-packages/numpy-1.9.1-py2.7-$NUMPYSUFFIX.egg/numpy/core/include/numpy)
- cat patch.txt
- cat toolchain.cmake
- wget http://sourceforge.net/projects/casadi/files/CasADi/$CASADIVERSION/windows/casadi-py27-np1.9.1-v$CASADIVERSION.zip/download -O casadi-py27-np1.9.1-v$CASADIVERSION.zip
- mkdir $HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- unzip casadi-py27-np1.9.1-v$CASADIVERSION.zip -d $HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- export CASADI_PREFIX=$HOME/casadi-py27-np1.9.1-v$CASADIVERSION
- bob_get swig.tar.gz
- mkdir $HOME/swig && tar -xf swig.tar.gz -C $HOME/swig && rm swig.tar.gz
- mkdir -p /home/travis/build/casadi/testbot && pushd /home/travis/build/casadi/testbot && ln -s $HOME/swig swig-install && popd
- export PATH=$HOME/swig/bin:$HOME/swig/share:$PATH
- export SWIGMATLAB=$HOME/swig/bin
- cat patch.txt swig/CMakeLists.txt > temp.txt
- mv temp.txt swig/CMakeLists.txt
# A little bit of hacks; future CasADi version should not rely on these
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/casadi.i -O $CASADI_PREFIX/include/casadi.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/doc_merged.i -O $CASADI_PREFIX/include/doc_merged.i
- wget https://raw.githubusercontent.com/casadi/casadi/$CASADIVERSION/swig/python/numpy.hpp -O $CASADI_PREFIX/include/numpy.hpp
# End of hacks
# Fix for #1477 (part 1)
- sed -i -e 's/\"SwigPyObject\"/\"SwigPyCasadiObject\"/g' $HOME/swig/share/swig/2.0.12/python/pyrun.swg
- cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DWITH_MATLAB=OFF .
- make VERBOSE=1
# Fix for #1477 (part 2)
- sed -i -e "s/'SwigPyObject'/'SwigPyCasadiObject'/g" swig/Basis.py
- cp src/*.dll swig