File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+ set -x
4+
5+ WORK_DIR=$PWD
6+
7+ # Prerequsite: conda, python 3.8 or above; cmake; LLVM-13
8+
9+ # Step 0: Create conda environment & install related packages
10+ conda create -n tvm python=3.8 -y
11+ conda activate tvm
12+ pip install numpy decorator attrs tornado psutil xgboost cloudpickle pytest black pylint cpplint typing_extensions
13+
14+ # Step 1: Build TVM
15+ git clone https://github.com/apache/tvm
16+ cd tvm
17+ git checkout 62f9b1d
18+ git submodule update --init --recursive
19+ mkdir build && cd build
20+ cp ../cmake/config.cmake .
21+ sed -i ' /USE_LLVM/ s/OFF/\/llvm-project\/install\/bin\/llvm-config/g' config.cmake # Enable LLVM
22+ sed -i ' /USE_OPENMP/ s/none/gnu/g' config.cmake # Enable OpenMP
23+ cmake .. && make -j$( nproc)
24+ cd ..
25+
26+ # Step 2: Set TVM env
27+ export TVM_HOME=` pwd`
28+ export PYTHONPATH=${TVM_HOME} /python:${PYTHONPATH}
29+ export TVM_LIBRARY_PATH=${TVM_HOME} /build
30+ ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /miniconda/envs/tvm/bin/../lib/libstdc++.so.6
31+
32+ # Step 3: back to TLCBench
33+ cd ..
You can’t perform that action at this time.
0 commit comments