-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactivate
99 lines (79 loc) · 2.7 KB
/
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
echo "-------------------------------------------"
echo "| Activate shamrock workspace environment |"
echo "-------------------------------------------"
echo
#if running in bash
if [ -n "$BASH_VERSION" ]; then
WORKSPACEDIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
else
echo $(dirname "$0")
WORKSPACEDIR=$(realpath $(dirname "$0"))
fi
echo "Shamrock workspace dir :" $WORKSPACEDIR
echo
####################################
# Workspace bin setup
####################################
chmod +x $WORKSPACEDIR/bin/interactive_intelllvm_setup
chmod +x $WORKSPACEDIR/bin/interactive_acpp_setup
chmod +x $WORKSPACEDIR/bin/update_compilers
chmod +x $WORKSPACEDIR/bin/configure_shamrock
export PATH=$WORKSPACEDIR/bin:$PATH
####################################
# compiler setup
####################################
echo ""
echo "------ sycl compilers config ------"
if [ -d "$WORKSPACEDIR/sycl_compilers" ]; then
if [ -d "$WORKSPACEDIR/sycl_compilers/intel_llvm/" ]; then
export LLVM_HOME=$WORKSPACEDIR/sycl_compilers/intel_llvm/
echo "Intel LLVM dir :" $LLVM_HOME
export PATH=$LLVM_HOME/bin:$PATH
export LD_LIBRARY_PATH=$LLVM_HOME/lib:$LD_LIBRARY_PATH
else
echo "Intel llvm is not configured, to configure it run : interactive_intelllvm_setup"
fi
if [ -d "$WORKSPACEDIR/sycl_compilers/acpp/" ]; then
export ACPP_HOME=$WORKSPACEDIR/sycl_compilers/acpp/
echo "AdaptiveCpp dir :" $ACPP_HOME
export PATH=$ACPP_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ACPP_HOME/lib:$LD_LIBRARY_PATH
else
echo "AdaptiveCpp is not configured, to configure it run : interactive_acpp_setup"
fi
else
echo "the compilers are not setup please run the following :"
echo "interactive_intelllvm_setup or interactive_acpp_setup"
return
fi
echo "---------------------------------------"
echo ""
####################################
# python venv setup
####################################
echo "------ python venv configuration ------"
export PyVenv=$WORKSPACEDIR/ShamrockPyVenv
if [ -d "$PyVenv" ]; then
echo "Found python venv"
else
echo "creating python venv :"
python3 -m venv $PyVenv
fi
echo "Python venv dir :" $PyVenv
echo "activating venv :"
source $PyVenv/bin/activate
echo "---------------------------------------"
echo ""
####################################
# Shamrock repo setup
####################################
if [ -d "$WORKSPACEDIR/Shamrock" ]; then
echo "Shamrock repo directory :" $WORKSPACEDIR/Shamrock
else
if git clone --recurse-submodules [email protected]:tdavidcl/Shamrock.git $WORKSPACEDIR/Shamrock; then
echo "-> Succes"
else
echo "Failed to clone the shamrock repo"
return
fi
fi