source: ThirdParty/ASL/trunk/get.ASL @ 3570

Last change on this file since 3570 was 3570, checked in by tkr, 4 years ago

Changing to most recent version of ASL and adding COIN-OR backup in case downloading from Github fails

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/sh
2
3set -e
4
5wgetcmd="wget"
6wgetcount=`which wget 2>/dev/null | wc -l`
7if 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
18fi
19
20coinasl=2.0.3
21
22echo " "
23echo "Running script for downloading the source code for the ASL"
24echo " "
25
26rm -f $coinasl.tar.gz
27
28echo "Downloading the source code from Github..."
29if $wgetcmd https://github.com/ampl/mp/archive/$coinasl.tar.gz ;
30then
31  echo "Download finished."
32else
33  echo "Downloading from Github failed, trying www.coin-or.org..."
34  if $wgetcmd http://www.coin-or.org/BuildTools/ASL/$coinasl.tar.gz ;
35  then
36    echo "Download finished."
37  else
38    echo "Download failed...exiting"
39  fi
40fi
41
42rm -rf solvers
43
44echo "Unpacking the source code..."
45gunzip -f $coinasl.tar.gz
46tar xf $coinasl.tar
47mv mp-$coinasl/src/asl/solvers .
48rm -rf mp-$coinasl
49
50echo "Adding No_dtoa to CFLAGS..."
51cd solvers
52mv makefile.u makefile.u.orig
53sed -e 's/CFLAGS = /CFLAGS = -DNo_dtoa /g' makefile.u.orig > makefile.u
54cd ..
55
56echo "Deleting the tar file..."
57rm $coinasl.tar
58
59echo " "
60echo "Done downloading the source code for ASL."
61echo " "
62
Note: See TracBrowser for help on using the repository browser.