source: ThirdParty/ASL/stable/1.2/get.ASL @ 3049

Last change on this file since 3049 was 3049, checked in by stefan, 6 years ago

sync with trunk

  • Property svn:executable set to *
File size: 1.9 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=solvers-20130815.tar
21
22echo " "
23echo "Running script for downloading the source code for the ASL"
24echo " "
25
26rm -f solvers.tar
27
28echo "Downloading the source code from projects.coin-or.org..."
29if $wgetcmd https://projects.coin-or.org/svn/BuildTools/ThirdParty/ASL/src/$coinasl ;
30then
31  mv $coinasl solvers.tar
32else
33  echo
34  tryamplcom=1
35  if test "$wgetcmd" = wget ;
36  then
37    # the ASL tarball on ampl.com is changing over time, so we give the coin-or server another chance first
38    echo -n "Failed, try downloading from https://projects.coin-or.org without certificate check? (y/n) "
39    if test "$1" = "-y" ;
40    then
41      doit=y
42      echo y
43    else
44      read doit
45      echo
46    fi
47    if test "$doit" = y ;
48    then
49      if $wgetcmd --no-check-certificate https://projects.coin-or.org/svn/BuildTools/ThirdParty/ASL/src/$coinasl ;
50      then
51        mv $coinasl solvers.tar
52        tryamplcom=0
53      fi
54    fi
55  fi
56  if test $tryamplcom = 1 ;
57  then
58    echo
59    echo "Failed, try downloading the source code from www.ampl.com..."
60    $wgetcmd http://www.ampl.com/netlib/ampl/solvers.tgz ;
61    gunzip solvers.tgz
62  fi
63fi
64
65rm -rf solvers
66
67echo "Unpacking the source code..."
68tar xf solvers.tar
69
70echo "Uncompressing the source files..."
71gunzip -fr solvers
72
73echo "Adding No_dtoa to CFLAGS..."
74cd solvers
75mv makefile.u makefile.u.orig
76sed -e 's/CFLAGS = /CFLAGS = -DNo_dtoa /g' makefile.u.orig > makefile.u
77cd ..
78
79echo "Deleting the tar file..."
80rm solvers.tar
81
82echo " "
83echo "Done downloading the source code for ASL."
84echo " "
85
Note: See TracBrowser for help on using the repository browser.