<file_sep># The following lines were added by compinstall

zstyle ':completion:*' completer _complete _ignored _correct _approximate
zstyle ':completion:*' max-errors 2
zstyle :compinstall filename '/home/mmcfadden/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=100000
setopt appendhistory autocd extendedglob notify
unsetopt beep
bindkey -v
# End of lines configured by zsh-newuser-install
#
# User specific aliases and functions
alias d='ls -sF'
alias la='ls -al'
alias lt='ls -lt'
alias C=clear
alias f=pushd
alias b=popd
alias h='history 1 -1'
alias j='jobs -l'
alias a='alias'
export PROMPT=$'%U%B%F{blue}[%n@%m: %~]%u\n%# %b%f'
<file_sep># Source global definitions
alias d="ls -sF"
alias la="ls -al"
alias lt="ls -lt"
alias C=clear
alias f=pushd
alias b=popd
alias h=history
alias j="jobs -l"
alias a=alias
alias vi=vim
alias dbgon="export DYNINST_DEBUG_PROCCONTROL=1"
alias dbgoff="export DYNINST_DEBUG_PROCCONTROL="

# Set DISPLAY so X forwarding works through mrsh from desktop
if [ -n $DISPLAY ] && [ -z $(echo $DISPLAY | cut -d: -f1) ]; then
    export DISPLAY=$(hostname -s)${DISPLAY}
fi

if [ -f $HOME/.Xdefaults ]; then
    xrdb $HOME/.Xdefaults
fi

export PS1='\[$(tput bold)$(tput smul)\]\u@\H:\W\[$(tput rmul)\] ($SESSION)\n$ '
export HISTCONTROL=ignoreboth:erasedups   # no duplicate entries
shopt -s histappend                       # append history file
export PROMPT_COMMAND="history -a"        # update histfile after every command
<file_sep>stty erase 
H=`uname -m`
HOST=`hostname`

if [[ $HOST == "rz"* ]]; then
    export WS=/usr/workspace/wsrzd/martymcf
else
    export WS=/usr/workspace/wsb/martymcf
fi

export TMPDIR=$WS/tmp
export SSH_ASKPASS=""

if [ -e $HOME/.bashrc ]; then
	. $HOME/.bashrc
fi

if [ -f /etc/toss-release ]; then
    tossversion=`cat /etc/toss-release`
    tossversion=${tossversion#*-}
    tossversion=${tossversion#*-}
    tossversion=${tossversion%%.*}
else
    tossversion=0
fi

if [ "$tossversion" = "2" ]; then
    echo "Welcome to TOSS version $tossversion"
    . /usr/local/tools/dotkit/init.sh
    # use -q cmake git vimvi boost
    use -q git vimvi boost
    use
    module load cudatoolkit/7.5 gnu/4.9.2
    module list
elif [ "$tossversion" = "3" ]; then
    echo "Welcome to TOSS version $tossversion"
    # module purge
    # module use /opt/modules/modulefiles
    # module load git gcc cmake cudatoolkit/7.5
    # module load fftw
    # module load dyninst/9.1.0
    # module load totalview
    # module load stat
    # module load launchmon/1.0.2
    # module load opt
    # module list
else
    echo "Welcome to the jungle..."
fi

echo "Which environment to you wish to start?"
select sess in "archer" "coral" "cuda" "di-mmap" "dyninst"; do
    case $sess in
        archer ) export SESSION="archer"; break;;
        coral ) export SESSION="coral"; break;;
        cuda ) export SESSION="cuda"; break;;
        di-mmap ) export SESSION="di-mmap"; break;;
        dyninst ) export SESSION="dyninst"; break;;
    esac
done

echo "$SESSION environment established"

if [ -e /g/g0/martymcf/archer/src/spack ]; then
    export SPACK_ROOT=/g/g0/martymcf/archer/src/spack
    . $SPACK_ROOT/share/spack/setup-env.sh
fi

export EDITOR=/usr/bin/vim
export INSTALLDIR=$HOME/$SESSION/install/$H
export BUILDDIR=$HOME/$SESSION/build/$H
export SRCDIR=$HOME/$SESSION/src

export DYNINSTHDR=$INSTALLDIR/include
export DYNINSTLIB=$INSTALLDIR/lib
export DYNINSTAPI_RT_LIB=$INSTALLDIR/lib/libdyninstAPI_RT.so

export LD_LIBRARY_PATH=.:$DYNINSTLIB:$LD_LIBRARY_PATH
export PATH=$INSTALLDIR/bin:$PATH
export vipath=.,$SRCDIR/dyninst,$SRCDIR/dyninst/common/h,$SRCDIR/dyninst/common/src,$SRCDIR/dyninst/dwarf/h,$SRCDIR/dyninst/dwarf/src,$SRCDIR/dyninst/elf/h,$SRCDIR/dyninst/elf/src,$SRCDIR/dyninst/proccontrol/h,$SRCDIR/dyninst/proccontrol/src,$SRCDIR/dyninst/proccontrol/src/loadLibrary,$SRCDIR/dyninst/symlite/h,$SRCDIR/dyninst/symlite/src,$SRCDIR/dyninst/symtabAPI/h,$SRCDIR/dyninst/symtabAPI/src,/usr/include,$SRCDIR/build/dyninst/common/h,$CUDA_INSTALL_PATH/extras/Debugger/include/,,
