Commit dc2965fd authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

update install_all_dune_modules script

parent c46afece
#!/usr/bin/env bash
if [ $# -lt 1 ]; then
echo "usage: $0 DUNE_BASE_DIR"
USAGE_HELP="usage: $0 --prefix DUNE_BASE_DIR [--branch DUNE_BRANCH] [--misc] [--np NUM_PROCS]"
PREFIX="/opt/dune"
BRANCH="master"
NUM_PROCS=$(nproc --all)
INSTALL_MISC="0"
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
;;
-m|--misc)
INSTALL_MISC="1"
shift
;;
-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
exit 1
fi
DUNE_BASE_DIR="$1"
NUM_PROCS=$(nproc --all)
mkdir -p ${DUNE_BASE_DIR}
cd ${DUNE_BASE_DIR}
mkdir -p ${PREFIX}
cd ${PREFIX}
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")
MISC_MODULES=("dune-vtk" "dune-curvedsurfacegrid" "dune-curvedgeometry" "dune-blocked")
MISC_REPOS=("https://gitlab.mn.tu-dresden.de/spraetor/dune-vtk.git" \
"https://gitlab.mn.tu-dresden.de/iwr/dune-curvedsurfacegrid.git" \
"https://gitlab.mn.tu-dresden.de/spraetor/dune-curvedgeometry.git" \
"https://gitlab.mn.tu-dresden.de/spraetor/dune-blocked.git")
MISC_BRANCHES=("master" "master" "master" "master")
for MOD in ${CORE_MODULES[*]}; do
git clone https://gitlab.dune-project.org/core/${MOD}.git --branch releases/2.6 --single-branch
git clone https://gitlab.dune-project.org/core/${MOD}.git --branch ${BRANCH}
done
for MOD in ${STAGING_MODULES[*]}; do
git clone https://gitlab.dune-project.org/staging/${MOD}.git --branch releases/2.6 --single-branch
git clone https://gitlab.dune-project.org/staging/${MOD}.git --branch ${BRANCH}
done
for MOD in ${EXTENSIONS_MODULES[*]}; do
git clone https://gitlab.dune-project.org/extensions/${MOD}.git --branch releases/2.6 --single-branch
git clone https://gitlab.dune-project.org/extensions/${MOD}.git --branch ${BRANCH}
done
cat << EOF >> ${DUNE_BASE_DIR}/dune.opts
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-march=native\""
if [[ "$INSTALL_MISC" == "1" ]]; then
for I in ${!MISC_MODULES[*]}; do
git clone ${MISC_REPOS[$I]} --branch ${MISC_BRANCHES[$I]}
done
fi
cat << EOF >> ${PREFIX}/default.opts
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS=\"-march=native\""
MAKE_FLAGS="-j${NUM_PROCS}"
EOF
DUNE_CONTROL_PATH=${DUNE_BASE_DIR} ${DUNE_BASE_DIR}/dune-common/bin/dunecontrol --opts=${DUNE_BASE_DIR}/dune.opts all
DUNE_CONTROL_PATH=${PREFIX} ${PREFIX}/dune-common/bin/dunecontrol --opts=${PREFIX}/default.opts all
echo ""
echo "=============================================================="
echo "You should add the following lines to you .bashrc file "
echo " export DUNE_CONTROL_PATH=${DUNE_BASE_DIR} "
echo " export PATH=${DUNE_BASE_DIR}/dune-common/bin:\${PATH} "
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} "
echo " "
echo "In order to compile your module, just run "
echo " duncontrol --opts=${DUNE_BASE_DIR}/dune.opts --current all "
echo " duncontrol --opts=${PREFIX}/default.opts --current all "
echo "=============================================================="
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment