This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch refactor-s0
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 70bbe36645dca357e44a11d266fe09801c66b077
Author: tqchen <[email protected]>
AuthorDate: Mon Mar 10 20:59:54 2025 -0400

    fix lint and minor compile
---
 ffi/cmake/Utils/AddLibbacktrace.cmake        | 18 ++++++++----------
 ffi/tests/cpp/test_string.cc                 |  2 +-
 ffi/tests/cpp/testing_object.h               |  2 +-
 python/tvm/_ffi/libinfo.py                   |  2 ++
 src/relax/backend/contrib/cutlass/codegen.cc |  2 +-
 src/runtime/debug_compile.cc                 |  2 +-
 tests/lint/check_file_type.py                |  3 +++
 web/Makefile                                 |  3 ++-
 8 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/ffi/cmake/Utils/AddLibbacktrace.cmake 
b/ffi/cmake/Utils/AddLibbacktrace.cmake
index a837ca7b3f..d534bd1e6c 100644
--- a/ffi/cmake/Utils/AddLibbacktrace.cmake
+++ b/ffi/cmake/Utils/AddLibbacktrace.cmake
@@ -13,14 +13,15 @@ function(_libbacktrace_compile)
 
   file(MAKE_DIRECTORY ${_libbacktrace_prefix}/include)
   file(MAKE_DIRECTORY ${_libbacktrace_prefix}/lib)
+
   ExternalProject_Add(project_libbacktrace
     PREFIX libbacktrace
     SOURCE_DIR ${_libbacktrace_source}
     BINARY_DIR ${_libbacktrace_prefix}
     CONFIGURE_COMMAND
-      ${_libbacktrace_source}/configure
+      "${_libbacktrace_source}/configure"
       "--prefix=${_libbacktrace_prefix}"
-      "--with-pic"
+      --with-pic
       "CC=${_cmake_c_compiler}"
       "CPP=${_cmake_c_compiler} -E"
       "CFLAGS=${CMAKE_C_FLAGS}"
@@ -28,14 +29,11 @@ function(_libbacktrace_compile)
       "NM=${CMAKE_NM}"
       "STRIP=${CMAKE_STRIP}"
       "--host=${MACHINE_NAME}"
-    BUILD_COMMAND make -j
-    BUILD_BYPRODUCTS ${_libbacktrace_prefix}/lib/libbacktrace.a 
${_libbacktrace_prefix}/include/backtrace.h
-    INSTALL_DIR ${_libbacktrace_prefix}
-    INSTALL_COMMAND make install
-    LOG_CONFIGURE ON
-    LOG_INSTALL ON
-    LOG_BUILD ON
-    LOG_OUTPUT_ON_FAILURE ON
+  INSTALL_DIR ${_libbacktrace_prefix}
+  BUILD_COMMAND make
+  INSTALL_COMMAND make install
+  BUILD_BYPRODUCTS "${_libbacktrace_prefix}/lib/libbacktrace.a"
+                   "${_libbacktrace_prefix}/include/backtrace.h"
   )
   ExternalProject_Add_Step(project_libbacktrace checkout DEPENDERS configure 
DEPENDEES download)
   set_target_properties(project_libbacktrace PROPERTIES EXCLUDE_FROM_ALL TRUE)
diff --git a/ffi/tests/cpp/test_string.cc b/ffi/tests/cpp/test_string.cc
index 04348292b7..7be184cafb 100644
--- a/ffi/tests/cpp/test_string.cc
+++ b/ffi/tests/cpp/test_string.cc
@@ -263,4 +263,4 @@ TEST(String, Concat) {
   EXPECT_EQ(res4.compare("helloworld"), 0);
   EXPECT_EQ(res5.compare("worldhello"), 0);
 }
-}  // namespace
\ No newline at end of file
+}  // namespace
diff --git a/ffi/tests/cpp/testing_object.h b/ffi/tests/cpp/testing_object.h
index cd6055ec1f..daba742c74 100644
--- a/ffi/tests/cpp/testing_object.h
+++ b/ffi/tests/cpp/testing_object.h
@@ -88,4 +88,4 @@ class TFloat : public TNumber {
 }  // namespace testing
 }  // namespace ffi
 }  // namespace tvm
