-
Notifications
You must be signed in to change notification settings - Fork 6
/
get.ASL
executable file
·62 lines (51 loc) · 1.27 KB
/
get.ASL
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
#!/bin/sh
set -e
wgetcount=`which wget 2>/dev/null | wc -l`
if test ! $wgetcount = 1; then
curlcount=`which curl 2>/dev/null | wc -l`
if test ! $curlcount = 1; then
fetchcount=`which fetch 2>/dev/null | wc -l`
if test ! $fetchcount = 1; then
echo "None of the utilities, wget, curl, or fetch found in PATH. Cannot download source."
exit -1
else
wgetcmd=fetch
fi
else
wgetcmd="curl -L -O"
fi
else
wgetcmd="wget"
fi
coinasl=solvers-64919f75f
echo " "
echo "Running script for downloading the source code for the ASL"
echo " "
rm -f $coinasl
echo "Downloading the source code from www.coin-or.org..."
if $wgetcmd https://coin-or-tools.github.io/ThirdParty-ASL/${coinasl}.tgz ;
then
echo "Download finished."
else
echo
echo "Downloading from COIN-OR failed, trying ampl.com..."
if $wgetcmd https://ampl.com/netlib/ampl/solvers.tgz ;
then
echo "Download finished."
mv solvers.tgz ${coinasl}.tgz
else
echo "Download failed...exiting"
fi
fi
rm -rf solvers
echo "Unpacking the source code..."
gunzip -f ${coinasl}.tgz
tar xf $coinasl.tar
echo "Applying patches"
patch -p0 < mingw.patch
patch -p0 < dtoa.patch
echo "Deleting the tar file..."
rm $coinasl.tar
echo " "
echo "Done downloading the source code for ASL."
echo " "