-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile_2
More file actions
105 lines (95 loc) · 3.98 KB
/
profile_2
File metadata and controls
105 lines (95 loc) · 3.98 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
if [ -z "$TMUX" ]; then
# set LOCALE
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
###
SHARE_REPOSITORY="/home/share"
# set PATH&LD_LIBRARY_PATH so they include CUDA
# priority: system > shared > local
if [ ! -x "$(command -v nvcc 2>/dev/null)" ]; then
# CUDA not found at the moment and try to find CUDA of specific version
# in the shared repository and user's home directory
CUDA_VERSION=9.0
test -d "$SHARE_REPOSITORY/cuda/cuda-$CUDA_VERSION" && PATH="$SHARE_REPOSITORY/cuda/cuda-$CUDA_VERSION/bin:$PATH" && LD_LIBRARY_PATH="$SHARE_REPOSITORY/cuda/cuda-$CUDA_VERSION/lib64:$LD_LIBRARY_PATH"
if [ ! -x "$(command -v nvcc 2>/dev/null)" ]; then
test -d "$HOME/.local/cuda-$CUDA_VERSION" && PATH="$HOME/.local/cuda-$CUDA_VERSION/bin:$PATH" && LD_LIBRARY_PATH="$HOME/.local/cuda-$CUDA_VERSION/lib64:$LD_LIBRARY_PATH"
fi
unset CUDA_VERSION
fi
# set PATH so it include conda
# priority: system > shared > local
if [ -z "$(command -v conda 2>/dev/null)" ]; then
CONDA_BRANCH=3
test -d "$SHARE_REPOSITORY/miniconda$CONDA_BRANCH" && CONDA_HOME="$SHARE_REPOSITORY/miniconda$CONDA_BRANCH" && PATH="$CONDA_HOME/bin:$PATH"
if [ -z "$(command -v conda 2>/dev/null)" ]; then
test -d "$HOME/.miniconda$CONDA_BRANCH" && CONDA_HOME="$HOME/.miniconda$CONDA_BRANCH" && PATH="$CONDA_HOME/bin:$PATH"
fi
if [ -n "$(command -v conda 2>/dev/null)" ]; then
if [[ "$(conda --version | grep -Eo '[0-9.]*')" > "4.3.9999" ]]; then
source "$CONDA_HOME/etc/profile.d/conda.sh"
fi
fi
unset CONDA_HOME
unset CONDA_BRANCH
else
CONDA_HOME="$(which conda)"
CONDA_HOME="$(dirname $CONDA_HOME)"
CONDA_HOME="$(dirname $CONDA_HOME)"
if [[ "$(conda --version | grep -Eo '[0-9.]*')" > "4.3.9999" ]]; then
source "$CONDA_HOME/etc/profile.d/conda.sh"
fi
unset CONDA_HOME
fi
# set PATH so it include brew
# priority: system > shared > local
if [ ! -x "$(command -v brew 2>/dev/null)" ]; then
test -d "$SHARE_REPOSITORY/linuxbrew" && PATH="$SHARE_REPOSITORY/linuxbrew/bin:$SHARE_REPOSITORY/linuxbrew/sbin:$PATH" && MANPATH="$SHARE_REPOSITORY/linuxbrew/share/man:$MANPATH" && INFOPATH="$SHARE_REPOSITORY/linuxbrew/share/info:$INFOPATH"
if [ ! -x "$(command -v brew 2>/dev/null)" ]; then
test -d "$HOME/.linuxbrew" && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH" && MANPATH="$HOME/.linuxbrew/share/man:$MANPATH" && INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
fi
fi
###
unset SHARE_REPOSITORY
# set PATH so it includes local bin directories
test -d "$HOME/.bin" && PATH="$HOME/.bin:$PATH"
test -d "$HOME/.local/bin" && PATH="$HOME/.local/bin:$PATH"
else
# source conda.sh to use "conda activate" in TMUX session
if [ -n "$(command -v conda 2>/dev/null)" ]; then
CONDA_HOME="$(which conda)"
CONDA_HOME="$(dirname $CONDA_HOME)"
CONDA_HOME="$(dirname $CONDA_HOME)"
if [[ "$(conda --version | grep -Eo '[0-9.]*')" > "4.3.9999" ]]; then
source "$CONDA_HOME/etc/profile.d/conda.sh"
fi
unset CONDA_HOME
fi
fi