Newer
Older
# One click install script dumux
DUNE_VERSION=2.6
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
# check some prerequistes
for PRGRM in git cmake gcc g++ wget paraview pkg-config; do
if ! [ -x "$(command -v $PRGRM)" ]; then
echo "Error: $PRGRM is not installed." >&2
exit 1
fi
done
currentver="$(gcc -dumpversion)"
requiredver="4.9.0"
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" != "$requiredver" ]; then
echo "gcc greater than or equal to $requiredver is required!" >&2
exit 1
fi
# make a new folder containing everything
mkdir $(pwd)/dumux
cd dumux
echo "*********************************************************************************************"
echo "Sucessfully created a folder dumux."
echo "*********************************************************************************************"
echo "*********************************************************************************************"
echo "(0/2) Downloading supplementary files. Make sure to be connected to the internet."
echo "*********************************************************************************************"
# download the install.opts and the test script
wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/master/scripts/test_dumux.sh
chmod +x test_dumux.sh
wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/master/cmake.opts
# get the testing script
echo "*********************************************************************************************"
echo "(1/2) Cloning repositories. This may take a while. Make sure to be connected to the internet."
echo "*********************************************************************************************"
# the core modules
for MOD in common geometry grid localfunctions istl; do
if [ ! -d "dune-$MOD" ]; then
git clone -b releases/$DUNE_VERSION https://gitlab.dune-project.org/core/dune-$MOD.git
else
echo "Skip cloning dune-$MOD because the folder already exists."
cd dune-$MOD
git checkout releases/$DUNE_VERSION
cd ..
fi
done
# extension modules
for MOD in dune-foamgrid dune-alugrid; do
if [ ! -d "$MOD" ]; then
git clone -b releases/$DUNE_VERSION https://gitlab.dune-project.org/extensions/$MOD.git
else
echo "Skip cloning $MOD because the folder already exists."
cd $MOD
git checkout releases/$DUNE_VERSION
cd ..
fi
done
# dune-subgrid
if [ ! -d "dune-subgrid" ]; then
git clone -b releases/$DUNE_VERSION https://git.imp.fu-berlin.de/agnumpde/dune-subgrid.git
else
echo "Skip cloning dune-subgrid because the folder already exists."
cd dune-subgrid
git checkout releases/$DUNE_VERSION
cd ..
fi
# dumux
if [ ! -d "dumux" ]; then
git clone -b master https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
else
echo "Skip cloning dumux because the folder already exists."
cd dumux
git checkout master
git reset --hard origin/master
cd ..
fi
# dumux-course
if [ ! -d "dumux-course" ]; then
git clone https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course.git
else
echo "Skip cloning dumux-course because the folder already exists."
fi
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "Failed to clone the repositories."
echo "*********************************************************************************************"
exit $?
fi
echo "*********************************************************************************************"
echo "(2/2) Configure dune modules and dumux. Build the dune libaries. This may take several minutes."
echo "*********************************************************************************************"
# run build
./dune-common/bin/dunecontrol --opts=cmake.opts all
#
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "Failed to build the dune libaries."
echo "*********************************************************************************************"
exit $?
fi
# echo result
echo "*********************************************************************************************"
echo "Succesfully configured and built dune and dumux."
echo "Please change to the dumux folder and run the test_dumux.sh script to confirm everything works."
echo "*********************************************************************************************"