forked from W4ngatang/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash-aliases
48 lines (37 loc) · 2.04 KB
/
bash-aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# alias ag="ag -u"
# alias ag='ag -U --path-to-ignore ~/.ignore'
# added by Miniconda3 installer
export PATH="$HOME/local/miniconda3/bin:$PATH"
# ccache things
export PATH=~/ccache/lib:$PATH
export CUDA_NVCC_EXECUTABLE=~/ccache/cuda/nvcc
pt_default_flags='USE_KINETO=0 BUILD_CAFFE2=0 USE_DISTRIBUTED=0 USE_NCCL=0 BUILD_TEST=0 USE_XNNPACK=0 USE_FBGEMM=0 USE_QNNPACK=0 USE_MKLDNN=0 USE_MIOPEN=0 USE_NNPACK=0 BUILD_CAFFE2_OPS=0 USE_TENSORPIPE=0'
alias build_cpu_debug="type build_cpu_debug; $pt_default_flags USE_CUDA=0 DEBUG=1 python setup.py develop"
alias build_cuda_debug="type build_cuda_debug; $pt_default_flags DEBUG=1 python setup.py develop"
alias build_cpu="type build_cpu; $pt_default_flags USE_CUDA=0 python setup.py develop"
alias build_cuda="type build_cuda; $pt_default_flags python setup.py develop"
alias chenv="type chenv; conda activate /scratch/rzou/pt/\$1-env; export CMAKE_PREFIX_PATH=\$(dirname \$(which python))/../"
alias sa="type sa; conda activate \$PWD-env; export CMAKE_PREFIX_PATH=\$(dirname \$(which python))/../"
alias sd="type sd; conda deactivate; export CMAKE_PREFIX_PATH=''"
alias ta="tmux attach -d"
alias cr="ctags -R --exclude=third_party --exclude=torch/lib --exclude=build --exclude=caffe2"
export PATH="$HOME/local/scripts/:$PATH" # for mkenv
if [ -z "$PT_ROOT" ]; then
echo "Need to set PT_ROOT"
exit 1
fi
pt() {
source activate $PT_ROOT/$1-env
}
# safety measures
alias cp='cp --backup=numbered'
alias ln='ln --backup=numbered'
alias mv='mv -f --backup=numbered'
source ~/dotfiles/scripts/git-prompt.sh
if [ "$color_prompt" = yes ]; then
PS1='[\[\033[1;31m\]${PIPESTATUS[@]/#0/\[\033[0m\]\[\033[1;32m\]0\[\033[1;31m\]}\[\033[0m\]] ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 "(%s) ") \$ '
else
PS1='[\[\033[1;31m\]${PIPESTATUS[@]/#0/\[\033[0m\]\[\033[1;32m\]0\[\033[1;31m\]}\[\033[0m\]] ${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "(%s)") \$ '
fi
unset color_prompt force_color_prompt
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH