pylauncher.sh 464 Bytes
Newer Older
Jeremy Auguste's avatar
Jeremy Auguste committed
1 2
#! /bin/zsh

3 4
if [[ $# -lt 2 ]]; then
    echo "Usage: $0 environment_name command [arg1..argn]" >&2
Jeremy Auguste's avatar
Jeremy Auguste committed
5 6 7 8
    exit 1
fi

environment="$1"
9
shift 1
Jeremy Auguste's avatar
Jeremy Auguste committed
10 11 12

source activate $environment

13
if [[ $environment =~ ^keras.* || $environment =~ ^pytorch.* ]]; then
14 15 16 17 18 19 20
    export CUDA_HOME=/usr/local/cuda-8.0
    export CUDA_ROOT=$CUDA_HOME
	export PATH=$CUDA_HOME/bin:$PATH
	export MANPATH=$CUDA_HOME/doc/man:$MANPATH
	export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
fi

21
eval "$@"