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

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

try sandia mirror if ftp-netlib does not work

  • Property svn:executable set to *
File size: 1.2 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=ftp
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
20echo " "
21echo "Running script for downloading the source code for the ASL"
22echo " "
23
24rm -f solvers.tar
25echo "Downloading the source code from www.netlib.org..."
26if ! $wgetcmd ftp://www.netlib.org/ampl/solvers.tar ;
27then
28  echo
29  echo "Failed, try downloading the source code from netlib.sandia.gov..."
30  rm -f netlibfiles.tar*
31  $wgetcmd http://netlib.sandia.gov/cgi-bin/netlib/netlibfiles.tar?filename=netlib/ampl/solvers
32  mv netlibfiles.tar* solvers.tar
33fi
34
35rm -rf solvers
36
37echo "Unpacking the source code..."
38tar xf solvers.tar
39
40echo "Uncompressing the source files..."
41gunzip -fr solvers
42
43echo "Adding No_dtoa to CFLAGS..."
44cd solvers
45mv makefile.u makefile.u.orig
46sed -e 's/CFLAGS = /CFLAGS = -DNo_dtoa /g' makefile.u.orig > makefile.u
47cd ..
48
49echo "Deleting the tar file..."
50rm solvers.tar
51
52echo " "
53echo "Done downloading the source code for ASL."
54echo " "
55
Note: See TracBrowser for help on using the repository browser.