From b05072f52d55b7936945af27f45c0473efddb810 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 14 Oct 2025 19:43:19 -0700 Subject: [PATCH 1/3] Only include LLVM headers when specifcally needed. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 426711c151b..5430a3fe40e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -438,7 +438,6 @@ llvm_map_components_to_libnames(LLVM_LIBS ) add_library(LLVM_JIT INTERFACE) -target_include_directories(LLVM_JIT SYSTEM INTERFACE ${LLVM_INCLUDE_DIRS}) target_compile_definitions(LLVM_JIT INTERFACE ${LLVM_DEFINITIONS}) target_link_libraries(LLVM_JIT INTERFACE ${LLVM_LIBS}) @@ -447,6 +446,11 @@ list(APPEND NVFUSER_SRCS ${NVFUSER_SRCS_DIR}/host_ir/jit.cpp ) +# Apply LLVM include directories only to jit.cpp +set_source_files_properties(${NVFUSER_SRCS_DIR}/host_ir/jit.cpp + PROPERTIES INCLUDE_DIRECTORIES "${LLVM_INCLUDE_DIRS}" +) + # We don't link CUPTI for MSVC if(NOT MSVC) list(APPEND NVFUSER_SRCS From 23b6cd3f196601d7daafeffd7e437139068e501f Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 16 Oct 2025 07:57:15 -0700 Subject: [PATCH 2/3] ci-debug --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5430a3fe40e..b7572480c73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -424,6 +424,14 @@ find_package(LLVM REQUIRED CONFIG) if(${LLVM_VERSION} VERSION_LESS ${LLVM_MINIMUM_VERSION}) message(FATAL_ERROR "LLVM ${LLVM_VERSION} does not meet the minimum version required: ${LLVM_MINIMUM_VERSION}") endif() + +message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") +message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") +message(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}") +message(STATUS "LLVM_DEFINITIONS: ${LLVM_DEFINITIONS}") +message(STATUS "LLVM_LIBS: ${LLVM_LIBS}") + + llvm_map_components_to_libnames(LLVM_LIBS support core From e3b66c58b0a078870d3d5d3fe2f0d0bd6aa3c9d9 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 30 Oct 2025 19:45:20 -0700 Subject: [PATCH 3/3] Direct source linkage to LLVM with system flag. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7572480c73..d6831765c53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -455,8 +455,10 @@ list(APPEND NVFUSER_SRCS ) # Apply LLVM include directories only to jit.cpp -set_source_files_properties(${NVFUSER_SRCS_DIR}/host_ir/jit.cpp - PROPERTIES INCLUDE_DIRECTORIES "${LLVM_INCLUDE_DIRS}" +set_source_files_properties( + ${NVFUSER_SRCS_DIR}/host_ir/jit.cpp + PROPERTIES + COMPILE_FLAGS "-isystem ${LLVM_INCLUDE_DIRS}" ) # We don't link CUPTI for MSVC