-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·150 lines (122 loc) · 3.83 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/bash
set -e # exit on any failure
set -u # exit if using an undefined variable
export MAKEFLAGS=-j$(nproc)
export HYPRE_VERSION=2.11.2
export METIS_VERSION=4.0.3
export MFEM_VERSION=3.4
# export GLVIS_VERSION=3.4
success_log="packages/success.log"
force=false
#
# command-line parsing
#
while [ $# -gt 0 ]; do
case $1 in
-h|--help)
echo "
Usage:
$0 [-h|--help]
$0 [-f|--force]
Description:
Performs setup of the dependent packages used in the FLiT
tutorial examples. It will download and configure MFEM and
LULESH with their respective dependencies.
This script does not download or install FLiT. That can be done
simply with
$ git clone https://github.com/PRUNERS/FLiT.git
$ make --directory FLiT
The installation documentation can be found in
FLiT/documentation/installation.md
Options:
-h, --help Print this help documentation and exit
-f, --force Force setup script to run even if it was previously successful
"
exit 0
;;
-f|--force)
force=true
echo "Forcing setup"
echo
rm -rf ${success_log}
;;
*)
echo "Unrecognized argument: $1" >&2
echo "Call $0 --help for more information" >&2
exit 1
;;
esac
shift # next argument
done
# end of command-line parsing
if [ "$force" != "true" ] && [ -f "${success_log}" ]; then
echo "Setup has already been performed - nothing to do"
exit 0
fi
#
# Begin setup
#
mkdir -p packages
pushd packages
# clone and build hypre
rm -rf v${HYPRE_VERSION}.tar.gz hypre-${HYPRE_VERSION} hypre-2.10.0b hypre
wget https://github.com/hypre-space/hypre/archive/v${HYPRE_VERSION}.tar.gz
tar -xzf v${HYPRE_VERSION}.tar.gz
rm v${HYPRE_VERSION}.tar.gz
ln -s hypre-${HYPRE_VERSION} hypre
ln -s hypre-${HYPRE_VERSION} hypre-2.10.0b
pushd hypre/src
./configure --disable-fortran
make
popd
# clone and build metis
rm -rf metis-${METIS_VERSION}.tar.gz metis-${METIS_VERSION} metis-4.0 metis
wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD/metis-${METIS_VERSION}.tar.gz
tar -xzf metis-${METIS_VERSION}.tar.gz
make --directory metis-${METIS_VERSION}
ln -s metis-${METIS_VERSION} metis
ln -s metis-${METIS_VERSION} metis-4.0
rm metis-${METIS_VERSION}.tar.gz
## # clone and build metis using someone's clone
## # this alternative can be used when glaros.dtc.umn.edu is down
## rm -rf metis-${METIS_VERSION} metis-4.0 metis
## git clone https://github.com/CIBC-Internal/metis-${METIS_VERSION}.git
## cd metis-${METIS_VERSION}
## cmake .
## make
## cd ..
## ln -s metis-${METIS_VERSION} metis
## ln -s metis-${METIS_VERSION} metis-4.0
# clone and build mfem
rm -rf v${MFEM_VERSION}.tar.gz mfem-${MFEM_VERSION} mfem
wget https://github.com/mfem/mfem/archive/v${MFEM_VERSION}.tar.gz
tar -xzf v${MFEM_VERSION}.tar.gz
rm v${MFEM_VERSION}.tar.gz
ln -s mfem-${MFEM_VERSION} mfem
make config MFEM_USE_MPI=YES --directory mfem-${MFEM_VERSION}
make --directory mfem-${MFEM_VERSION}
# symbolically link mfem data directory
rm -rf ../exercise-1/data ../exercise-2/data
ln -s ../packages/mfem/data ../exercise-1/data
ln -s ../packages/mfem/data ../exercise-2/data
# glvis is not necessary for the tutorial, but if desired, the user can
# uncomment this section as well as the GLVIS_VERSION variable at the top.
#
## # clone and build glvis
## rm -rf glvis-${GLVIS_VERSION}.tgz glvis-${GLVIS_VERSION} glvis
## wget http://glvis.github.io/releases/glvis-${GLVIS_VERSION}.tgz
## tar -xzf glvis-${GLVIS_VERSION}.tgz
## rm glvis-${GLVIS_VERSION}.tgz
## ln -s glvis-${GLVIS_VERSION} glvis
## make clean --directory glvis-${GLVIS_VERSION}
## make MFEM_DIR=../mfem-${MFEM_VERSION} --directory glvis-${GLVIS_VERSION}
# clone LULESH
rm -rf LULESH
git clone https://github.com/LLNL/LULESH.git
# out of packages
popd
# indicate that setup finished successfully
echo
echo "flit tutorial examples setup successfully on $(date)" | \
tee -a ${success_log}
echo