1 | #!/bin/sh |
---|
2 | |
---|
3 | # Set the following to the latest MUMPS version. |
---|
4 | # THERE MUST BE NO SPACE BEFORE AND AFTER THE EQUAL (=) OPERATOR. |
---|
5 | mumps_ver=4.10.0 |
---|
6 | |
---|
7 | set -e |
---|
8 | |
---|
9 | wgetcmd=wget |
---|
10 | wgetcount=`which wget 2>/dev/null | wc -l` |
---|
11 | if test ! $wgetcount = 1; then |
---|
12 | echo "Utility wget not found in your PATH." |
---|
13 | if test `uname` = Darwin; then |
---|
14 | wgetcmd="curl -L -O" |
---|
15 | echo "Using curl instead." |
---|
16 | elif test `uname` = FreeBSD; then |
---|
17 | wgetcmd=fetch |
---|
18 | echo "Using fetch instead." |
---|
19 | else |
---|
20 | exit -1 |
---|
21 | fi |
---|
22 | fi |
---|
23 | |
---|
24 | echo " " |
---|
25 | echo "Running script for downloading the source code for MUMPS" |
---|
26 | echo " " |
---|
27 | |
---|
28 | rm -f MUMPS*.tgz |
---|
29 | |
---|
30 | echo "Downloading the source code from coin-or-tools.github.io..." |
---|
31 | if $wgetcmd http://coin-or-tools.github.io/ThirdParty-Mumps/MUMPS_${mumps_ver}.tar.gz ; |
---|
32 | then |
---|
33 | echo "Download finished." |
---|
34 | else |
---|
35 | echo |
---|
36 | echo "Downloading from GitHub failed, trying mumps.enseeiht.fr..." |
---|
37 | if $wgetcmd http://mumps.enseeiht.fr/MUMPS_${mumps_ver}.tar.gz ; |
---|
38 | then |
---|
39 | echo "Download finished." |
---|
40 | else |
---|
41 | echo "Download failed...exiting" |
---|
42 | fi |
---|
43 | fi |
---|
44 | |
---|
45 | echo "Uncompressing the tarball..." |
---|
46 | gunzip -f MUMPS_${mumps_ver}.tar.gz |
---|
47 | |
---|
48 | echo "Unpacking the source code..." |
---|
49 | tar xf MUMPS_${mumps_ver}.tar |
---|
50 | |
---|
51 | echo "Deleting the tar file..." |
---|
52 | rm MUMPS_${mumps_ver}.tar |
---|
53 | |
---|
54 | rm -rf MUMPS |
---|
55 | mv MUMPS_${mumps_ver} MUMPS |
---|
56 | |
---|
57 | echo " " |
---|
58 | echo "Done downloading the source code for MUMPS." |
---|
59 | echo " " |
---|
60 | echo "Apply a patch to work around a bug in MUMPS." |
---|
61 | echo " " |
---|
62 | |
---|
63 | patch -p0 < mumps.patch |
---|
64 | patch -p0 < mumps_mpi.patch |
---|
65 | mv MUMPS/libseq/mpi.h MUMPS/libseq/mumps_mpi.h |
---|
66 | |
---|
67 | echo " " |
---|
68 | echo "Verify that there are no error message in the output above." |
---|