forked from Tensor-Array/Tensor-Array-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanylinux.sh
More file actions
72 lines (62 loc) · 1.69 KB
/
manylinux.sh
File metadata and controls
72 lines (62 loc) · 1.69 KB
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
#!/bin/bash
# Decide if we can proceed or not (root or sudo is required) and if so store whether sudo should be used or not.
if [ "$is_root" = false ] && [ "$has_sudo" = false ]
then
echo "Root or sudo is required. Aborting."
exit 1
elif [ "$is_root" = false ]
then
USE_SUDO=sudo
else
USE_SUDO=
fi
cd ${PWD}
# Install dependencies for building Tensor-Array on manylinux
echo "Installing dependencies for building Tensor-Array on manylinux..."
chmod +x tensor-array-repo/Tensor-Array/scripts/actions/install-cuda-rhel.sh
echo "Installing required packages..."
$USE_SUDO yum install -y redhat-lsb-core wget
echo "Running CUDA installation script..."
tensor-array-repo/Tensor-Array/scripts/actions/install-cuda-rhel.sh
# debugging output
echo
echo "------------------------------"
echo
echo "CUDA_PATH="
echo "$CUDA_PATH"
echo
echo "PATH="
echo "$PATH"
echo
echo "LD_LIBRARY_PATH="
echo "$LD_LIBRARY_PATH"
echo
echo "------------------------------"
echo
# Check if nvcc is available
echo "Checking for nvcc..."
if ! command -v nvcc &> /dev/null
then
echo "nvcc could not be found. Please ensure CUDA is installed correctly."
exit 1
fi
echo "nvcc is available. Proceeding with the build environment setup."
cd tensor-array-repo/Tensor-Array
# Create build directory if it doesn't exist
if [ ! -d "build" ]
then
echo "Creating build directory..."
mkdir build
else
echo "Build directory already exists."
fi
# Change to the build directory
cd build
# Configure the build with CMake
echo "Configuring the build with CMake..."
cmake .. -DCMAKE_CUDA_HOST_COMPILER="/usr/bin/gcc" -DCMAKE_INSTALL_PREFIX=${TENSOR_ARRAY_INSTALL_PATH}
cmake --build .
cmake --install .
cd ..
rm -rf build
cd ../..