From 8600f808bbeec45b1ca7e00d274b8dd6e4bfb172 Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Mon, 8 Jul 2019 16:47:40 -0500 Subject: [PATCH] Moved host determination and path defs to zshenv file. --- zsh/zshenv | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++ zsh/zshrc | 106 +--------------------------------------------- 2 files changed, 122 insertions(+), 105 deletions(-) diff --git a/zsh/zshenv b/zsh/zshenv index e69de29..d3b691f 100644 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -0,0 +1,121 @@ +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# .zshenv +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# User-specific ~/.zshenv, generalized for GNU/Linux and Apple OS X +# Excecuted by zsh for all ((non-)interactive) shells +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Determine local environment +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +case $( uname ) in + ( *[Ll]inux* ) + case "$HOSTNAME" in + ( vmp* ) hostenv='cluster';; # Auto-detect whether we're running on the + ( vpac* ) hostenv='astro';; # ACCRE cluster or the VPAC network at + ( * ) hostenv='linux';; # Vanderbilt, and set options appropriately + esac;; + ( *[Dd]arwin* ) hostenv='osx';; + ( * ) echo 'running on unknown host' && return;; +esac + +export hostenv + + + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Path definitions +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +typeset -U path + +case "$hostenv" in + ( cluster ) + path=(/usr/local/supermongo/bin # Supermongo path + /usr/local/cuda/bin # Nvidia CUDA path + /usr/lpp/mmfs/bin # GPFS utilities path + ~/local/bin # User-specific path + $path) + export -UT LD_LIBRARY_PATH=/usr/scheduler/torque/lib:$LD_LIBRARY_PATH ld_library_path + export -UT LD_LIBRARY_PATH=/usr/local/supermongo/lib:$LD_LIBRARY_PATH ld_library_path + export -UT LD_LIBRARY_PATH=/usr/local/python/lib:$LD_LIBRARY_PATH ld_library_path + export -UT LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH ld_library_path + export -UT PYTHONPATH=~/local/lib/python/site-packages:$PYTHONPATH pythonpath + export -UT IDL_STARTUP=~/.idl/idl_startup.pro idl_starup + export -UT IDL_PATH=+/home/sinham/utils/idl:$IDL_PATH idl_path + export -UT IDL_PATH=.:+/usr/local/idl/idl/lib:+/usr/local/idl/idl/:$IDL_PATH idl_path + ;; + ( astro ) + path=(/usr/local/python64/bin # Python path (64 bit) + ~/local/bin # User specific path + $path) + export -UT LD_LIBRARY_PATH=/usr/local/python64/lib:$LD_LIBRARY_PATH ld_library_path + export -UT PYTHONPATH=~/local/lib/python/latest/site-packages:$PYTHONPATH pythonpath + export -UT PYTHONPATH=/usr/local/python64/lib/python*/site-packages:$PYTHONPATH pythonpath + source /usr/local/itt/idl80/idl/bin/idl_setup.bash + export IDL_PATH=.:/home/sinham/psu/utils/idl/:+$IDL_DIR + export IDL_STARTUP=~/.idl/idl_startup.pro + ;; + ( linux ) + path=(~/Local/bin $path) # User specific path + export -UT PYTHONPATH=~/Local/lib/python/python-2.7/site-packages:$PYTHONPATH pythonpath + export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath + export -UT PYTHONPATH=~/Local/lib/python3/site-packages:$PYTHONPATH pythonpath + export -UT TEXINPUTS=.:./style:$TEXINPUTS texinputs + export -UT BSTINPUTS=.:./style:$BSTINPUTS bstinputs + export -UT BIBINPUTS=.:./style:$BIBINPUTS bibinputs + ;; + ( osx ) + path=(~/Local/bin # User specific path + /usr/local/opt/coreutils/libexec/gnubin # Gnu coreutils from Homebrew + /usr/local/opt/findutils/libexec/gnubin # Gnu find from Homebrew + /usr/local/opt/grep/libexec/gnubin # Gnu grep from Homebrew + /usr/local/opt/gnu-sed/libexec/gnubin # Gnu sed from Homebrew + /usr/local/opt/gnu-indent/libexec/gnubin # Gnu indent from Homebrew + /usr/local/opt/gnu-tar/libexec/gnubin # Gnu tar from Homebrew + /usr/local/opt/python/libexec/bin # Unversioned python3 + $path) + export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath + ;; +esac + +export path + + + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Import packages +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +if [[ $hostenv == cluster ]]; then + setpkgs -a gcc_compiler + setpkgs -a intel_compiler + setpkgs -a fftw2-mpich2_gcc_ether + setpkgs -a mpich2_gcc_ether + setpkgs -a gsl_gcc + setpkgs -a gsl_intel + setpkgs -a hdf5 + setpkgs -a valgrind + setpkgs -a python + setpkgs -a scipy + setpkgs -a perl + setpkgs -a idl-8.0 + setpkgs -a matlab + setpkgs -a octave + setpkgs -a R + setpkgs -a ImageMagick +fi + + + + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# End +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/zsh/zshrc b/zsh/zshrc index 2429bc3..96dd55c 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -115,111 +115,6 @@ autoload -U colors && colors -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Determine local environment -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -case $( uname ) in - ( *[Ll]inux* ) - case "$HOSTNAME" in - ( vmp* ) hostenv='cluster';; # Auto-detect whether we're running on the - ( vpac* ) hostenv='astro';; # ACCRE cluster or the VPAC network at - ( * ) hostenv='linux';; # Vanderbilt, and set options appropriately - esac;; - ( *[Dd]arwin* ) hostenv='osx';; - ( * ) echo 'running on unknown host' && return;; -esac - - - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Import packages -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -if [[ $hostenv == cluster ]]; then - setpkgs -a gcc_compiler - setpkgs -a intel_compiler - setpkgs -a fftw2-mpich2_gcc_ether - setpkgs -a mpich2_gcc_ether - setpkgs -a gsl_gcc - setpkgs -a gsl_intel - setpkgs -a hdf5 - setpkgs -a valgrind - setpkgs -a python - setpkgs -a scipy - setpkgs -a perl - setpkgs -a idl-8.0 - setpkgs -a matlab - setpkgs -a octave - setpkgs -a R - setpkgs -a ImageMagick -fi - - - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Path definitions -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -typeset -U path - -case "$hostenv" in - ( cluster ) - path=(/usr/local/supermongo/bin # Supermongo path - /usr/local/cuda/bin # Nvidia CUDA path - /usr/lpp/mmfs/bin # GPFS utilities path - ~/local/bin # User-specific path - $path) - export -UT LD_LIBRARY_PATH=/usr/scheduler/torque/lib:$LD_LIBRARY_PATH ld_library_path - export -UT LD_LIBRARY_PATH=/usr/local/supermongo/lib:$LD_LIBRARY_PATH ld_library_path - export -UT LD_LIBRARY_PATH=/usr/local/python/lib:$LD_LIBRARY_PATH ld_library_path - export -UT LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH ld_library_path - export -UT PYTHONPATH=~/local/lib/python/site-packages:$PYTHONPATH pythonpath - export -UT IDL_STARTUP=~/.idl/idl_startup.pro idl_starup - export -UT IDL_PATH=+/home/sinham/utils/idl:$IDL_PATH idl_path - export -UT IDL_PATH=.:+/usr/local/idl/idl/lib:+/usr/local/idl/idl/:$IDL_PATH idl_path - ;; - ( astro ) - path=(/usr/local/python64/bin # Python path (64 bit) - ~/local/bin # User specific path - $path) - export -UT LD_LIBRARY_PATH=/usr/local/python64/lib:$LD_LIBRARY_PATH ld_library_path - export -UT PYTHONPATH=~/local/lib/python/latest/site-packages:$PYTHONPATH pythonpath - export -UT PYTHONPATH=/usr/local/python64/lib/python*/site-packages:$PYTHONPATH pythonpath - source /usr/local/itt/idl80/idl/bin/idl_setup.bash - export IDL_PATH=.:/home/sinham/psu/utils/idl/:+$IDL_DIR - export IDL_STARTUP=~/.idl/idl_startup.pro - ;; - ( linux ) - path=(~/Local/bin $path) # User specific path - export -UT PYTHONPATH=~/Local/lib/python/python-2.7/site-packages:$PYTHONPATH pythonpath - export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath - export -UT PYTHONPATH=~/Local/lib/python3/site-packages:$PYTHONPATH pythonpath - export -UT TEXINPUTS=.:./style:$TEXINPUTS texinputs - export -UT BSTINPUTS=.:./style:$BSTINPUTS bstinputs - export -UT BIBINPUTS=.:./style:$BIBINPUTS bibinputs - ;; - ( osx ) - path=(~/Local/bin # User specific path - /usr/local/opt/coreutils/libexec/gnubin # Gnu coreutils from Homebrew - /usr/local/opt/findutils/libexec/gnubin # Gnu find from Homebrew - /usr/local/opt/grep/libexec/gnubin # Gnu grep from Homebrew - /usr/local/opt/gnu-sed/libexec/gnubin # Gnu sed from Homebrew - /usr/local/opt/gnu-indent/libexec/gnubin # Gnu indent from Homebrew - /usr/local/opt/gnu-tar/libexec/gnubin # Gnu tar from Homebrew - /usr/local/opt/python/libexec/bin # Unversioned python3 - $path) - export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath - ;; -esac - -export path - - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Shell behavior #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -293,6 +188,7 @@ prompt pure + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # End #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~