|
1 |
| -#!/bin/bash |
2 |
| - |
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 |
5 |
| - echo "Root or sudo is required. Aborting." |
6 |
| - exit 1 |
7 |
| -elif [ "$is_root" = false ] ; then |
8 |
| - USE_SUDO=sudo |
9 |
| -else |
10 |
| - USE_SUDO= |
11 |
| -fi |
12 |
| - |
13 |
| -cd ${PWD} |
14 |
| - |
15 |
| -# Install dependencies for building Tensor-Array on manylinux |
16 |
| -echo "Installing dependencies for building Tensor-Array on manylinux..." |
17 |
| -chmod +x tensor-array-repo/Tensor-Array/scripts/actions/install-cuda-rhel.sh |
18 |
| -echo "Installing required packages..." |
19 |
| -$USE_SUDO yum install -y redhat-lsb-core wget |
20 |
| -echo "Running CUDA installation script..." |
21 |
| -tensor-array-repo/Tensor-Array/scripts/actions/install-cuda-rhel.sh |
22 |
| - |
23 |
| -# debugging output |
24 |
| -echo |
25 |
| -echo "------------------------------" |
26 |
| -echo |
27 |
| -echo "CUDA_PATH=" |
28 |
| -echo "$CUDA_PATH" |
29 |
| -echo |
30 |
| -echo "PATH=" |
31 |
| -echo "$PATH" |
32 |
| -echo |
33 |
| -echo "LD_LIBRARY_PATH=" |
34 |
| -echo "$LD_LIBRARY_PATH" |
35 |
| -echo |
36 |
| -echo "------------------------------" |
37 |
| -echo |
38 |
| - |
39 |
| -# Check if nvcc is available |
40 |
| -echo "Checking for nvcc..." |
41 |
| -if ! command -v nvcc &> /dev/null; then |
42 |
| - echo "nvcc could not be found. Please ensure CUDA is installed correctly." |
43 |
| - exit 1 |
44 |
| -fi |
45 |
| -echo "nvcc is available. Proceeding with the build environment setup." |
46 |
| - |
47 |
| -cd tensor-array-repo/Tensor-Array |
48 |
| - |
49 |
| -pip install "cmake>=3.18,<3.29" |
50 |
| - |
51 |
| -# Create build directory if it doesn't exist |
52 |
| -if [ ! -d "build" ]; then |
53 |
| - echo "Creating build directory..." |
54 |
| - mkdir build |
55 |
| -else |
56 |
| - echo "Build directory already exists." |
57 |
| -fi |
58 |
| -# Change to the build directory |
59 |
| -cd build |
60 |
| -# Configure the build with CMake |
61 |
| -echo "Configuring the build with CMake..." |
62 |
| -cmake .. |
63 |
| -cmake --build . |
64 |
| -cmake --install . |
65 |
| - |
66 |
| -cd .. |
67 |
| -rm -rf build |
68 |
| - |
69 |
| -cd ../.. |
70 |
| - |
| 1 | +#!/bin/bash |
| 2 | + |
| 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 |
| 5 | + echo "Root or sudo is required. Aborting." |
| 6 | + exit 1 |
| 7 | +elif [ "$is_root" = false ] ; then |
| 8 | + USE_SUDO=sudo |
| 9 | +else |
| 10 | + USE_SUDO= |
| 11 | +fi |
| 12 | + |
| 13 | +cd ${PWD} |
| 14 | + |
| 15 | +# Install dependencies for building Tensor-Array on manylinux |
| 16 | +echo "Installing dependencies for building Tensor-Array on manylinux..." |
| 17 | +chmod +x tensor-array-repo/Tensor-Array/scripts/actions/install-cuda-rhel.sh |
| 18 | +echo "Installing required packages..." |
| 19 | +$USE_SUDO yum install -y redhat-lsb-core wget |
| 20 | +echo "Running CUDA installation script..." |
| 21 | +tensor-array-repo/Tensor-Array/scripts/actions/install-cuda-rhel.sh |
| 22 | + |
| 23 | +# debugging output |
| 24 | +echo |
| 25 | +echo "------------------------------" |
| 26 | +echo |
| 27 | +echo "CUDA_PATH=" |
| 28 | +echo "$CUDA_PATH" |
| 29 | +echo |
| 30 | +echo "PATH=" |
| 31 | +echo "$PATH" |
| 32 | +echo |
| 33 | +echo "LD_LIBRARY_PATH=" |
| 34 | +echo "$LD_LIBRARY_PATH" |
| 35 | +echo |
| 36 | +echo "------------------------------" |
| 37 | +echo |
| 38 | + |
| 39 | +# Check if nvcc is available |
| 40 | +echo "Checking for nvcc..." |
| 41 | +if ! command -v nvcc &> /dev/null; then |
| 42 | + echo "nvcc could not be found. Please ensure CUDA is installed correctly." |
| 43 | + exit 1 |
| 44 | +fi |
| 45 | +echo "nvcc is available. Proceeding with the build environment setup." |
| 46 | + |
| 47 | +cd tensor-array-repo/Tensor-Array |
| 48 | + |
| 49 | +pip install "cmake>=3.18,<3.29" |
| 50 | + |
| 51 | +# Create build directory if it doesn't exist |
| 52 | +if [ ! -d "build" ]; then |
| 53 | + echo "Creating build directory..." |
| 54 | + mkdir build |
| 55 | +else |
| 56 | + echo "Build directory already exists." |
| 57 | +fi |
| 58 | +# Change to the build directory |
| 59 | +cd build |
| 60 | +# Configure the build with CMake |
| 61 | +echo "Configuring the build with CMake..." |
| 62 | +cmake .. |
| 63 | +cmake --build . |
| 64 | +cmake --install . |
| 65 | + |
| 66 | +cd .. |
| 67 | +rm -rf build |
| 68 | + |
| 69 | +cd ../.. |
| 70 | + |
0 commit comments