-#endif  // TVM_FFI_TESTING_OBJECT_H_
\ No newline at end of file
+#endif  // TVM_FFI_TESTING_OBJECT_H_
diff --git a/python/tvm/_ffi/libinfo.py b/python/tvm/_ffi/libinfo.py
index 3bbc588f45..2dcf29ca72 100644
--- a/python/tvm/_ffi/libinfo.py
+++ b/python/tvm/_ffi/libinfo.py
@@ -222,11 +222,13 @@ def find_include_path(name=None, search_path=None, 
optional=False):
         dmlc_include_path = []
     else:
         tvm_include_path = [os.path.join(p, "include") for p in header_path]
+        tvm_ffi_include_path = [os.path.join(p, "ffi/include") for p in 
header_path]
         dlpack_include_path = [os.path.join(p, "dlpack/include") for p in 
header_path]
         dmlc_include_path = [os.path.join(p, "dmlc-core/include") for p in 
header_path]
 
         # try to find include path
         include_found = [p for p in tvm_include_path if os.path.exists(p) and 
os.path.isdir(p)]
+        include_found += [p for p in tvm_ffi_include_path if os.path.exists(p) 
and os.path.isdir(p)]
         include_found += [p for p in dlpack_include_path if os.path.exists(p) 
and os.path.isdir(p)]
         include_found += [p for p in dmlc_include_path if os.path.exists(p) 
and os.path.isdir(p)]
 
diff --git a/src/relax/backend/contrib/cutlass/codegen.cc 
b/src/relax/backend/contrib/cutlass/codegen.cc
index 980243cf81..7a2c8339e2 100644
--- a/src/relax/backend/contrib/cutlass/codegen.cc
+++ b/src/relax/backend/contrib/cutlass/codegen.cc
@@ -95,7 +95,7 @@ class CodegenResult : public ObjectRef {
     data_ = std::move(n);
   }
 
-  TVM_DEFINE_OBJECT_REF_METHODS(CodegenResult, ObjectRef, CodegenResultNode)
+  TVM_DEFINE_OBJECT_REF_METHODS(CodegenResult, ObjectRef, CodegenResultNode);
 };
 
 TVM_REGISTER_NODE_TYPE(CodegenResultNode);
diff --git a/src/runtime/debug_compile.cc b/src/runtime/debug_compile.cc
index 96d220307a..ee59a37131 100644
--- a/src/runtime/debug_compile.cc
+++ b/src/runtime/debug_compile.cc
@@ -42,4 +42,4 @@ String Test() {
 }
 
 }  // namespace debug
-}  // namespace tvm
\ No newline at end of file
+}  // namespace tvm
diff --git a/tests/lint/check_file_type.py b/tests/lint/check_file_type.py
index 119cc2ea78..a567664788 100644
--- a/tests/lint/check_file_type.py
+++ b/tests/lint/check_file_type.py
@@ -175,6 +175,9 @@ def filename_allowed(name):
     if name.startswith("3rdparty"):
         return True
 
+    if name.startswith("ffi/3rdparty"):
+        return True
+
     if name in ALLOW_SPECIFIC_FILE:
         return True
 
diff --git a/web/Makefile b/web/Makefile
index 5abd72b598..e9d1375fc7 100644
--- a/web/Makefile
+++ b/web/Makefile
@@ -18,7 +18,8 @@
 TVM_ROOT=$(realpath $(shell dirname $(firstword $(MAKEFILE_LIST))))/../
 
 INCLUDE_FLAGS = -I$(TVM_ROOT) -I$(TVM_ROOT)/include\
-       -I$(TVM_ROOT)/3rdparty/dlpack/include 
-I$(TVM_ROOT)/3rdparty/dmlc-core/include\
+       -I$(TVM_ROOT)/ffi/include\
+       -I$(TVM_ROOT)/ffi/3rdparty/dlpack/include 
-I$(TVM_ROOT)/3rdparty/dmlc-core/include\
        -I$(TVM_ROOT)/3rdparty/compiler-rt -I$(TVM_ROOT)/3rdparty/picojson
 
 .PHONY: clean all rmtypedep preparetest

Reply via email to