diff --git a/DAMASK_env.sh b/DAMASK_env.sh index ddecdfd34..87b68a020 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -1,19 +1,16 @@ # sets up an environment for DAMASK on bash # usage: source DAMASK_env.sh -if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ] - then DAMASK_ROOT=$(readlink -f "`dirname $BASH_SOURCE`") +if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then + DAMASK_ROOT=$(readlink -f "`dirname $BASH_SOURCE`") else STAT=$(stat "`dirname $BASH_SOURCE`") DAMASK_ROOT=${STAT##* } unset STAT fi -if [ -f $HOME/.damask/damask.conf ]; then - source $HOME/.damask/damask.conf -else - source /etc/damask.conf -fi +[[ -f $HOME/.damask/damask.conf ]] && source $HOME/.damask/damask.conf || source /etc/damask.conf + # disable output in case of scp if [ ! -z "$PS1" ]; then @@ -23,27 +20,26 @@ if [ ! -z "$PS1" ]; then echo http://damask.mpie.de echo echo Using environment with ... - echo "DAMASK installation in $DAMASK_ROOT" - echo "DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" - echo "Compiler: F90=$F90" - if [ "x$LAPACK_ROOT" != "x" ]; then - echo "LAPACK libaries located in $LAPACK_ROOT" - fi - if [ "x$ACML_ROOT" != "x" ]; then - echo "ACML libaries located in $ACML_ROOT" - fi - if [ "x$IMKL_ROOT" != "x" ]; then - echo "IMKL libaries located in $IMKL_ROOT" - fi - echo "MSC.Marc/Mentat root $MSC_ROOT" - echo "FFTW libaries located in $FFTW_ROOT" - echo "HDF5 libaries located in $HDF5_ROOT (future use)" + echo "DAMASK $DAMASK_ROOT" + echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" + echo "Compiler F90=$F90" + ([[ "x$IMKL_ROOT" != "x" ]] && echo "IMKL $IMKL_ROOT") || \ + ([[ "x$ACML_ROOT" != "x" ]] && echo "ACML $ACML_ROOT") || \ + ([[ "x$LAPACK_ROOT" != "x" ]] && echo "LAPACK $LAPACK_ROOT") + echo "MSC.Marc/Mentat $MSC_ROOT" + echo "FFTW $FFTW_ROOT" + echo "HDF5 $HDF5_ROOT (for future use)" + echo fi -ulimit -s unlimited -ulimit -c 0 -ulimit -v unlimited -ulimit -m unlimited + +ulimit -s unlimited 2>/dev/null +ulimit -c 0 2>/dev/null +ulimit -v unlimited 2>/dev/null +ulimit -m unlimited 2>/dev/null + export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH -unset DAMASK_ROOT LAPACK_ROOT ACML_ROOT IMKL_ROOT MARC_ROOT FFTW_ROOT HDF5_ROOT +for var in DAMASK IMKL ACML LAPACK MSC FFTW HDF5; do + unset "${var}_ROOT" +done