-
Notifications
You must be signed in to change notification settings - Fork 0
/
proj_activate
executable file
·120 lines (101 loc) · 3.21 KB
/
proj_activate
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/bash
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
if [ -n "${_OLD_LD_LIBRARY_PATH:-}" ] ; then
if [ ${_OLD_LD_LIBRARY_PATH} = 0 ] ; then
unset LD_LIBRARY_PATH
else
export LD_LIBRARY_PATH=${_OLD_LD_LIBRARY_PATH}
fi
unset _OLD_LD_LIBRARY_PATH
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
export PYTHON_REV=3.10.5
#export PYTHON_REV=3.9.13
#export PYTHON_REV=3.6.15
export PROJ_NAME=redfin
export OSID=`OSid`
export TOOLS_DIR=/projects/flow/tools/${OSID}
declare -A array
array[iverilog]=v11_0
#array[iverilog]=e3a9591960d53e546d5834506b229a5d56995ed7
array[verilator]=v4.224
array[ghdl]=v2.0.0
export NEWPATH=$PATH
for i in "${!array[@]}"
do
export NEWPATH=${TOOLS_DIR}/$i/${array[$i]}/bin:$NEWPATH
done
VIRTUAL_ENV="/projects/flow/venv/${OSID}/${PROJ_NAME}-${PYTHON_REV}"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$NEWPATH"
export PATH
unset NEWPATH
export PYINSTALL_DIR="/projects/flow/tools/${OSID}/python/${PYTHON_REV}"
if [ -z ${LD_LIBRARY_PATH+x} ]; then
export _OLD_LD_LIBRARY_PATH=0
export LD_LIBRARY_PATH="${PYINSTALL_DIR}/lib"
else
export _OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH="${PYINSTALL_DIR}/lib:${LD_LIBRARY_PATH}"
fi
# declare -A ld
# array[gcc]=12.1.0
#
# for i in "${!array[@]}"
# do
# export NEWPATH=${TOOLS_DIR}/$i/${array[$i]}/bin:$NEWPATH
# done
export LD_LIBRARY_PATH="${TOOLS_DIR}/gcc/12.1.0/lib64:${LD_LIBRARY_PATH}"
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(${PROJ_NAME}) ${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="(${PROJ_NAME})"
export VIRTUAL_ENV_PROMPT
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi