Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling the Source Code

After the patch file is applied, install and build the TVM shared library.

  1. Go to the /path/to/TVM/apache-tvm-src-v0.9.0 directory.
    1
    cd /path/to/TVM/apache-tvm-src-v0.9.0/
    
  2. Create a build directory build and copy cmake/config.cmake to the directory.
    1
    2
    mkdir build
    cp cmake/config.cmake build
    
  3. Edit build/config.cmake to customize compilation options.
    1. To facilitate the profiling, enable the embedded graph executor and the profiler using the following options:
      1
      2
      set(USE_GRAPH_EXECUTOR ON)
      set(USE_PROFILER ON)
      
    2. TVM requires LLVM for CPU code generation. Set USE_LLVM to ON.
      1
      set(USE_LLVM ON)
      
  4. Compile the CMakeList.txt file and add the following content after line 605:
    1
    target_link_libraries(tvm PRIVATE /path/to/BiShengCompiler/BiShengCompiler-3.2.0.1-aarch64-linux/lib/libtf_xla_runtime.a)
    
  5. Build TVM and the related libraries.
    1
    2
    3
    cd build
    cmake -DCMAKE_PREFIX_PATH=/path/to/BiShengCompiler/BiShengCompiler-3.2.0.1-aarch64-linux ..
    make