Skip to content
Snippets Groups Projects
Commit 270a8911 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'cleanup/remove-install-script' into 'master'

Cleanup/remove install script

See merge request !123
parents fd352ca4 bdf403d2
No related branches found
No related tags found
1 merge request!123Cleanup/remove install script
Pipeline #16848 passed
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
The material is organized as follows The material is organized as follows
* __Exercises__: click [here](./exercises/README.md) to go to the exercise description * __Exercises__: click [here](./exercises/README.md) to go to the exercise description
* __Scripts__: click [here](./scripts/README.md) for an overview of useful scripts (e.g. install script)
* __Slides__: click [here](./slides/README.md) to download the slides * __Slides__: click [here](./slides/README.md) to download the slides
* __Links__: click [here](./links/README.md) to go to a list of useful links * __Links__: click [here](./links/README.md) to go to a list of useful links
...@@ -16,14 +15,24 @@ Depending on whether you already have DuMu<sup>x</sup> installed or not, choose ...@@ -16,14 +15,24 @@ Depending on whether you already have DuMu<sup>x</sup> installed or not, choose
### Install DuMu<sup>x</sup> together with the course ### Install DuMu<sup>x</sup> together with the course
The easiest way to install everything you need is to follow the steps in the [install script](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/-/blob/master/scripts/README.md). The easiest way to install everything you need is to use the install scripts provided in DuMu<sup>x</sup>,
This will install everything for you to get directly started. for instance, with this sequence of commands:
```bash
wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/raw/releases/3.5/bin/installdumux.py
python3 installdumux.py --dumux-version 3.5 --dune-version 2.8
python3 dumux/bin/installexternal.py course
./dune-common/bin/dunecontrol --opts=./dumux/cmake.opts all
```
If you don't have `wget` and don't want to install it, you can just manually download the
`installdumux.py` script from the git repository.
### Install the course into your existing DuMu<sup>x</sup> project ### Install the course into your existing DuMu<sup>x</sup> project
If you already have an installation of DuMu<sup>x</sup>, If you already have an installation of DuMu<sup>x</sup>,
navigate to your common DuMu<sup>x</sup> root directory `cd yourInstallationFolder/dumux` and then run the following commands: navigate to your DuMu<sup>x</sup> root directory
and then run the following commands:
```bash ```bash
python3 dumux/bin/installexternal.py course python3 dumux/bin/installexternal.py course
...@@ -33,5 +42,18 @@ python3 dumux/bin/installexternal.py course ...@@ -33,5 +42,18 @@ python3 dumux/bin/installexternal.py course
This will download and then configure the course repository using `dunecontrol`. This will download and then configure the course repository using `dunecontrol`.
After this, you can start with the [exercises](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/-/tree/master/exercises). After this, you can start with the [exercises](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/-/tree/master/exercises).
### Requirements
For a successful installation and the execution of all exercises, the following
software packages are needed:
* gcc >= 7
* cmake >= 3.13
* git
* pkg-config
* paraview (to visualize the results)
* gnuplot (to plot some curves)
* wget (to download some config files during the installation)
Last updated for: __DuMu<sup>x</sup> release 3.4 in June 2021__. Last updated for: __DuMu<sup>x</sup> release 3.5 in May 2022__.
# DuMu<sup>x</sup> course useful scripts
The install script is a shell script that will setup DuMu<sup>x</sup> on your computer
in the version that is required to complete the current course's exercises.
Installation guide dumux
-------------------------
You can set up dumux using the attached script install.sh.
You need to have the following REQUIREMENTS installed:
* gcc >= 7
* cmake >= 3.13
* git
* pkg-config
* paraview (to visualize the results)
* gnuplot (to plot some curves)
* wget (to download some config files during the installation)
On debian-based system you can use this:
```bash
apt-get install build-essential gfortran pkg-config cmake git paraview wget gnuplot libsuitesparse-dev
```
Then, you can the execute the script and it will download the dune repositories and dumux
and configure all modules with CMake
```bash
wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/-/raw/master/scripts/install.sh
chmod a+x install.sh
./install.sh
```
This will clone the necessary repositories (in a subfolder `DUMUX`) and
build all libaries.
Run the script `test_dumux.sh` in the newly created `DUMUX` folder
to test your installation of dumux.
```bash
./test_dumux.sh
```
It will compile and run a simple one-phase ground water flow example
and visualizes the result using paraview.
* you can also click [here](./install.sh) to view and download the install script
# One click install script dumux
echo " "
echo " "
echo "*********************************************************************************************"
echo "(0/4) Checking all prerequistes. (git cmake gcc g++ wget pkg-config gnuplot umfpack)"
echo "*********************************************************************************************"
# check some prerequistes
for PRGRM in git cmake gcc g++ wget paraview pkg-config gnuplot; do
if ! [ -x "$(command -v $PRGRM)" ]; then
echo "Error: $PRGRM is not installed." >&2
exit 1
fi
done
# check some library prerequistes
for LIBRARY in libumfpack; do
if ! [ "$(/sbin/ldconfig -p | grep $LIBRARY)" ]; then
echo "Error: $LIBRARY is not installed." >&2
exit 1
fi
done
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!" >&2
exit 1
fi
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "(0/4) An error occured while checking for prerequistes."
echo "*********************************************************************************************"
exit $?
else
echo "*********************************************************************************************"
echo "(1/4) All prerequistes found."
echo "*********************************************************************************************"
fi
echo " "
echo "**************************************************************************************************************"
echo "(1/4) Downloading supplementary files (test script & cmake.opts). Make sure to be connected to the internet."
echo "**************************************************************************************************************"
# make a new folder containing everything
mkdir $(pwd)/DUMUX
cd DUMUX
# download the test script and the cmake.opts
if [ ! -f "test_dumux.sh" ]; then
wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/releases/3.4/scripts/test_dumux.sh
fi
chmod +x test_dumux.sh
if [ ! -f "cmake.opts" ]; then
wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/releases/3.4/cmake.opts
fi
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "(1/4) An error occured while downloading supplementary files."
echo "*********************************************************************************************"
exit $?
else
echo "*********************************************************************************************"
echo "(2/4) All supplementary files downloaded."
echo "*********************************************************************************************"
fi
echo " "
echo "*********************************************************************************************"
echo "(2/4) Cloning repositories. This may take a while. Make sure to be connected to the internet."
echo "*********************************************************************************************"
DUNE_VERSION=2.8
# 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."
git checkout releases/$DUNE_VERSION
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."
git checkout releases/$DUNE_VERSION
fi
done
# dune-subgrid
if [ ! -d "dune-subgrid" ]; then
git clone -b releases/$DUNE_VERSION https://gitlab.dune-project.org/extensions/dune-subgrid
else
echo "Skip cloning dune-subgrid because the folder already exists."
git checkout releases/$DUNE_VERSION
fi
# dumux
if [ ! -d "dumux" ]; then
git clone -b releases/3.4 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
else
echo "Skip cloning dumux because the folder already exists."
cd dumux
git checkout releases/3.4
cd ..
fi
# dumux-course
if [ ! -d "dumux-course" ]; then
git clone -b releases/3.4 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/3.4
cd ..
fi
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "(2/4) Failed to clone the repositories. Look for repository specific errors."
echo "*********************************************************************************************"
exit $?
else
echo "*********************************************************************************************"
echo "(3/4) All repositories have been cloned into a containing folder."
echo "*********************************************************************************************"
fi
echo " "
echo "**************************************************************************************************"
echo "(3/4) Configure and build dune modules and dumux using dunecontrol. This may take several minutes."
echo "**************************************************************************************************"
# run dunecontrol
./dune-common/bin/dunecontrol --opts=cmake.opts all
if [ $? -ne 0 ]; then
echo "*********************************************************************************************"
echo "(3/4) Failed to build the dune libaries."
echo "*********************************************************************************************"
exit $?
else
echo "*****************************************************************************************************"
echo "(4/4) 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 "*****************************************************************************************************"
fi
# Compile and runs a simple
# one-phase ground water flow example
# and visualizes the result using paraview.
cd dumux/build-cmake/test/porousmediumflow/1p/incompressible
echo "Compiling a one-phase test using a cell-centered TPFA discretization (might take a while)..."
make -B test_1p_incompressible_tpfa_anadiff
echo "Running simulation..."
./test_1p_incompressible_tpfa_anadiff params.input -Grid.Cells "100 100"
paraview *pvd
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