source: ThirdParty/Blas/stable/1.3/get.Blas @ 2948

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

read -n 1 does not work with any sh

  • Property svn:executable set to *
File size: 1.8 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
20coinblas=blas-20130815.tgz
21
22echo " "
23echo "Running script for downloading the source code for BLAS"
24echo " "
25
26rm -f blas.tgz
27
28echo "Downloading the source code from projects.coin-or.org..."
29if $wgetcmd https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/src/$coinblas ;
30then
31  mv $coinblas blas.tgz
32else
33  echo
34  echo "Failed, try downloading the source code from www.netlib.org..."
35  if ! $wgetcmd http://www.netlib.org/blas/blas.tgz ;
36  then
37    echo
38    echo "Failed, try downloading the source code from netlib.sandia.gov..."
39    if ! $wgetcmd http://netlib.sandia.gov/blas/blas.tgz ;
40    then
41      if test "$wgetcmd" = wget ;
42      then
43        echo -n "Failed, try downloading from https://projects.coin-or.org without certificate check? (y/n) "
44        if test "$1" = "-y" ;
45        then
46          doit=y
47          echo y
48        else
49          read doit
50          echo
51        fi
52        if test "$doit" = y ;
53        then
54          $wgetcmd --no-check-certificate https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/src/$coinblas
55          mv $coinblas blas.tgz
56        else
57          exit 1;
58        fi
59      else
60        exit 1;
61      fi
62    fi
63  fi
64fi
65
66echo "Uncompressing the tarball..."
67gunzip -f blas.tgz
68
69echo "Unpacking the source code..."
70tar xf blas.tar
71
72echo "Deleting the tar file..."
73rm blas.tar
74
75echo "Moving the source files from BLAS subdirectory"
76mv BLAS/*.f .
77rm -rf BLAS
78
79echo " "
80echo "Done downloading the source code for BLAS."
81echo " "
82
Note: See TracBrowser for help on using the repository browser.