diff --git a/README.md b/README.md index 474e29f3d24fad56f0b9a245055d226cf3ebba9e..e64204d08de8090d20f1085cc6bdb543b67e5c55 100644 --- a/README.md +++ b/README.md @@ -17,20 +17,22 @@ If you plan to use Ubuntu on Windows via WSL, we have a brief [installation docu ### Install DuMu<sup>x</sup> together with the course -The easiest way to install everything you need is to use the install scripts provided in DuMu<sup>x</sup>, -for instance, with this sequence of commands (you need `wget` and `python3` (>= 3.5 and <= 3.10) installed): +The easiest way to install everything you need is to use the install script `installcourse.sh`. +The script will install all needed ubuntu-packages, clone the required git repositories and build the dumux-course. + +It is also recommended to have a look inside the script, for further understanding. + +Open a terminal (inside Ubuntu) and use the following commands: ```bash -wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/raw/master/bin/installdumux.py -python3 installdumux.py --dumux-version 3.8 --dune-version 2.9 -cd dumux -python3 dumux/bin/installexternal.py dumux-course --dumux-branch releases/3.8 --dune-branch releases/2.9 -./dune-common/bin/dunecontrol bexec rm -r CMakeFiles CMakeCache.txt -./dune-common/bin/dunecontrol --opts=./dumux/cmake.opts all +wget https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/-/raw/master/installcourse.sh +bash installcourse.sh ``` 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. +`installcourse.sh` script from the git repository. + +In case you encounter an error, have a look at the Troubleshooting section. ### Install the course into your existing DuMu<sup>x</sup> project @@ -71,7 +73,7 @@ For instance on Ubuntu use `apt-get install libsuitesparse-dev`. ## Troubleshooting -If `installdumux.py` script fails, the terminal output can be found in `installdumux.log`. +If the `installcourse.sh` script fails, the terminal output can be found in `installcourse.log`. On a recent mac with silicon chip you may get an error similar to `clang: error: the clang compiler does not support '-march=native'`. In this case copy configure options file cmake.opts by running @@ -88,9 +90,7 @@ In `mycmake.opts` delete the line containing `-march=native \`. Rerun `dunecontr ./dune-common/bin/dunecontrol --opts=mycmake.opts configure ./dune-common/bin/dunecontrol --opts=mycmake.opts make -j ``` - -Continue with the command mentioned above (from `installexternal.py`) but -always use `--opts=mycmake.opts` for `dunecontrol`. +If you cannot resolve installation-problems, write an email with the attached `installcourse.log` file to the dumux mailing list (dumux@listserv.uni-stuttgart.de). ## When was this course last updated? diff --git a/installcourse.sh b/installcourse.sh new file mode 100644 index 0000000000000000000000000000000000000000..e4d9e35f3ba3333e2d66557203056c5a1f97869f --- /dev/null +++ b/installcourse.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -eu +# Redirect all output and errors to log.txt +exec &> >(tee "installcourse.log") +exec 2>&1 + +echo "Installing necessary ubuntu-packages." +# Update package list +sudo apt update -y + +# Upgrade installed packages (optional) +sudo apt upgrade -y + +# Add the multiverse repository +sudo add-apt-repository multiverse -y + +# Install the required packages +sudo apt install -y git wget vim build-essential cmake pkg-config libopenmpi-dev openmpi-bin gfortran g++ gcc python3-dev python3-venv libsuitesparse-dev + +echo "All necessary ubuntu-packages have been installed successfully." + +mkdir -p dumux_course + +cd dumux_course + +echo "Cloning dumux:" +git clone --branch releases/3.8 --depth=1 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git + +echo "Cloning dumux-course:" +git clone --branch master https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course.git + +for module in common geometry grid localfunctions istl; do + echo "Cloning dune-$module:" + git clone --branch releases/2.9 --depth=1 https://gitlab.dune-project.org/core/dune-$module.git +done + +for module in alugrid subgrid foamgrid; do + echo "Cloning dune-$module:" + git clone --branch releases/2.9 --depth=1 https://gitlab.dune-project.org/extensions/dune-$module.git +done + +echo "Finished cloning, building everything" + +./dune-common/bin/dunecontrol --opts=./dumux/cmake.opts all