-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage_dpcpp.sh
41 lines (38 loc) · 961 Bytes
/
manage_dpcpp.sh
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
source env.sh
function usage()
{
echo "Usage: source manage_dpcpp.sh [install | uninstall]"
}
INSTALL_FILE=/usr/local/.dpcpp
if [ $# -ne 1 ]
then
usage
elif [ $1 = "install" ]
then
echo "Installing dpcpp..."
export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
if ! [[ -f "$INSTALL_FILE" ]]; then
cp -r /dpcpp/install/bin/* /usr/local/bin/
cp -r /dpcpp/install/lib/* /usr/local/lib/
cp -r /dpcpp/install/include/* /usr/local/include/
touch $INSTALL_FILE #Set dpcpp as installed
fi
echo "Done!"
elif [ $1 = "uninstall" ]
then
echo "Uninstalling dpcpp..."
if [[ -f "$INSTALL_FILE" ]]; then
rm $INSTALL_FILE
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/cuda/bin:/usr/local/cuda/nvvm/bin
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64
for file in $(ls /dpcpp/*.txt)
do
xargs rm < $file
done
fi
echo "Done!"
else
usage
fi
cd ~