Skip to content
Snippets Groups Projects
Commit afd9d530 authored by Timo Koch's avatar Timo Koch Committed by Ned Coltman
Browse files

Merge branch 'cleanup/installscript' into 'master'

Cleanup/installscript

Closes #848

See merge request !1965

(cherry picked from commit 7a6fd6d4)

acaf8100 [install] move and modify installscript
b0775e20 [install][handbook] Modify the description of the quick install
14914915 [install][external] Add install course and lecture as options
204468d5 [bin][install] Fix several issues with installdumux.sh script
ed7e6247 [install] add check for existing cmake.opts file
parent feb02b4d
No related branches found
No related tags found
2 merge requests!2152WIP add default fluxcache properties,!2031Merge branch 'cleanup/installscript' into 'master'
# One click install script for dumux
echo " "
echo " "
echo "*********************************************************************************************"
echo "(0/3) Checking all prerequistes. (git gcc g++ cmake pkg-config paraview)"
echo "*********************************************************************************************"
# check some prerequistes
for PRGRM in wget git gcc g++ cmake pkg-config; do
if ! [ -x "$(command -v $PRGRM)" ]; then
echo "ERROR: $PRGRM is not installed." >&2
exit 1
fi
done
if ! [ -x "$(command -v paraview)" ]; then
echo "*********************************************************************************************"
echo "WARNING: paraview seems to be missing. You may not be able to view simulation results!" >&2
echo "*********************************************************************************************"
fi
currentver="$(gcc -dumpversion)"
requiredver="7"
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" != "$requiredver" ]; then
echo "gcc greater than or equal to $requiredver is required for dumux releases >=3.2!" >&2
exit 1
fi
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "(0/3) An error occured while checking for prerequistes."
echo "*********************************************************************************************"
exit $?
else
echo "*********************************************************************************************"
echo "(1/3) All prerequistes found."
echo "*********************************************************************************************"
fi
# make a new folder containing everything
mkdir -p $(pwd)/DUMUX
cd DUMUX
echo "*********************************************************************************************"
echo "(1/3) Cloning repositories. This may take a while. Make sure to be connected to the internet."
echo "*********************************************************************************************"
DUNE_VERSION=2.7
DUMUX_VERSION=3.2
# 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."
fi
done
# dumux
if [ ! -d "dumux" ]; then
git clone -b releases/$DUMUX_VERSION https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
else
echo "Skip cloning dumux because the folder already exists."
fi
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "(1/3) Failed to clone the repositories. Look for repository specific errors."
echo "*********************************************************************************************"
exit $?
else
echo "*********************************************************************************************"
echo "(2/3) All repositories have been cloned into a containing folder."
echo "*********************************************************************************************"
fi
echo " "
echo "**************************************************************************************************"
echo "(2/3) Configure and build dune modules and dumux using dunecontrol. This may take several minutes."
echo "**************************************************************************************************"
# run dunecontrol
if [ ! -f "cmake.opts" ]; then
wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/raw/releases/3.2/cmake.opts
else
echo "A cmake.opts file already exists. The existing file will be used to configure dumux."
fi
./dune-common/bin/dunecontrol --opts=cmake.opts all
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "(2/3) Failed to build the dune libaries."
echo "*********************************************************************************************"
exit $?
else
echo "*****************************************************************************************************"
echo "(3/3) Succesfully configured and built dune and dumux."
echo "*****************************************************************************************************"
fi
...@@ -10,6 +10,8 @@ DOWNLOAD_ONLY="n" ...@@ -10,6 +10,8 @@ DOWNLOAD_ONLY="n"
TOPDIR=$(pwd) TOPDIR=$(pwd)
EXTDIR=$(pwd)/external EXTDIR=$(pwd)/external
DUMUX_VERSION=3.2
checkLocationForDuneModules() checkLocationForDuneModules()
{ {
# test for directory dune-common, dune-common-2.4 etc. # test for directory dune-common, dune-common-2.4 etc.
...@@ -53,6 +55,19 @@ installAluGrid() ...@@ -53,6 +55,19 @@ installAluGrid()
fi fi
} }
installCourse()
{
cd $TOPDIR
if [ ! -d "dumux-course" ]; then
git clone -b releases/$DUMUX_VERSION https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course.git
else
echo "Skip cloning dumux-course because the folder already exists."
cd dumux-course
git checkout releases/$DUMUX_VERSION
cd ..
fi
}
installFoamGrid() installFoamGrid()
{ {
cd $TOPDIR cd $TOPDIR
...@@ -135,6 +150,19 @@ installGStat() ...@@ -135,6 +150,19 @@ installGStat()
fi fi
} }
installLecture()
{
cd $TOPDIR
if [ ! -d "dumux-lecture" ]; then
git clone -b releases/$DUMUX_VERSION https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-lecture.git
else
echo "Skip cloning dumux-lecture because the folder already exists."
cd dumux-lecture
git checkout releases/$DUMUX_VERSION
cd ..
fi
}
installMETIS() installMETIS()
{ {
cd $EXTDIR cd $EXTDIR
...@@ -404,9 +432,11 @@ usage() ...@@ -404,9 +432,11 @@ usage()
echo "Where PACKAGES is one or more of the following" echo "Where PACKAGES is one or more of the following"
echo " all Install everything and the kitchen sink." echo " all Install everything and the kitchen sink."
echo " alugrid Download dune-alugrid." echo " alugrid Download dune-alugrid."
echo " course Download the dumux-course."
echo " foamgrid Download dune-foamgrid." echo " foamgrid Download dune-foamgrid."
echo " glpk Download and install glpk." echo " glpk Download and install glpk."
echo " gstat Download and install gstat." echo " gstat Download and install gstat."
echo " lecture Download the dumux-lecture."
echo " metis Install the METIS graph partitioner." echo " metis Install the METIS graph partitioner."
echo " multidomain Download dune-multidomain." echo " multidomain Download dune-multidomain."
echo " multidomaingrid Download and patch dune-multidomaingrid." echo " multidomaingrid Download and patch dune-multidomaingrid."
...@@ -471,9 +501,11 @@ for TMP in "$@"; do ...@@ -471,9 +501,11 @@ for TMP in "$@"; do
SOMETHING_DONE="y" SOMETHING_DONE="y"
createExternalDirectory createExternalDirectory
installAluGrid installAluGrid
installCourse
installFoamGrid installFoamGrid
installGLPK installGLPK
installGStat installGStat
installLecture
installMETIS installMETIS
installMultidomain installMultidomain
installMultidomainGrid installMultidomainGrid
...@@ -487,6 +519,10 @@ for TMP in "$@"; do ...@@ -487,6 +519,10 @@ for TMP in "$@"; do
SOMETHING_DONE="y" SOMETHING_DONE="y"
installAluGrid installAluGrid
;; ;;
course)
SOMETHING_DONE="y"
installCourse
;;
foamgrid|dune-foamgrid) foamgrid|dune-foamgrid)
SOMETHING_DONE="y" SOMETHING_DONE="y"
installFoamGrid installFoamGrid
...@@ -501,6 +537,10 @@ for TMP in "$@"; do ...@@ -501,6 +537,10 @@ for TMP in "$@"; do
createExternalDirectory createExternalDirectory
installGStat installGStat
;; ;;
lecture)
SOMETHING_DONE="y"
installLecture
;;
metis) metis)
SOMETHING_DONE="y" SOMETHING_DONE="y"
createExternalDirectory createExternalDirectory
......
# Test to see if the download and configuration worked properly
cd DUMUX/dumux/build-cmake/test/porousmediumflow/1p/implicit/isothermal
make test_1p_tpfa
./test_1p_tpfa params.input
paraview *pvd
...@@ -3,38 +3,68 @@ For this quick start guide the following software packages are required: ...@@ -3,38 +3,68 @@ For this quick start guide the following software packages are required:
\begin{itemize} \begin{itemize}
\item GitLab client \item GitLab client
\item A standard-compliant C++17 compiler supporting the C++11/C++14/C++17 features of GCC 7 \item A standard-compliant C++17 compiler supporting the C++11/C++14/C++17 features of GCC 7
(\Dumux $> 3.1$\footnote{\Dumux $\leq 3.1$ only requires the C++11/C++14 feature set of GCC 4.9, e.g. GCC 4.9 or newer and Clang 3.8 or newer}), (\Dumux $> 3.1$\footnote{\Dumux $\leq 3.1$ only requires the C++11/C++14 feature set of GCC 4.9,
e.g. GCC 7 or newer and Clang 5 or newer. e.g. GCC 4.9 or newer and Clang 3.8 or newer}), e.g. GCC 7 or newer and Clang 5 or newer.
\item CMake 2.8.12 or newer \item CMake 2.8.12 or newer
\item pkg-config \item pkg-config
\item ParaView (to visualize the results) \item ParaView (to visualize the results)
\end{itemize} \end{itemize}
\section{Obtaining code and configuring all modules with a script} \section{Obtaining code and configuring all modules with a script}
We provide you with a shell-script \texttt{installDumux.sh} that facilitates setting up a {\Dune}/{\Dumux} directory tree To easily install Dumux, we've provided a shell-script \texttt{installdumux.sh} that facilitates
and configures all modules with CMake. setting up a {\Dune}/{\Dumux} directory tree and configures all modules with CMake.
Copy the following lines into a text file named \texttt{installDumux.sh}: First, you will have to download this script. To do this, first navigate to the directory where you
\lstinputlisting[style=DumuxCode, numbersep=5pt, firstline=1, firstnumber=1]{installDumux.sh} want to install \Dumux and \Dune (a single root folder \texttt{DUMUX} will be produced, so you do
not need to provide one). Then use \texttt{wget} to download the script with the following command:
\begin{lstlisting}[style=Bash]
$ wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/raw/releases/3.2/bin/installdumux.sh
\end{lstlisting}
Place the \texttt{installDumux.sh} script in the directory where you want to install \Dumux and \Dune (a single After the download is complete, execute the script. This can be done with
root folder \texttt{DUMUX} will be produced, so you do not need to provide one). Make \texttt{installDumux.sh} executable and run the script by typing into the terminal: \texttt{./installDumux.sh} \begin{lstlisting}[style=Bash]
$ sh installdumux.sh
\end{lstlisting}
Configuring \Dune and \Dumux is done by the command-line script \texttt{dunecontrol} This script will download each of the \Dune-modules that \Dumux depends on at their 2.7 release,
using optimized configure options, see the line entitled \texttt{\# run build} in the \texttt{installDumux.sh} script. as well as \Dumux's 3.2 release. After these individual modules are downloaded, \Dune and \Dumux
are automatically configured using the command-line script \texttt{dunecontrol}, located in
\texttt{dune-common/bin/dunecontrol}, optimized using configure options defined in the \texttt{cmake.opts}
file located in \texttt{dumux/cmake.opts}. The commands beneath the \texttt{\# run dunecontrol} in
the \texttt{installdumux.sh} script execute this configuration script, so no further steps are required.
More details about the build-system can be found in section \ref{buildIt}. More details about the build-system can be found in section \ref{buildIt}.
\subsection{A first test run of \Dumux} \subsection{A first test run of \Dumux}
When the \texttt{installDumux.sh} script from the subsection above has run successfully, you can execute a second script that When the \texttt{installdumux.sh} script from the subsection above has run successfully,
will compile and run a simple one-phase ground water flow example and will visualize the result using ParaView. you run a simple test to ensure that the installation ran correctly. To do this, you can
The test script can be obtained by copying the following lines into a text file named \texttt{test\_dumux.sh} begin by compiling an example problem and running the simulation. You can then visualize
that has to be located in the same directory as the installation script. the results using ParaView. We recommend looking at a basic single phase groundwater flow problem.
\begin{lstlisting}[style=DumuxCode] \begin{enumerate}
\item Navigate to this test in the build directory using:
\begin{lstlisting}[style=Bash]
cd DUMUX/dumux/build-cmake/test/porousmediumflow/1p/implicit/isothermal cd DUMUX/dumux/build-cmake/test/porousmediumflow/1p/implicit/isothermal
make -B test_1p_tpfa \end{lstlisting}
\item Build the executable with the following command:
\begin{lstlisting}[style=Bash]
make test_1p_tpfa
\end{lstlisting}
\item Run the simulation with the parameters listed in \texttt{params.input} like this:
\begin{lstlisting}[style=Bash]
./test_1p_tpfa params.input ./test_1p_tpfa params.input
\end{lstlisting}
\item Visualize the results in paraview with:
\begin{lstlisting}[style=Bash]
paraview *pvd paraview *pvd
\end{lstlisting} \end{lstlisting}
After making \texttt{test\_dumux.sh} executable, it can be executed by typing into the terminal: \texttt{./test\_dumux.sh}. \item Advance ParaView to the next frame (green arrow button) and rescale to data range
If everything works fine, a ParaView window with the result should open automatically, showing the initial (green double arrow on top right) to admire the colorful pressure distribution.
conditions. Advance ParaView to the next frame (green arrow button) and rescale to data range (green double arrow on top right) to admire \end{enumerate}
the colorful pressure distribution.
These commands are compiled into \texttt{test\_dumux.sh}, which you can download and run
from the same directory from which you ran \texttt{installDumux.sh}.
\begin{lstlisting}[style=Bash]
$ wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/raw/releases/3.2/bin/util/test_dumux.sh
$ wget sh test_dumux.sh
\end{lstlisting}
For further information on how to get started with dumux, see Section \ref{chp:tutorial}.
...@@ -25,7 +25,8 @@ $ wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/rele ...@@ -25,7 +25,8 @@ $ wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/rele
\end{lstlisting} \end{lstlisting}
This script will install \texttt{dumux}, it's Dune dependencies, and the \texttt{dumux-course} This script will install \texttt{dumux}, it's Dune dependencies, and the \texttt{dumux-course}
repository. Within the directory \texttt{dumux-course} there are a series of exercises repository. Within the directory \texttt{dumux-course} there are a series of exercises
and slides describing the previously described examples. \par and slides describing the previously described examples. The course can also be added to your existing
dumux installation using the \texttt{installExternal.sh} script and the argument \texttt{course}.\par
% %
The \Dumux course will be updated with each \Dumux release. The \Dumux course will be updated with each \Dumux release.
The above script will download the correct version (\textbf{releases/3.2}) of both The above script will download the correct version (\textbf{releases/3.2}) of both
......
...@@ -9,10 +9,8 @@ cases can be found in the class documentation \url{http://www.dumux.org/document ...@@ -9,10 +9,8 @@ cases can be found in the class documentation \url{http://www.dumux.org/document
Another possibility to gain more experience with \Dumux is the \texttt{dumux-lecture} module Another possibility to gain more experience with \Dumux is the \texttt{dumux-lecture} module
that contains different application examples that are used in the lectures at the that contains different application examples that are used in the lectures at the
Department of Hydromechanics and Modelling of Hydrosystems in Stuttgart. Department of Hydromechanics and Modelling of Hydrosystems in Stuttgart.
The \texttt{dumux-lecture} module can be obtained as follows: The \texttt{dumux-lecture} module can be obtained with the \texttt{installExternal.sh}
\begin{lstlisting}[style=Bash] script and the argument \texttt{lecture}.
$ git clone https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-lecture.git
\end{lstlisting}
The module is structured based on the different lectures: The module is structured based on the different lectures:
\begin{itemize} \begin{itemize}
......
# One click install script for dumux
# make a new folder containing everything
mkdir $(pwd)/DUMUX
cd DUMUX
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
git clone -b releases/2.6 https://gitlab.dune-project.org/core/dune-$MOD.git
done
# dumux
git clone -b releases/3.1 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
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=dumux/cmake.opts all
#
if [ $? -ne 0 ]; then
echo "*************************************************"
echo "Failed to build the dune libaries."
echo "*************************************************"
exit $?
fi
# echo result
echo "*************************************************"
echo "Successfully configured and built dune and dumux."
echo "Please run the test_dumux.sh script to confirm everything works."
echo "*************************************************"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment