1
1
#! /bin/bash
2
2
3
3
# Decide if we can proceed or not (root or sudo is required) and if so store whether sudo should be used or not.
4
- if [ " $is_root " = false ] && [ " $has_sudo " = false ]; then
4
+ if [ " $is_root " = false ] && [ " $has_sudo " = false ]
5
+ then
5
6
echo " Root or sudo is required. Aborting."
6
7
exit 1
7
- elif [ " $is_root " = false ] ; then
8
+ elif [ " $is_root " = false ]
9
+ then
8
10
USE_SUDO=sudo
9
11
else
10
12
USE_SUDO=
38
40
39
41
# Check if nvcc is available
40
42
echo " Checking for nvcc..."
41
- if ! command -v nvcc & > /dev/null; then
43
+ if ! command -v nvcc & > /dev/null
44
+ then
42
45
echo " nvcc could not be found. Please ensure CUDA is installed correctly."
43
46
exit 1
44
47
fi
@@ -47,7 +50,8 @@ echo "nvcc is available. Proceeding with the build environment setup."
47
50
cd tensor-array-repo/Tensor-Array
48
51
49
52
# Create build directory if it doesn't exist
50
- if [ ! -d " build" ]; then
53
+ if [ ! -d " build" ]
54
+ then
51
55
echo " Creating build directory..."
52
56
mkdir build
53
57
else
@@ -66,13 +70,18 @@ rm -rf build
66
70
67
71
# Create symbolic link for lib64 to lib if it doesn't exist
68
72
echo " Checking for symbolic link from lib64 to lib..."
69
- if [ ! -L " lib" ] && [ -d " lib64" ]; then
73
+ if [ ! -L " lib" ] && [ -d " lib64" ]
74
+ then
70
75
echo " Creating symbolic link for lib64 to lib..."
71
76
ln -s lib64 lib
72
77
else
73
78
echo " Symbolic link for lib64 to lib already exists or lib64 does not exist."
74
79
fi
75
80
76
- patchelf --set-rpath " \$ ORIGIN/../lib" ./lib/* .so
81
+ for i in ./lib/* .so
82
+ do
83
+ echo " Add ${i} .so file"
84
+ patchelf --set-rpath " \$ ORIGIN/../lib" ./lib/${i} .so
85
+ done
77
86
78
87
cd ../..
0 commit comments