install_all_dune_modules.sh 2.49 KB
Newer Older
1
2
#!/usr/bin/env bash

3
USAGE_HELP="usage: $0 --prefix DUNE_BASE_DIR [--branch DUNE_BRANCH]"
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

PREFIX="/opt/dune"
BRANCH="master"
NUM_PROCS=$(nproc --all)

while [[ $# -gt 0 ]]
do
key="$1"

case $key in
    --prefix)
    PREFIX="$2"
    shift # past argument
    shift # past value
    ;;
    -b|--branch)
    BRANCH="$2"
    shift # past argument
    shift # past value
    ;;
    -n|--np)
    NUM_PROCS="$2"
    shift # past argument
    shift # past value
    ;;
    *)    # unknown option
    echo $USAGE_HELP
    exit 1
    shift # past argument
    ;;
esac
done

if [[ "$PREFIX" == "" ]]; then
  echo $USAGE_HELP
39
40
41
42
  exit 1
fi


43
44
mkdir -p ${PREFIX}
cd ${PREFIX}
45
46
47
48
49

CORE_MODULES=("dune-common" "dune-geometry" "dune-grid" "dune-istl" "dune-localfunctions")
STAGING_MODULES=("dune-functions" "dune-typetree" "dune-uggrid")
EXTENSIONS_MODULES=("dune-alugrid" "dune-spgrid" "dune-foamgrid")

50
MISC_MODULES=("dune-vtk" "dune-gmsh4" "dune-curvedgrid" "dune-curvedgeometry")
51
52
53
54
MISC_REPOS=("https://gitlab.mn.tu-dresden.de/iwr/dune-vtk.git" \
            "https://gitlab.mn.tu-dresden.de/iwr/dune-gmsh4.git" \
            "https://gitlab.mn.tu-dresden.de/iwr/dune-curvedgrid.git" \
            "https://gitlab.mn.tu-dresden.de/iwr/dune-curvedgeometry.git")
55
56
MISC_BRANCHES=("master" "master" "master" "master")

57
# download all modules by git
58
for MOD in ${CORE_MODULES[*]}; do
59
  git clone https://gitlab.dune-project.org/core/${MOD}.git --branch ${BRANCH}
60
61
62
done

for MOD in ${STAGING_MODULES[*]}; do
63
  git clone https://gitlab.dune-project.org/staging/${MOD}.git --branch ${BRANCH}
64
65
66
done

for MOD in ${EXTENSIONS_MODULES[*]}; do
67
  git clone https://gitlab.dune-project.org/extensions/${MOD}.git --branch ${BRANCH}
68
69
done

70
71
72
for I in ${!MISC_MODULES[*]}; do
  git clone ${MISC_REPOS[$I]} --branch ${MISC_BRANCHES[$I]}
done
73

74
75
# create an options file
cat << EOF >> ${PREFIX}/config.opts
76
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS=\"-march=native\""
77
78
79
MAKE_FLAGS="-j${NUM_PROCS}"
EOF

80
81
echo ""
echo "=============================================================="
82
83
84
echo "You can add the following lines to you .bashrc file           "
echo "  export DUNE_CONTROL_PATH=${PREFIX}                          "
echo "  export PATH=${PREFIX}/dune-common/bin:\${PATH}              "
85
echo "                                                              "
86
87
echo "In order to build all modules, run inside the ${PREFIX} dir   "
echo "  duncontrol --opts=${PREFIX}/config.opts all                 "
88
echo "=============================================================="