Skip to content
Snippets Groups Projects
progstartup.sh 2.19 KiB
Newer Older
#!/bin/bash
echo "zusätzlich zu OPAL liegen nützliche Dateien in https://gitlab.mn.tu-dresden.de/wwalter/PROG-material-public"
echo "gedit settings:"
gsettings set org.gnome.gedit.preferences.editor tabs-size 2
echo "tabs-size"
gsettings set org.gnome.gedit.preferences.editor insert-spaces true
echo "insert-spaces"
gsettings set org.gnome.gedit.preferences.editor display-right-margin true
echo "display margin"
gsettings set org.gnome.gedit.preferences.editor right-margin-position 70
echo "margin position"
gsettings set org.gnome.gedit.preferences.editor auto-indent true
echo "auto indent"
gsettings set org.gnome.gedit.preferences.editor display-line-numbers true
echo "display l nr"

echo "frun <Programm> <Eingabe> <noetige Module> ist ein neuer Befehl, der ein Fortran-Programm kompiliert und ausfuehrt. Es steht zur Verfügung, sobald du eine neue Shell startest, z.B. mit Ctrl+Alt+T."
Tony Zorman's avatar
Tony Zorman committed
echo 'PATH="$PATH:~/zih_home/bin"' >> ~/.bashrc
  echo "Dieses kleine Programm kompiliert ein f95-Programm (der Form <Programm> [<Eingabe>] [<Module>]) mit mehreren hilfreichen Optionen und führt es aus"
Felix Hilsky's avatar
Felix Hilsky committed

# Remove suffix.
# Also works when main program is given without the .f95 ending.
# This is done for backwards compatability reasons.
Felix Hilsky's avatar
Felix Hilsky committed
case "$1" in
Felix Hilsky's avatar
Felix Hilsky committed
         ;;
  * ) outfile="$1"
    ;;
esac

if (( $# > 1 )) && test "$2" == *f95; then
  shift
  module="$@"
  echo "genutzte Module: "$module
  echo "Fortran-Hauptprogramm: "$programm
  echo "Maschinenprogramm: "$outfile
  f95 $module "$programm" -o "$outfile" -std=f95 -Wall -fmax-errors=3 -fcheck=all && "./$outfile"
elif (( $# > 1)); then
  eingabe="$2"
  shift
  shift
  module="$@"
  echo "genutzte Module: "$module
  echo "Fortran-Hauptprogramm: "$programm
  echo "Maschinenprogramm: "$outfile
  f95 $module "$programm" -o "$outfile" -std=f95 -Wall -fmax-errors=3 -fcheck=all && echo "$eingabe" | "./$outfile"
  echo "Fortran-Hauptprogramm: "$programm
  echo "Maschinenprogramm: "$outfile
  f95 $module "$programm" -o "$outfile" -std=f95 -Wall -fmax-errors=3 -fcheck=all && "./$outfile"
fi' > ~/zih_home/bin/frun
chmod a+rwx ~/zih_home/bin/frun