source: ThirdParty/Lapack/stable/1.4/get.Lapack @ 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.9 KB
Line 
1#!/bin/sh
2
3set -e
4
5lapack_ver=3.4.2
6
7wgetcmd="wget"
8wgetcount=`which wget 2>/dev/null | wc -l`
9if test ! $wgetcount = 1; then
10  echo "Utility wget not found in your PATH."
11  if test `uname` = Darwin; then
12    wgetcmd="curl -L -k -O"
13    echo "Using ftp command instead."
14  elif test `uname` = FreeBSD; then
15    wgetcmd=fetch
16    echo "Using fetch command instead."
17  else
18    exit -1
19  fi
20fi
21
22echo " "
23echo "Running script for downloading the source code for LAPACK"
24echo " "
25
26rm -f lapack-${lapack_ver}.tgz
27
28echo "Downloading the source code from projects.coin-or.org..."
29if ! $wgetcmd https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/src/lapack-${lapack_ver}.tgz ;
30then
31  echo
32  echo "Failed, try downloading the source code from www.netlib.org..."
33  if ! $wgetcmd http://www.netlib.org/lapack/lapack-${lapack_ver}.tgz ;
34  then
35    echo
36    echo "Failed, try downloading the source code from netlib.sandia.gov..."
37    if ! $wgetcmd http://netlib.sandia.gov/lapack/lapack-${lapack_ver}.tgz
38    then
39      if test "$wgetcmd" = wget ;
40      then
41        echo -n "Failed, try downloading from https://projects.coin-or.org without certificate check? (y/n) "
42        if test "$1" = "-y" ;
43        then
44          doit=y
45          echo y
46        else
47          read doit
48          echo
49        fi
50        if test "$doit" = y ;
51        then
52          $wgetcmd --no-check-certificate https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/src/lapack-${lapack_ver}.tgz
53        else
54          exit 1;
55        fi
56      else
57        exit 1;
58      fi
59    fi
60  fi
61fi
62
63echo "Uncompressing the tarball..."
64gunzip -f lapack-${lapack_ver}.tgz
65
66echo "Unpacking the source code..."
67tar xf lapack-${lapack_ver}.tar lapack-${lapack_ver}/SRC lapack-${lapack_ver}/INSTALL/dlamch.f lapack-${lapack_ver}/INSTALL/slamch.f
68rm -rf LAPACK
69mv lapack-${lapack_ver} LAPACK
70
71echo "Deleting the tar file..."
72rm lapack-${lapack_ver}.tar
73
74echo " "
75echo "Done downloading the source code for LAPACK."
76echo " "
Note: See TracBrowser for help on using the repository browser.