0

我已经按照这些说明从源代码构建了 LLVM ,现在我正在尝试根据这个官方网站中的说明从源代码构建 TVM

我执行 cmake3 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. 命令并获得以下输出

-- Build with RPC support...
-- Build with Graph runtime support...
-- Build with Graph runtime debug support...
-- VTA build with VTA_HW_PATH=/research/d1/lj2001/tvm/3rdparty/vta-hw
-- Build VTA runtime with target: sim
-- Found CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda
-- Found CUDA_CUDA_LIBRARY=/usr/local/cuda/targets/x86_64-linux/lib/stubs/libcuda.so
-- Found CUDA_CUDART_LIBRARY=/usr/local/cuda/lib64/libcudart.so
-- Found CUDA_NVRTC_LIBRARY=/usr/local/cuda/lib64/libnvrtc.so
-- Found CUDA_CUDNN_LIBRARY=/usr/local/cuda/lib64/libcudnn.so
-- Found CUDA_CUBLAS_LIBRARY=/usr/local/cuda/lib64/libcublas.so
-- Found CUDA_CUBLASLT_LIBRARY=/usr/local/cuda/lib64/libcublasLt.so
-- Build with CUDA support
-- Use llvm-config=/research/d1/lj2001/llvm/bin/llvm-config
-- Found LLVM_INCLUDE_DIRS=/research/d1/lj2001/llvm/include
-- Found LLVM_DEFINITIONS=-D_GNU_SOURCE;-D_DEBUG;-D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS
...
-- Found TVM_LLVM_VERSION=120
-- Build with LLVM
-- Set TVM_LLVM_VERSION=120
-- Build with contrib.random
-- Build with contrib.sort
-- Build with contrib.hybriddump
-- Git found: /bin/git
-- Found TVM_GIT_COMMIT_HASH=27abfadc55e79e3d40b7de7d4b87eb87a19b7b97
-- Performing Test SUPPORT_CXX14
-- Performing Test SUPPORT_CXX14 - Success
-- Building with TVM Map...
-- Build with thread support...
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /research/d1/lj2001/tvm/build

但是当我运行 make -j24 时,我得到以下输出:

Scanning dependencies of target tvm_runtime_objs
Scanning dependencies of target tvm_objs
[ 10%] Built target tvm_runtime_objs
Scanning dependencies of target tvm_runtime
[ 10%] Linking CXX shared library libtvm_runtime.so
[ 10%] Built target tvm_runtime
[ 10%] Building CXX object CMakeFiles/tvm_objs.dir/src/target/llvm/codegen_llvm.cc.o
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc: In member function ‘llvm::Value* tvm::codegen::CodeGenLLVM::CreateBroadcast(llvm::Value*, int)’:
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:480:82: error: ‘llvm::ElementCount::ElementCount(unsigned int, bool)’ is private within this context
  480 |       llvm::ConstantVector::getSplat(llvm::ElementCount(lanes, /*Scalable=*/false), zero);
      |                                                                                  ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Type.h:24,
                 from /research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:23,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/Support/TypeSize.h:39:3: note: declared private here
   39 |   ElementCount(unsigned Min, bool Scalable) : Min(Min), Scalable(Scalable) {}
      |   ^~~~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc: In member function ‘llvm::Value* tvm::codegen::CodeGenLLVM::CreateVecSlice(llvm::Value*, int, int)’:
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:488:80: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  488 |   int num_elems = llvm::cast<llvm::VectorType>(vec->getType())->getNumElements();
      |                                                                                ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc: In member function ‘llvm::Value* tvm::codegen::CodeGenLLVM::CreateVecFlip(llvm::Value*)’:
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:504:80: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  504 |   int num_elems = llvm::cast<llvm::VectorType>(vec->getType())->getNumElements();
      |                                                                                ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc: In member function ‘llvm::Value* tvm::codegen::CodeGenLLVM::CreateVecPad(llvm::Value*, int)’:
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:518:80: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  518 |   int num_elems = llvm::cast<llvm::VectorType>(vec->getType())->getNumElements();
      |                                                                                ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc: In member function ‘llvm::Value* tvm::codegen::CodeGenLLVM::CreateVecConcat(std::vector<llvm::Value*, std::allocator<llvm::Value*> >)’:
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:532:79: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  532 |     total_lanes += llvm::cast<llvm::VectorType>(v->getType())->getNumElements();
      |                                                                               ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:539:93: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  539 |       const size_t lhs_lanes = llvm::cast<llvm::VectorType>(lhs->getType())->getNumElements();
      |                                                                                             ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:540:93: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  540 |       const size_t rhs_lanes = llvm::cast<llvm::VectorType>(rhs->getType())->getNumElements();
      |                                                                                             ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc: In member function ‘virtual llvm::Value* tvm::codegen::CodeGenLLVM::CreateIntrinsic(const tvm::tir::CallNode*)’:
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:844:72: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  844 |     int l = llvm::cast<llvm::VectorType>(v->getType())->getNumElements();
      |                                                                        ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:848:72: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  848 |     int l = llvm::cast<llvm::VectorType>(v->getType())->getNumElements();
      |                                                                        ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
/research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:853:81: warning: ‘unsigned int llvm::VectorType::getNumElements() const’ is deprecated [-Wdeprecated-declarations]
  853 |     int num_elems = llvm::cast<llvm::VectorType>(v0->getType())->getNumElements() * 2;
      |                                                                                 ^
In file included from /research/d1/lj2001/llvm/include/llvm/IR/Constants.h:31,
                 from /research/d1/lj2001/llvm/include/llvm/IR/Operator.h:19,
                 from /research/d1/lj2001/llvm/include/llvm/Analysis/TargetTransformInfo.h:24,
                 from /research/d1/lj2001/tvm/src/target/llvm/llvm_common.h:33,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.h:49,
                 from /research/d1/lj2001/tvm/src/target/llvm/codegen_llvm.cc:25:
/research/d1/lj2001/llvm/include/llvm/IR/DerivedTypes.h:534:10: note: declared here
  534 | unsigned VectorType::getNumElements() const {
      |          ^~~~~~~~~~
make[2]: *** [CMakeFiles/tvm_objs.dir/src/target/llvm/codegen_llvm.cc.o] Error 1
make[1]: *** [CMakeFiles/tvm_objs.dir/all] Error 2
make: *** [all] Error 2

我该如何解决?

4

0 回答 0