diff --git a/bin/installdumux.sh b/bin/installdumux.sh new file mode 100755 index 0000000000000000000000000000000000000000..f6b368ba5f6ce4cd4d302cef433efa15c7bf66ea --- /dev/null +++ b/bin/installdumux.sh @@ -0,0 +1,81 @@ +# 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 git gcc g++ cmake pkg-config paraview; do + if ! [ -x "$(command -v $PRGRM)" ]; then + echo "Error: $PRGRM 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 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 $(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 + git clone -b releases/$DUNE_VERSION https://gitlab.dune-project.org/core/dune-$MOD.git +done + +# dumux +git clone -b releases/$DUMUX_VERSION https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git + +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 +./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 diff --git a/doc/handbook/installDumux.sh b/doc/handbook/installDumux.sh deleted file mode 100644 index fe06600aa2eb76805ee94991995be912093c5f90..0000000000000000000000000000000000000000 --- a/doc/handbook/installDumux.sh +++ /dev/null @@ -1,44 +0,0 @@ -# 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 "*************************************************"