Rev | Line | |
---|
[45] | 1 | #!/bin/sh |
---|
| 2 | |
---|
[386] | 3 | set -e |
---|
| 4 | |
---|
[2868] | 5 | wgetcmd="wget" |
---|
[1546] | 6 | wgetcount=`which wget 2>/dev/null | wc -l` |
---|
[45] | 7 | if test ! $wgetcount = 1; then |
---|
| 8 | echo "Utility wget not found in your PATH." |
---|
[520] | 9 | if test `uname` = Darwin; then |
---|
[2845] | 10 | wgetcmd="curl -L -k -O" |
---|
[520] | 11 | echo "Using ftp command instead." |
---|
[2562] | 12 | elif test `uname` = FreeBSD; then |
---|
| 13 | wgetcmd=fetch |
---|
| 14 | echo "Using fetch command instead." |
---|
[520] | 15 | else |
---|
| 16 | exit -1 |
---|
| 17 | fi |
---|
[45] | 18 | fi |
---|
| 19 | |
---|
[3061] | 20 | coinasl=solvers-20130815.tgz |
---|
[2868] | 21 | |
---|
[45] | 22 | echo " " |
---|
| 23 | echo "Running script for downloading the source code for the ASL" |
---|
| 24 | echo " " |
---|
| 25 | |
---|
[3061] | 26 | rm -f solvers.tgz |
---|
[2845] | 27 | |
---|
| 28 | echo "Downloading the source code from projects.coin-or.org..." |
---|
[3061] | 29 | if $wgetcmd http://www.coin-or.org/BuildTools/ASL/$coinasl ; |
---|
[2826] | 30 | then |
---|
[3061] | 31 | mv $coinasl solvers.tgz |
---|
[2845] | 32 | else |
---|
[2826] | 33 | echo |
---|
[3061] | 34 | echo "Failed, try downloading the source code from www.ampl.com..." |
---|
| 35 | $wgetcmd http://www.ampl.com/netlib/ampl/solvers.tgz |
---|
[2826] | 36 | fi |
---|
[45] | 37 | |
---|
[588] | 38 | rm -rf solvers |
---|
| 39 | |
---|
[45] | 40 | echo "Unpacking the source code..." |
---|
[3061] | 41 | gunzip -f solvers.tgz |
---|
[45] | 42 | tar xf solvers.tar |
---|
| 43 | |
---|
[3106] | 44 | #echo "Uncompressing the source files..." |
---|
| 45 | #gunzip -fr solvers |
---|
[45] | 46 | |
---|
[1084] | 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 | |
---|
[45] | 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.