11#! /bin/bash
22
33# 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
56 echo " Root or sudo is required. Aborting."
67 exit 1
7- elif [ " $is_root " = false ] ; then
8+ elif [ " $is_root " = false ]
9+ then
810 USE_SUDO=sudo
911else
1012 USE_SUDO=
3840
3941# Check if nvcc is available
4042echo " Checking for nvcc..."
41- if ! command -v nvcc & > /dev/null; then
43+ if ! command -v nvcc & > /dev/null
44+ then
4245 echo " nvcc could not be found. Please ensure CUDA is installed correctly."
4346 exit 1
4447fi
@@ -47,7 +50,8 @@ echo "nvcc is available. Proceeding with the build environment setup."
4750cd tensor-array-repo/Tensor-Array
4851
4952# Create build directory if it doesn't exist
50- if [ ! -d " build" ]; then
53+ if [ ! -d " build" ]
54+ then
5155 echo " Creating build directory..."
5256 mkdir build
5357else
@@ -66,13 +70,18 @@ rm -rf build
6670
6771# Create symbolic link for lib64 to lib if it doesn't exist
6872echo " Checking for symbolic link from lib64 to lib..."
69- if [ ! -L " lib" ] && [ -d " lib64" ]; then
73+ if [ ! -L " lib" ] && [ -d " lib64" ]
74+ then
7075 echo " Creating symbolic link for lib64 to lib..."
7176 ln -s lib64 lib
7277else
7378 echo " Symbolic link for lib64 to lib already exists or lib64 does not exist."
7479fi
7580
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
7786
7887cd ../..
0 commit comments