-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
199 lines (169 loc) · 10.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
# Inspiration: https://github.com/edx/configuration/blob/master/.travis.yml
dist: trusty
language: generic
env:
global:
- secure: "Bu8uBe0emUQyEYWCVnEvH8uvJISDPrCTa7KXVzJnR7GUFKLLnq31Uhjg33VG8/88Is4TP4Volp3QcJadI30D0zfTkI7mZTIwF3JqG7/GjwG5LXSsR2uQM+Rt+hssALubRAlua/5Ml4O8w+tm8IZfvgM3Z2QPiVQ2lMM5DUwFXGatumesKb3SaKj96tSiOIswLqYr/NWEnBaWqm4DUuTUEwN/X6mkS13Lq/3/YqB4r+FwFuyQMWNqV8+/OD2/C+uEBMJCw3vJOPtKlP7+vzrbKobP1t44opPL33HRAhKxJg2Z99OL61QygazX2DoadIapAbrE2y6lnk42o9973C8pIG8TEN0xH0fWtPQDpXzzsgTqtx/Xlw+S0j51wUViLP86OcrVgvTRO2Bt7RAOgWYnOBvPvPfUOdnzSrAL/gh8vg2QsB3FeCuTr31Cf+81FOZy2yDQhTsaWOKUwqmJdV2PL0eatzMPinl0lod7pXBRIDwryv8iVzW3oA9AEwpeXMBx/AibX9/ZEu1BSjxYAVMHCKlR+k2/sGsYVOu9QzPthN7T5S/d/reF/RY19wjIm3L3Hvp7ygEV/xGpvOR8F5dTUxtWLb7+DrNgy3g7texU7YcGJS88atre2BAeZWE1a0GbXQHbB9sgjprVahEXZLVVOiyLOdBqaBspUaIfsmOMcRg="
- MATLABPATH=/home/travis/build/matlab-install
- MATLAB_ROOT=/home/travis/build/matlab
- NUMPYVERSION=1.9.1
- GUROBI_HOME=/home/travis/build/gurobi
- KEEP_GOING=1
matrix:
- BUILD_TYPE=Release PYTHONVERSION=27 PYTHONVERSIONDOT=2.7 NAME_SUFFIX="" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py27 TESTCOMMIT="1"
- BUILD_TYPE=RelWithDebInfo PYTHONVERSION=27 PYTHONVERSIONDOT=2.7 NAME_SUFFIX="-Debug" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py27
- BUILD_TYPE=Release PYTHONVERSION=27 PYTHONVERSIONDOT=2.7 NAME_SUFFIX="-64bit" compilerprefix=x86_64-w64-mingw32 BITNESS=64 NUMPYSUFFIX=win-amd64 EXTRA_FLAGS="-DMS_WIN64" WINEENV=py27_64
- BUILD_TYPE=Release PYTHONVERSION=35 PY3=ON PYTHONVERSIONDOT=3.5 NAME_SUFFIX="" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py35
- BUILD_TYPE=Release PYTHONVERSION=35 PY3=ON PYTHONVERSIONDOT=3.5 NAME_SUFFIX="-64bit" compilerprefix=x86_64-w64-mingw32 BITNESS=64 NUMPYSUFFIX=win-amd64 EXTRA_FLAGS="-DMS_WIN64" WINEENV=py35_64
- BUILD_TYPE=Release PYTHONVERSION=34 PY3=ON PYTHONVERSIONDOT=3.4 NAME_SUFFIX="" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py34
- BUILD_TYPE=Release PYTHONVERSION=34 PY3=ON PYTHONVERSIONDOT=3.4 NAME_SUFFIX="-64bit" compilerprefix=x86_64-w64-mingw32 BITNESS=64 NUMPYSUFFIX=win-amd64 EXTRA_FLAGS="-DMS_WIN64" WINEENV=py34_64
- BUILD_TYPE=Release PYTHONVERSION=36 PY3=ON PYTHONVERSIONDOT=3.6 NAME_SUFFIX="" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py36
- BUILD_TYPE=Release PYTHONVERSION=36 PY3=ON PYTHONVERSIONDOT=3.6 NAME_SUFFIX="-64bit" compilerprefix=x86_64-w64-mingw32 BITNESS=64 NUMPYSUFFIX=win-amd64 EXTRA_FLAGS="-DMS_WIN64" WINEENV=py36_64
- BUILD_TYPE=Release PYTHONVERSION=37 PY3=ON PYTHONVERSIONDOT=3.7 NAME_SUFFIX="" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py37
- BUILD_TYPE=Release PYTHONVERSION=37 PY3=ON PYTHONVERSIONDOT=3.7 NAME_SUFFIX="-64bit" compilerprefix=x86_64-w64-mingw32 BITNESS=64 NUMPYSUFFIX=win-amd64 EXTRA_FLAGS="-DMS_WIN64" WINEENV=py37_64
- BUILD_TYPE=Release PYTHONVERSION=38 PY3=ON PYTHONVERSIONDOT=3.8 NAME_SUFFIX="" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py38
- BUILD_TYPE=Release PYTHONVERSION=38 PY3=ON PYTHONVERSIONDOT=3.8 NAME_SUFFIX="-64bit" compilerprefix=x86_64-w64-mingw32 BITNESS=64 NUMPYSUFFIX=win-amd64 EXTRA_FLAGS="-DMS_WIN64" WINEENV=py38_64
- BUILD_TYPE=Release PYTHONVERSION=39 PY3=ON PYTHONVERSIONDOT=3.9 NAME_SUFFIX="" compilerprefix=i686-w64-mingw32 BITNESS=32 NUMPYSUFFIX=win32 EXTRA_FLAGS="" WINEENV=py39
- BUILD_TYPE=Release PYTHONVERSION=39 PY3=ON PYTHONVERSIONDOT=3.9 NAME_SUFFIX="-64bit" compilerprefix=x86_64-w64-mingw32 BITNESS=64 NUMPYSUFFIX=win-amd64 EXTRA_FLAGS="-DMS_WIN64" WINEENV=py39_64
before_script:
- #set -e
- #set -o pipefail # otherwise, piping with grep discards exit statuses
script:
- pushd casadi
- mkdir build
- pushd build
- ls /home/travis/.wine/drive_c/Python$PYTHONVERSION/Lib/site-packages/
- |
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 $CPPFLAGS" CACHE STRING "" FORCE)
#SET(CMAKE_CXX_FLAGS "$EXTRA_FLAGS -DWITH_OPENMP -fopenmp" CACHE STRING "" FORCE)
#SET(CMAKE_C_FLAGS "-DWITH_OPENMP -fopenmp" 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)
EOF
- ls /home/travis/.wine/drive_c/Python$PYTHONVERSION/Lib/site-packages
- |
cat <<EOF >>patch.txt
find_library(PYTHON_LIBRARY
NAMES
python$PYTHONVERSION
PATHS
/home/travis/.wine/drive_c/Python$PYTHONVERSION/libs
NO_SYSTEM_ENVIRONMENT_PATH
)
find_path(PYTHON_INCLUDE_DIR
NAMES Python.h
PATHS
/home/travis/.wine/drive_c/Python$PYTHONVERSION/include
NO_SYSTEM_ENVIRONMENT_PATH
)
set(PYTHON_EXECUTABLE /home/travis/.wine/drive_c/Python$PYTHONVERSION/python.exe)
EOF
# Avoid checking python version
- if [ $PY3 ]; then echo "set(CMAKE_SWIG_FLAGS \${CMAKE_SWIG_FLAGS} \"-DWITH_PYTHON3\")" >> patch.txt; fi
- cat patch.txt ../swig/python/CMakeLists.txt > CMakeLists.txt
- mv CMakeLists.txt ../swig/python/CMakeLists.txt
- ls /home/travis/.wine/drive_c/Python$PYTHONVERSION/libs
- ls /home/travis/.wine/drive_c/Python$PYTHONVERSION
# Recent Python installers don't ship with libpython$VERSION.a
- pushd /home/travis/.wine/drive_c/Python$PYTHONVERSION/libs
- gendef - ../python$PYTHONVERSION.dll > python$PYTHONVERSION.def
- $compilerprefix-dlltool --input-def python$PYTHONVERSION.def --dllname /home/travis/.wine/drive_c/Python$PYTHONVERSION/python$PYTHONVERSION.dll --output-lib libpython$PYTHONVERSION.a
- popd
- bash -c "cmake $casadi_build_flags -DWITH_COMMON=ON -DWITH_SELFCONTAINED=ON -DBLA_STATIC=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DWITH_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../python_install -DPYTHON_PREFIX=../python_install .."
#- ls /home/travis/build/casadi/binaries/casadi/build/casadi/interfaces/snopt/
#- cat /home/travis/build/casadi/binaries/casadi/build/casadi/interfaces/snopt/CMakeFiles/casadi_nlpsol_snopt.dir/linklibs.rsp
- make VERBOSE=1
- make install
- $compilerprefix-dlltool --input-def ../casadi/core/casadi.def --dllname ../python_install/casadi/libcasadi.dll --output-lib ../python_install/casadi/casadi.lib
- $compilerprefix-dlltool --input-def ../external_packages/osqp/osqp.def --dllname ../python_install/casadi/libosqp.dll --output-lib ../python_install/casadi/osqp.lib
# Fix for #1477 (part 2)
- sed -i -e "s/'SwigPyObject'/'SwigPyCasadiObject'/g" ../python_install/casadi/casadi.py
- cp /usr/lib/gcc/$compilerprefix/*win32/*.dll ../python_install/casadi
- cp /usr/$compilerprefix/lib/*.dll ../python_install/casadi
- cp -RL /usr/$compilerprefix/include ../python_install/casadi/casadi/jit/mingw
#- cp -RL /usr/lib/gcc/$compilerprefix/4.6-win32/include/c++ ../python_install/casadi/casadi/jit/mingw/c++
- cp -R /home/travis/build/clang/include/c++/v1 ../python_install/casadi/casadi/jit/mingw/c++
#- cp -RL /usr/include/c++/4.6/$compilerprefix ../python_install/casadi/casadi/jit/mingw/c++
#- sudo apt-get install locate
#- sudo updatedb
#- locate cmath
#- sudo apt-get install apt-file
#- sudo apt-file update
#- apt-file search cmath
- popd
before_deploy:
- echo "this file (and the casadi directory) should end up in a folder called 'casadi-windows-py$PYTHONVERSION-$COMMIT'" > python_install/dummy.txt
- export RESULT="$HOME/casadi-windows-py$PYTHONVERSION-$COMMIT$NAME_SUFFIX.zip"
- pushd python_install && zip -r9 $RESULT . && popd
- export TRAVIS_TAG="commit-$COMMIT"
deploy:
overwrite: true
provider: releases
api_key: $github_token
file: $RESULT
skip_cleanup: true
on:
all_branches: true
branches:
except:
- /.*appveyor.*/
- /.*commit.*/
before_install:
- pushd casadi && export COMMIT=`git rev-parse --short=7 HEAD` && popd
- pushd ../../ && git clone https://github.com/casadi/testbot.git
- pushd testbot && source recipes/setup.sh && popd
- mkdir -p /home/travis/build/casadi/testbot
- sudo apt-get install p7zip-full zip -y
- export SLURP_OS=trusty
- export SLURP_CROSS=mingw
- slurp swig_matlab
# Fix for #1477 (part 1)
- swig_patch_pyobject
- slurp_common
- #export casadi_build_flags="$casadi_build_flags -DWITH_CPLEX=OFF"
- slurp lapack
#- git clone [email protected]:meganz/mingw-std-threads.git
- git clone [email protected]:jgillis/mingw-std-threads.git
- export CPPFLAGS="$CPPFLAGS -I$(pwd)/mingw-std-threads"
- echo $CPPFLAGS
- popd
- sudo apt-get update -qq
- sudo apt-get install -y binutils gcc g++ gfortran git cmake 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
- tree /home/travis/.wine/drive_c/Python$PYTHONVERSION
- /opt/wine-stable/bin/wine C:/Python$PYTHONVERSION/Scripts/easy_install.exe numpy.exe && rm numpy.exe
- pip install pysftp
- ssh-keyscan web.sourceforge.net >> ~/.ssh/known_hosts
- mingw_setup
jobs:
include:
- stage: firetest
script: test_commit test-windows
before_install:
- pushd ../../ && git clone https://github.com/casadi/testbot.git
- pushd testbot && source recipes/setup.sh && popd
deploy:
on:
branch: never
before_deploy: skip