Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | set -e |
---|
4 | |
---|
5 | wgetcmd="wget" |
---|
6 | wgetcount=`which wget 2>/dev/null | wc -l` |
---|
7 | if test ! $wgetcount = 1; then |
---|
8 | echo "Utility wget not found in your PATH." |
---|
9 | if test `uname` = Darwin; then |
---|
10 | wgetcmd="curl -L -k -O" |
---|
11 | echo "Using ftp command instead." |
---|
12 | elif test `uname` = FreeBSD; then |
---|
13 | wgetcmd=fetch |
---|
14 | echo "Using fetch command instead." |
---|
15 | else |
---|
16 | exit -1 |
---|
17 | fi |
---|
18 | fi |
---|
19 | |
---|
20 | coinasl=solvers-20130815.tgz |
---|
21 | |
---|
22 | echo " " |
---|
23 | echo "Running script for downloading the source code for the ASL" |
---|
24 | echo " " |
---|
25 | |
---|
26 | rm -f solvers.tgz |
---|
27 | |
---|
28 | echo "Downloading the source code from projects.coin-or.org..." |
---|
29 | if $wgetcmd http://www.coin-or.org/BuildTools/ASL/$coinasl ; |
---|
30 | then |
---|
31 | mv $coinasl solvers.tgz |
---|
32 | else |
---|
33 | echo |
---|
34 | echo "Failed, try downloading the source code from www.ampl.com..." |
---|
35 | $wgetcmd http://www.ampl.com/netlib/ampl/solvers.tgz |
---|
36 | fi |
---|
37 | |
---|
38 | rm -rf solvers |
---|
39 | |
---|
40 | echo "Unpacking the source code..." |
---|
41 | gunzip -f solvers.tgz |
---|
42 | tar xf solvers.tar |
---|
43 | |
---|
44 | #echo "Uncompressing the source files..." |
---|
45 | #gunzip -fr solvers |
---|
46 | |
---|
47 | echo "Adding No_dtoa to CFLAGS..." |
---|
48 | cd solvers |
---|
49 | mv makefile.u makefile.u.orig |
---|
50 | sed -e 's/CFLAGS = /CFLAGS = -DNo_dtoa /g' makefile.u.orig > makefile.u |
---|
51 | cd .. |
---|
52 | |
---|
53 | echo "Deleting the tar file..." |
---|
54 | rm solvers.tar |
---|
55 | |
---|
56 | echo " " |
---|
57 | echo "Done downloading the source code for ASL." |
---|
58 | echo " " |
---|
59 | |
---|
Note: See
TracBrowser
for help on using the repository browser.