Skip to content

Instantly share code, notes, and snippets.

@chrischoy
Last active April 4, 2017 23:10
Show Gist options
  • Save chrischoy/08c113588f2532c81ac29b8c6b195c89 to your computer and use it in GitHub Desktop.
Save chrischoy/08c113588f2532c81ac29b8c6b195c89 to your computer and use it in GitHub Desktop.
Activate
#!/bin/sh
SERVER=$1
ENVNAME=$2
ENV_ROOT="/cvgl/u/chrischoy/.pyv/${SERVER}/${ENVNAME}/bin"
# Check the number of arguments
if [ "$#" -eq 2 ] && [ -d "${ENV_ROOT}" ]; then
export OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export OLD_PATH=$PATH
export OLD_PS1="$PS1"
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export PATH=/cvgl/u/chrischoy/.pyv/${SERVER}/${ENVNAME}/bin:/usr/local/cuda/bin:$PATH
export PS1="(${SERVER}:${ENVNAME})$PS1"
else
echo "Please put the server name and environment name as arguments, you put ${1} and ${2}" >&2
fi
export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH
export PATH=$OLD_PATH
export PS1=$OLD_PS1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment