From 77d28abe7a9621b9b8fe1f95e7c7ebc36c3fef72 Mon Sep 17 00:00:00 2001 From: Trevor Morris Date: Tue, 9 Mar 2021 16:52:52 +0000 Subject: [PATCH 1/2] Fix TVM compile without LLVM --- src/target/metadata_module.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/target/metadata_module.cc b/src/target/metadata_module.cc index e2575c34d8f2..0dbf505fb560 100644 --- a/src/target/metadata_module.cc +++ b/src/target/metadata_module.cc @@ -116,8 +116,12 @@ runtime::Module CreateMetadataModule( crt_exportable_modules.push_back(target_module); target_module = CreateCSourceCrtMetadataModule(crt_exportable_modules, target); } else if (target->kind->name == "llvm") { +#ifdef TVM_LLVM_VERSION crt_exportable_modules.push_back(target_module); target_module = CreateLLVMCrtMetadataModule(crt_exportable_modules, target); +#else // TVM_LLVM_VERSION + LOG(FATAL) << "TVM was not built with LLVM enabled."; +#endif // TVM_LLVM_VERSION } } else { if (!non_crt_exportable_modules.empty()) { From 38d8ff0ada83030693823a702835a0f07b40c5c1 Mon Sep 17 00:00:00 2001 From: Trevor Morris Date: Tue, 9 Mar 2021 17:43:29 +0000 Subject: [PATCH 2/2] Fix formatting --- src/target/metadata_module.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/metadata_module.cc b/src/target/metadata_module.cc index 0dbf505fb560..0b30d42c876c 100644 --- a/src/target/metadata_module.cc +++ b/src/target/metadata_module.cc @@ -119,7 +119,7 @@ runtime::Module CreateMetadataModule( #ifdef TVM_LLVM_VERSION crt_exportable_modules.push_back(target_module); target_module = CreateLLVMCrtMetadataModule(crt_exportable_modules, target); -#else // TVM_LLVM_VERSION +#else // TVM_LLVM_VERSION LOG(FATAL) << "TVM was not built with LLVM enabled."; #endif // TVM_LLVM_VERSION }