-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathshellhelpers
632 lines (564 loc) · 21.3 KB
/
shellhelpers
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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
function allowfail() {
ERR=$?
for var in "$@"
do
if [ $ERR -eq $var ]
then
$(exit 0);
return;
fi
done
$(exit $ERR);
}
function assertfail() {
ERR=$?
if [ $ERR -eq "0" ]
then
$(exit 1);
return;
fi
$(exit 0);
}
function osx_gcc49_setup() {
brew untap homebrew/versions # Authentication failed for 'https://github.com/Homebrew/homebrew-versions/'
brew update -v
#brew tap homebrew/science
echo "cask uninstall oclint"
brew cask uninstall oclint || allowfail
#brew install binutils p7zip gnupg
#brew upgrade gnupg
brew uninstall --force gcc49
pushd "$(brew --repo homebrew/core)" && git checkout 0ef7dea87d27e8de1474e160925d9a44dda09c2c && popd
pushd "$(brew --repo homebrew/cask)" && git checkout 0583489 && popd
export HOMEBREW_NO_AUTO_UPDATE=1
#brew uninstall --force gcc49
#wget -o $(brew --cache -s gcc49) https://homebrew.bintray.com/bottles/[email protected]_1.el_capitan.bottle.tar.gz
#brew install gcc49
export CC=gcc-4.9
export CXX=g++-4.9
export FC=gfortran-4.9
export F77=gfortran-4.9
echo "cellar"
ls /usr/local/Cellar/
# almost finished
brew unlink [email protected]
fetch_tar cellar
sudo cp -PR cellar/usr /
#sudo mkdir -p /usr/local/lib/gcc/4.9
#sudo cp /usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libgfortran.3.dylib /usr/local/lib/gcc/4.9/libgfortran.3.dylib
ls
ls cellar
#tar -xf cellar__gcc4.9.tar.gz -C /usr/local/Cellar
echo "linking"
brew link --verbose [email protected]
ls /usr/local/lib/gcc/
brew link libffi binutils p7zip gnupg
echo "cellar"
ls /usr/local/Cellar/
return
brew install --build-bottle binutils p7zip
brew reinstall gcc49 #--with-fortran
brew install libffi
#tar -zcf gcc4.9_cellar.tar.gz -C /usr/local/Cellar /usr/local/Cellar
#slurp_put gcc4.9_cellar
echo "done homebrew"
}
function osx_gcc7_setup() {
gcc --version
conda install -y -c conda-forge c-compiler==1.0.4 cxx-compiler==1.0.4 fortran-compiler==1.0.4
gcc --version
source activate condaenv_build
#conda install -y -c conda-pack
#conda pack -n condaenv_build -o gcc7_conda.tar.gz
#slurp_put gcc7_conda
brew update
brew install p7zip
cat <<EOF > a.txt
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
#ifndef __has_include
#define __has_include(x) 0
#endif
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef __has_extension
#define __has_extension(x) 0
#endif
EOF
}
function mingw_setup() {
sudo apt-get update -qq
sudo apt-get remove -qq -y mingw32
cat <<EOF | sudo tee --append /etc/apt/sources.list
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
EOF
cat <<EOF | sudo tee /etc/apt/preferences.d/mytest
Package: *
Pin: release n=trusty
Pin-priority: 700
Package: *
Pin: release n=xenial
Pin-priority: 600
EOF
sudo apt-get update -qq
sudo debconf-set-selections <<< "console-setup console-setup/charmap47 select UTF-8"
sudo debconf-set-selections <<< "console-setup console-setup/codeset47 select . Combined - Latin; Slavic Cyrillic; Greek"
sudo apt-get install -q -y -t xenial dpkg
sudo apt-get install -q -y -t xenial mingw-w64
sudo apt-get install -q -y -t xenial mingw-w64 g++-mingw-w64 gcc-mingw-w64 gfortran-mingw-w64 mingw-w64-tools
}
function osx_rpath_gcc7() {
ls $HOME/miniconda2/envs/condaenv_build/lib/
export CXX_FULL=$HOME/miniconda2/envs/condaenv_build/lib/libc++.1.dylib
# Got removed https://github.com/conda-forge/libcxx-feedstock/pull/45
#export CXXABI_FULL=$HOME/miniconda2/envs/condaenv_build/lib/libc++abi.1.dylib
export CXXABI_FULL=/usr/lib/libc++abi.dylib
export GOMP_FULL=$HOME/miniconda2/envs/condaenv_build/lib/libgomp.1.dylib
export FORTRAN_FULL=$HOME/miniconda2/envs/condaenv_build/lib/libgfortran.4.dylib
export QUADMATH_FULL=$HOME/miniconda2/envs/condaenv_build/lib/libquadmath.0.dylib
export GCC_FULL=$HOME/miniconda2/envs/condaenv_build/lib/libgcc_s.1.dylib
export FORTRAN_FULL_ALT=$FORTRAN_FULL
export QUADMATH_FULL_ALT=$QUADMATH_FULL
export GCC_FULL_ALT=$GCC_FULL
export GOMP_FULL_ALT=$GOMP_FULL
export CXX_FULL_ALT=$CXX_FULL
ls $FORTRAN_FULL_ALT
ls $FORTRAN_FULL
ls $QUADMATH_FULL_ALT
ls $QUADMATH_FULL
ls $GCC_FULL_ALT
ls $GCC_FULL
ls $GOMP_FULL_ALT
ls $GOMP_FULL
#ls $CXX_FULL_ALT
ls $CXX_FULL
echo 1
sudo install_name_tool -id "@rpath/libgfortran.4.dylib" $FORTRAN_FULL
echo 1
sudo install_name_tool -id "@rpath/libgfortran.4.dylib" $FORTRAN_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libquadmath.0.dylib" $QUADMATH_FULL
echo 1
sudo install_name_tool -id "@rpath/libquadmath.0.dylib" $QUADMATH_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libgcc_s.1.dylib" $GCC_FULL
echo 1
sudo install_name_tool -id "@rpath/libgcc_s.1.dylib" $GCC_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libgomp.1.dylib" $GOMP_FULL
echo 1
sudo install_name_tool -id "@rpath/libgomp.1.dylib" $GOMP_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libc++.1.dylib" $CXX_FULL
echo 1
echo 2
sudo install_name_tool -change $QUADMATH_FULL "@rpath/libquadmath.0.dylib" $FORTRAN_FULL
echo 2
sudo install_name_tool -change $GCC_FULL "@rpath/libgcc_s.1.dylib" $FORTRAN_FULL
echo 2
sudo install_name_tool -change $GCC_FULL "@rpath/libgcc_s.1.dylib" $QUADMATH_FULL
echo 2
sudo install_name_tool -change $GCC_FULL "@rpath/libgcc_s.1.dylib" $CXX_FULL
echo 2
sudo install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" $FORTRAN_FULL
echo 2
sudo install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" $QUADMATH_FULL
echo 2
sudo install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" $CXX_FULL
sudo install_name_tool -change $CXXABI_FULL "@rpath/libc++abi.dylib" $CXX_FULL
}
function osx_rpath() {
export FORTRAN_FULL_ALT=/usr/local/lib/gcc/4.9/libgfortran.3.dylib
export FORTRAN_FULL=/usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libgfortran.3.dylib
export QUADMATH_FULL_ALT=/usr/local/lib/gcc/4.9/libquadmath.0.dylib
export QUADMATH_FULL=/usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libquadmath.0.dylib
export GCC_FULL_ALT=/usr/local/lib/gcc/4.9/libgcc_s.1.dylib
export GCC_FULL=/usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libgcc_s.1.dylib
export GOMP_FULL_ALT=/usr/local/lib/gcc/4.9/libgomp.1.dylib
export GOMP_FULL=/usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libgomp.1.dylib
export CXX_FULL_ALT=/usr/local/Cellar/[email protected]/4.9.4/lib/gcc/4.9/libstdc++.6.dylib
export CXX_FULL=/usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libstdc++.6.dylib
ls $FORTRAN_FULL_ALT
ls $FORTRAN_FULL
ls $QUADMATH_FULL_ALT
ls $QUADMATH_FULL
ls $GCC_FULL_ALT
ls $GCC_FULL
ls $GOMP_FULL_ALT
ls $GOMP_FULL
#ls $CXX_FULL_ALT
ls $CXX_FULL
echo 1
sudo install_name_tool -id "@rpath/libgfortran.3.dylib" $FORTRAN_FULL
echo 1
sudo install_name_tool -id "@rpath/libgfortran.3.dylib" $FORTRAN_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libquadmath.0.dylib" $QUADMATH_FULL
echo 1
sudo install_name_tool -id "@rpath/libquadmath.0.dylib" $QUADMATH_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libgcc_s.1.dylib" $GCC_FULL
echo 1
sudo install_name_tool -id "@rpath/libgcc_s.1.dylib" $GCC_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libgomp.1.dylib" $GOMP_FULL
echo 1
sudo install_name_tool -id "@rpath/libgomp.1.dylib" $GOMP_FULL_ALT
echo 1
sudo install_name_tool -id "@rpath/libstdc++.6.dylib" $CXX_FULL
echo 1
echo 2
sudo install_name_tool -change $QUADMATH_FULL "@rpath/libquadmath.0.dylib" $FORTRAN_FULL
echo 2
sudo install_name_tool -change $GCC_FULL "@rpath/libgcc_s.1.dylib" $FORTRAN_FULL
echo 2
sudo install_name_tool -change $GCC_FULL "@rpath/libgcc_s.1.dylib" $QUADMATH_FULL
echo 2
sudo install_name_tool -change $GCC_FULL "@rpath/libgcc_s.1.dylib" $CXX_FULL
echo 2
sudo install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" $FORTRAN_FULL
echo 2
sudo install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" $QUADMATH_FULL
echo 2
sudo install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" $CXX_FULL
}
function osx_rpath_restore() {
echo "sudo install_name_tool -id $FORTRAN_FULL $FORTRAN_FULL"
sudo install_name_tool -id "$FORTRAN_FULL" $FORTRAN_FULL
sudo install_name_tool -id "$QUADMATH_FULL" $QUADMATH_FULL
sudo install_name_tool -id "$GCC_FULL" $GCC_FULL
#sudo install_name_tool -id "/usr/local/lib/gcc/4.9/libgcc_s.1.dylib" /usr/local/lib/gcc/4.9/libgcc_s.1.dylib
sudo install_name_tool -id "$GOMP_FULL" $GOMP_FULL
sudo install_name_tool -id "$CXX_FULL" $CXX_FULL
sudo install_name_tool -change "@rpath/libgcc_s.1.dylib" $GCC_FULL $QUADMATH_FULL
sudo install_name_tool -change "@rpath/libgcc_s.1.dylib" $GCC_FULL $FORTRAN_FULL
sudo install_name_tool -change "@rpath/libgcc_s.1.dylib" $GCC_FULL $CXX_FULL
sudo install_name_tool -change "@rpath/libquadmath.0.dylib" $QUADMATH_FULL $FORTRAN_FULL
}
function osx_rpath_patch() {
sudo find $1 -name "*.dylib" -exec install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" {} \;
sudo find $1 -name "*.so" -exec install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" {} \;
sudo find $1 -name "*.mexmaci64" -exec install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" {} \;
sudo find $1 -name "*.mex" -exec install_name_tool -change $GCC_FULL_ALT "@rpath/libgcc_s.1.dylib" {} \;
}
function python_setup_light() {
if [[ $TRAVIS_OS_NAME == *linux* ]]
then
wget http://repo.continuum.io/miniconda/Miniconda2-py27_4.8.3-Linux-x86_64.sh -O miniconda.sh
else
wget http://repo.continuum.io/miniconda/Miniconda2-py27_4.8.3-MacOSX-x86_64.sh -O miniconda.sh
fi
chmod +x miniconda.sh
./miniconda.sh -b
export PATH=$HOME/miniconda2/bin:$PATH
#conda update --yes conda
conda create --quiet --yes -n condaenv python=2.7 requests pyyaml libgcc
conda install --quiet --yes -n condaenv pip
source activate condaenv
pip install --quiet pysftp
}
function python_setup() {
if [[ -z "$PYTHON_VERSION" ]]
then
export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
fi
echo "py $PYTHON_VERSION"
conda config --set ssl_verify no
conda update --prefix $HOME/miniconda2 conda --yes
if [[ $TRAVIS_OS_NAME == *linux* ]]
then
conda create --quiet --yes -n condaenv_build -c conda-forge python=$PYTHON_VERSION requests pyyaml numpy scipy matplotlib # ==0.31.1
else
cp /usr/local//Cellar/libffi/3.2.1/lib/libffi.6.dylib /Users/travis/miniconda2/lib/
conda create --quiet --yes -n condaenv_build -c conda-forge python=$PYTHON_VERSION requests pyyaml numpy scipy wheel matplotlib
fi
conda install --quiet --yes -n condaenv_build pip
source activate condaenv_build
echo "pip install wheel==0.31.1"
pip install wheel==0.31.1
python -c "import wheel;print(wheel)"
export PYTHONVERSION_DOT3=`python -c "import sys;print('%s.%s.%s' % sys.version_info[:3])"`
echo ":$PYTHONVERSION_DOT3:"
export PYTHONVERSION_DOT2=`python -c "import sys;print('%s.%s' % sys.version_info[:2])"`
echo ":$PYTHONVERSION_DOT2:"
export PYTHONVERSION=`python -c "import sys;print('%s%s' % sys.version_info[:2])"`
echo ":$PYTHONVERSION:"
export PYTHONVERSION1=`python -c "import sys;print(sys.version_info[0])"`
echo ":$PYTHONVERSION1:"
if [[ $PYTHONVERSION1 == 3 ]]
then
export WITH_PYTHON3=ON
if [[ $PYTHONVERSION == 38 || $PYTHONVERSION == 39 ]]
then
export PYTHONLIB_MOD=
export PYTHONDIR_MOD=
else
export PYTHONLIB_MOD=m
export PYTHONDIR_MOD=m
fi
else
export PYTHONLIB_MOD=
export PYTHONDIR_MOD=m
fi
pip install --quiet pysftp
echo "foobar"
ls $HOME/miniconda2/envs/condaenv_build/lib
ls $HOME/miniconda2/envs/condaenv_build/include
ls $HOME/miniconda2/envs/condaenv_build/bin
export CMAKE_PYTHON_LIBRARY=$HOME/miniconda2/envs/condaenv_build/lib/libpython${PYTHONVERSION_DOT2}${PYTHONLIB_MOD}
if [[ $TRAVIS_OS_NAME == *linux* ]]
then
export CMAKE_PYTHON_LIBRARY=${CMAKE_PYTHON_LIBRARY}.so
else
export CMAKE_PYTHON_LIBRARY=${CMAKE_PYTHON_LIBRARY}.dylib
fi
export CMAKE_PYTHON_INCLUDE_DIR=$HOME/miniconda2/envs/condaenv_build/include/python${PYTHONVERSION_DOT2}${PYTHONLIB_MOD}
export MANYLINUX_PYTHON_DIR=/opt/python/cp${PYTHONVERSION}-cp${PYTHONVERSION}${PYTHONDIR_MOD}
export MANYLINUX_PYTHON3_BIN=/opt/python/cp36-cp36m/bin
export MANYLINUX_PYTHON3=$MANYLINUX_PYTHON3_BIN/python
ls /opt/python/
export MANYLINUX_PYTHON_INCLUDE_DIR=${MANYLINUX_PYTHON_DIR}/include/python${PYTHONVERSION_DOT2}${PYTHONLIB_MOD}/
}
function pinning() {
cat <<EOF | sudo tee --append /etc/apt/sources.list
deb-src http://archive.ubuntu.com/ubuntu $1 main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu $1 main restricted universe multiverse
EOF
cat <<EOF | sudo tee /etc/apt/preferences.d/mytest
Package: *
Pin: release n=trusty
Pin-priority: 700
Package: *
Pin: release n=$1
Pin-priority: 600
EOF
sudo apt-get update -qq
}
function dockcross_setup_start() {
if [[ $BITNESS == *64* ]]
then
if [[ $PYTHONVERSION == 38 || $PYTHONVERSION == 39 ]]
then
export ARCH=${DOCKCROSS}1-x64
else
export ARCH=${DOCKCROSS}-x64
fi
else
if [[ $PYTHONVERSION == 38 || $PYTHONVERSION == 39 ]]
then
export ARCH=${DOCKCROSS}1-x86
else
export ARCH=${DOCKCROSS}-x86
fi
fi
echo $PATH > $HOME/pathold.txt
if [[ $PYTHONVERSION == 38 || $PYTHONVERSION == 39 ]]
then
docker pull dockcross/$ARCH:latest
docker run --rm dockcross/$ARCH:latest > dockcross
else
docker pull jgillis/dockcross-$ARCH:v1
docker run --rm jgillis/dockcross-$ARCH:v1 > dockcross
fi
chmod +x ./dockcross
cat dockcross
if [[ $PYTHONVERSION == 38 || $PYTHONVERSION == 39 ]]
then
echo "done"
else
sed -i "s/dockcross\/$ARCH/jgillis\/dockcross-$ARCH:v1/" dockcross
fi
perl -p -i -e 's/^ +-v.*$/ -v \$HOME:\$HOME -v \/:\/host \\/g;s/^ +\$HOST_VOLUMES .*/ -w \$HOST_PWD --env-file \$HOME\/env.txt \\/g;s/^ +\$FINAL_IMAGE \"\$@\"/ \$FINAL_IMAGE \$HOME\/dockcross_at_start_trigger \"\$@\"/g;' dockcross
chmod +x ./dockcross
echo -e "#!/usr/bin/env bash\nsource \$HOME/dockcross_at_start\neval \$@" > $HOME/dockcross_at_start_trigger
chmod +x $HOME/dockcross_at_start_trigger
touch $HOME/dockcross_at_start
touch $HOME/env.txt
./dockcross "echo 123"
export PATH=`pwd`:$PATH
echo "dockcross_setup_start done"
}
function dockcross_setup_finish() {
cat $HOME/dockcross_at_start
printenv | grep -v miniconda | grep -v CC= | grep -v FC= | grep -v CXX= > $HOME/env.txt
echo $PATH > $HOME/pathnew.txt
echo -n "$MANYLINUX_PYTHON_DIR/bin/:" > $HOME/pathcross.txt
echo $PATH
cat $HOME/pathcross.txt
echo 'hey123'
dockcross "echo -n \$PATH"
dockcross "echo -n \$PATH" >> $HOME/pathcross.txt
echo 'hey123'
cat $HOME/pathcross.txt
echo 'end'
python -c "n = open('$HOME/pathnew.txt','r').read().split(':');o = open('$HOME/pathold.txt','r').read().split(':');print('PATH=%s:%s' % (open('$HOME/pathcross.txt','r').read().rstrip(),':'.join([i.rstrip() for i in n if i not in o and 'miniconda' not in i])))" >> $HOME/env.txt
cat $HOME/pathnew.txt
echo '12'
cat $HOME/pathold.txt
echo '12'
cat $HOME/pathcross.txt
}
function remote_access() {
(while true ; do sleep 60 ; echo "ping" ; done ) &
source $TESTBOT_DIR/restricted/env.sh
ssh-keyscan serveo.net >> ~/.ssh/known_hosts
echo -e "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNPkKyOfNMobbgIqD0WvkBTzhEs6St8GYC7aYPT4C0eMimuUBJoQbuUeZQS3hkk9RcdG6h8z0Da70mMV82rcWgztE0obdULduOqDV0GrL6TiqaxoHGTEHPzkq7G48B48S+kmQba0rqURtMJ6SLdr/jElJhnVFC2SC8cYz4Q5BikcuX16LNhxLTxcWSq9Ug9cGO/Gc65n2tKUqPy9Ky4LEURBF3zmUftUdR7wE0GUahsti1aDAQGNbB2ccrpUZWQkVxTzol4ABaCEDo1wBPuug4CBuy+kaIj2aDi01z5D52ED2jsa+g38PStV8zJFFrJJMY10RwigMhHVoOfd7bMF3H jgillis@jglab-work" >> ~/.ssh/authorized_keys
whoami
export -p > $HOME/env.txt
ssh -R casadidebug:22:localhost:22 serveo.net
# login with ssh -J serveo.net travis@casadidebug
}
function test_commit() {
if [ $TESTCOMMIT ]; then
pushd $HOME/build/casadi/binaries
git config --global user.email "[email protected]"
git config --global user.name "casaditestbot"
git remote add github [email protected]:casadi/binaries.git
echo "a"
git submodule sync
echo "b"
git submodule update
echo "c"
git fetch github || allowfail 1
echo "d"
git checkout $1
git commit -a -m "automatic test commit $COMMIT" || allowfail 1
test $(git status --porcelain | grep UU | wc -c) -eq 0
git push github $1
popd
fi
}
function cp_libs() {
cp $FORTRAN_FULL $QUADMATH_FULL $GCC_FULL $CXX_FULL $1
}
function cp_libs_gcc7() {
cp $FORTRAN_FULL $QUADMATH_FULL $GCC_FULL $CXX_FULL $CXXABI_FULL $1
}
function matlabgcc() {
export LD_PRELOAD=/home/travis/miniconda2/pkgs/libgcc-5.2.0-0/lib/libstdc++.so.6
}
function bake_my_library_path() {
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
IFS=":"
pushd /usr/local/lib
for i in $MY_LIBRARY_PATH; do
if [ -n "$i" ];
then
sudo ln -s $i/* . || echo "file existed"
fi
done
popd
fi
}
function before_install_debian() {
echo "start before_install_debian at:"
pwd
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-get update
python_setup
dockcross_setup_start
export SLURP_OS=dockcross
export SLURP_CROSS=$DOCKCROSS
sudo apt-get install p7zip-full -y
slurp swig
slurp_common
slurp lapack
popd
sudo apt-get install -y binutils gcc g++ gfortran cmake liblapack-dev libmumps-seq-dev libblas-dev liblapack-dev libxml2-dev fakeroot rpm alien
echo "finish before_install_debian at:"
pwd
}
function before_install_osx() {
for i in {1..30}; do echo "start before_install_osx at:"; done
pwd
python_setup
for i in {1..30}; do echo "foo"; done
osx_gcc7_setup
for i in {1..30}; do echo "baz"; done
gcc --version
for i in {1..30}; do echo "bar"; done
slurp swig_matlab
for i in {1..30}; do echo "foo"; done
mkdir -p /Users/travis/build/casadi/testbot
slurp_common
slurp lapack
for i in {1..30}; do echo "bar"; done
bake_my_library_path
for i in {1..30}; do echo "baz"; done
popd
echo "finish before_install_osx at:"
pwd
}
function script_osx() {
echo "start script_osx at:"
pwd
pkg-config --libs --cflags ipopt
pkg-config --libs --cflags bonmin
pwd
ls
pushd casadi
pwd
ls
mkdir build
pushd build
gcc --version
source activate condaenv_build
gcc --version
echo $MY_LIBRARY_PATH
echo "MY_LIBRARY_PATH"
echo $DYLD_LIBRARY_PATH
bash -c "cmake $casadi_build_flags $2 .."
osx_rpath_gcc7
make VERBOSE=1
sudo mkdir -p /ColPack_libs
sudo chmod 777 /ColPack_libs
make install
popd
cp_libs_gcc7 $1/casadi
osx_rpath_patch $1/casadi
cp $HOME/extra_libs/* $1/casadi
otool -l $FORTRAN_FULL
otool -l $QUADMATH_FULL
otool -l $GCC_FULL
otool -l $1/casadi/libgfortran.3.dylib | grep /usr/local || assertfail
otool -l $1/casadi/libgcc_s.1.dylib | grep /usr/local || assertfail
otool -l $1/casadi/libquadmath.0.dylib | grep /usr/local || assertfail
otool -l $1/casadi/libcasadi.dylib | grep /usr/local || assertfail
echo "finish script_osx at:"
pwd
}
function script_debian() {
echo "start script_debian at:"
pwd
pushd casadi
mkdir build
pushd build
export BACKUP_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
dockcross_setup_finish
grep "CONFIG_PATH" $HOME/env.txt
echo $casadi_build_flags
dockcross "echo \$PKG_CONFIG_PATH"
dockcross "export CASADI_EXTRA_LIBRARIES_LAPACK=gfortran;export PKG_CONFIG_PATH=$BACKUP_PKG_CONFIG_PATH;cmake $casadi_build_flags $2 .."
dockcross "make install VERBOSE=1"
popd
pwd
ls
ls $1
export WHEEL=`python $HOME/build/testbot/create_wheel_local.py $COMMIT $PYTHONVERSION linux $BITNESS $1`
echo $WHEEL
git clone https://github.com/jgillis/auditwheel
dockcross "$MANYLINUX_PYTHON3_BIN/pip install pyelftools wheel==0.31.1 && pushd auditwheel && $MANYLINUX_PYTHON3 setup.py install && popd && echo "$MANYLINUX_PYTHON3_BIN/auditwheel repair -g quadmath -g gfortran -e '.*snopt.*' -L . --no-update-tags -w . $WHEEL" && $MANYLINUX_PYTHON3_BIN/auditwheel repair -g quadmath -g gfortran -e '.*snopt.*' -L . --no-update-tags -w . $WHEEL"
rm -rf $1
unzip $WHEEL -d $1
rm -rf $1/*dist-info
pushd $1/casadi/jit || pushd $1/casadi/casadi/jit && ls && bash get_system_includes.sh gcc-4.8 c++ > system_includes.txt && popd
echo "finish script_debian at:"
pwd
}