# \[Build Error\] with the current TVM main version

**URL:** <https://discuss.tvm.apache.org/t/build-error-with-the-current-tvm-main-version/13108>\
**Category:** Troubleshooting\
**Created:** [July 10, 2022, 1:45pm UTC](https://discuss.tvm.apache.org/t/build-error-with-the-current-tvm-main-version/13108 "2022-07-10T13:45:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lindylin](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@lindylin](https://discuss.tvm.apache.org/u/lindylin)\
**Post date:** [July 10, 2022, 1:45pm UTC](https://discuss.tvm.apache.org/t/build-error-with-the-current-tvm-main-version/13108/1 "2022-07-10T13:45:37Z")

</div>

I checked out the latest TVM main version from github, and built it in my ubuntu environment. Here is the error I met. Thanks for any help!

```
Consolidate compiler generated dependencies of target tvm_libinfo_objs
[1%] Built target project_libbacktrace
[1%] Built target tvm_libinfo_objs
Consolidate compiler generated dependencies of target tvm_runtime_objs
[10%] Built target tvm_runtime_objs
[10%] Built target tvm_runtime
Consolidate compiler generated dependencies of target tvm_objs
[10%] Building CXX object CMakeFiles/tvm_objs.dir/src/target/llvm/codegen_cpu.cc.o
[10%] Building CXX object CMakeFiles/tvm_objs.dir/src/target/llvm/codegen_x86_64.cc.o
[10%] Building CXX object CMakeFiles/tvm_objs.dir/src/target/llvm/intrin_rule_hexagon.cc.o
[10%] Building CXX object CMakeFiles/tvm_objs.dir/src/target/llvm/intrin_rule_llvm.cc.o
[10%] Building CXX object CMakeFiles/tvm_objs.dir/src/target/llvm/intrin_rule_nvptx.cc.o
/home/xwv/xwv/tvm-main/src/target/llvm/codegen_cpu.cc: In member function 'void tvm::codegen::CodeGenCPU::AddDebugInformation(tvm::tir::PrimFunc, llvm::Function*)':
/home/xwv/xwv/tvm-main/src/target/llvm/codegen_cpu.cc:206:78: error: no matching function for call to 'tvm::codegen::CodeGenCPU::GetDebugType(tvm::runtime::DataType&, llvm::Type*)'
   llvm::DIType* returnTy = GetDebugType(ret_type_tir, f_llvm->getReturnType());
                                                                              ^
In file included from /home/xwv/xwv/tvm-main/src/target/llvm/codegen_cpu.cc:25:0:
/home/xwv/xwv/tvm-main/src/target/llvm/codegen_cpu.h:193:17: note: candidate: llvm::DIType* tvm::codegen::CodeGenCPU::GetDebugType(const tvm::Type&, llvm::Type*)
   llvm::DIType* GetDebugType(const Type& ty_tir, llvm::Type* ty_llvm);
                 ^ ~~~~~~~~~~~
/home/xwv/xwv/tvm-main/src/target/llvm/codegen_cpu.h:193:17: note: no known conversion for argument 1 from 'tvm::runtime::DataType' to 'const tvm::Type&'
[10%] Building CXX object CMakeFiles/tvm_objs.dir/src/target/llvm/intrin_rule_rocm.cc.o
CMakeFiles/tvm_objs.dir/build.make:7047: recipe for target 'CMakeFiles/tvm_objs.dir/src/target/llvm/codegen_cpu.cc.o' failed
make[2]: *** [CMakeFiles/tvm_objs.dir/src/target/llvm/codegen_cpu.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:120: recipe for target 'CMakeFiles/tvm_objs.dir/all' failed
make[1]: *** [CMakeFiles/tvm_objs.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

```

Here is the screen copy for the same error output.

 ![微信图片_20220710214501](https://discuss.tvm.apache.org/uploads/default/original/2X/6/6c8184eb9e10897c96afb2b2f32819b33ac98855.png)

---

<div class="post-metadata">

**Author:** ![kparzysz](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/kparzysz/32/252_2.png) [@kparzysz](https://discuss.tvm.apache.org/u/kparzysz)\
**Post date:** [July 10, 2022, 2:29pm UTC](https://discuss.tvm.apache.org/t/build-error-with-the-current-tvm-main-version/13108/2 "2022-07-10T14:29:57Z")

</div>

Hmm. Could you change line 206 in codegen\_cpu.cc from

```auto
llvm::DIType* returnTy = GetDebugType(ret_type_tir, f_llvm->getReturnType());

```

to

```auto
llvm::DIType* returnTy = GetDebugType(GetTypeFromRuntimeDataType(ret_type_tir), f_llvm->getReturnType());

```

?

---

<div class="post-metadata">

**Author:** ![lindylin](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@lindylin](https://discuss.tvm.apache.org/u/lindylin)\
**Post date:** [July 10, 2022, 10:30pm UTC](https://discuss.tvm.apache.org/t/build-error-with-the-current-tvm-main-version/13108/3 "2022-07-10T22:30:01Z")

</div>

@kparzysz Oh, this change worked!! The problem solved now. Thanks so much!
