-
Notifications
You must be signed in to change notification settings - Fork 3
/
get.Glpk
executable file
·68 lines (53 loc) · 1.44 KB
/
get.Glpk
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
#!/bin/sh
set -e
glpk_ver=4.65
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
echo " "
echo "Running script to download the source code for GLPK $glpk_ver."
echo " "
rm -f glpk*.tar.gz
echo "Downloading the source code from ftp.gnu.org..."
$wgetcmd http://ftp.gnu.org/gnu/glpk/glpk-${glpk_ver}.tar.gz
echo "Uncompressing the tarball..."
gunzip -f glpk-${glpk_ver}.tar.gz
if test -d glpk ; then
echo "Moving current glpk to glpk.OLD."
if test -d glpk.OLD ; then
rm -rf glpk.OLD
fi
mv glpk glpk.OLD
fi
echo "Unpacking the source code..."
tar xf glpk-${glpk_ver}.tar
echo "Deleting the tar file..."
rm glpk-${glpk_ver}.tar
mv glpk-${glpk_ver} glpk
echo " "
echo "Done downloading the source code for GLPK."
echo "Installing modified configuration files."
cp -r glpk_config_files/* glpk/
echo "Touch every source file to force rebuild of whole package."
if ls glpk/src/*.c &>/dev/null ; then
touch glpk/src/*.c
fi
if ls glpk/src/*/*.c &>/dev/null ; then
touch glpk/src/*/*.c
fi
echo " "
echo "Verify that there are no error message in the output above."