[llvm] Fix build of JITLoaderVTune if ITTAPI_SOURCE_DIR is specified (PR #106924)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 1 15:16:09 PDT 2024


https://github.com/Zentrik created https://github.com/llvm/llvm-project/pull/106924

https://github.com/llvm/llvm-project/blob/357bd61744bb8cc2b9b07447294fa977e5758550/llvm/lib/ExecutionEngine/IntelJITProfiling/CMakeLists.txt allows specifying the source directory of ittapi. This change allows configuring the source directory of ittapi here as well.

>From b6cbb3f9ee298fe5e9fb2d76cc91ae2a9ad853e3 Mon Sep 17 00:00:00 2001
From: Zentrik <llvm.zentrik at gmail.com>
Date: Sun, 1 Sep 2024 22:25:09 +0100
Subject: [PATCH 1/2] Use correct ittapi source directory

ITTAPI_SOURCE_DIR is what IntelJITProfiling uses, so I presume this is what should be used here. This fixes building for me as I set `ITTAPI_SOURCE_DIR`.
---
 llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
index 3d1dfe758c79dd..f12229cfb4b2e0 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
@@ -6,7 +6,7 @@ set(intel_jit_profiling )
 if( LLVM_USE_INTEL_JITEVENTS )
   set(intel_jit_profiling IntelJITProfiling)
   include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../IntelJITProfiling)
-  include_directories(${PROJECT_BINARY_DIR}/ittapi/include/ )
+  include_directories(${ITTAPI_SOURCE_DIR}/ittapi/include/ )
 endif()
 
 add_llvm_component_library(LLVMOrcTargetProcess

>From b60e093e552b1b5ea6de0d356d2ef556242362cd Mon Sep 17 00:00:00 2001
From: Zentrik <llvm.zentrik at gmail.com>
Date: Sun, 1 Sep 2024 22:54:03 +0100
Subject: [PATCH 2/2] Fix if ITTAPI_SOURCE_DIR is not set

---
 llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
index f12229cfb4b2e0..03677d610cbb76 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
@@ -6,6 +6,9 @@ set(intel_jit_profiling )
 if( LLVM_USE_INTEL_JITEVENTS )
   set(intel_jit_profiling IntelJITProfiling)
   include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../IntelJITProfiling)
+  if(NOT DEFINED ITTAPI_SOURCE_DIR)
+      set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
+  endif()
   include_directories(${ITTAPI_SOURCE_DIR}/ittapi/include/ )
 endif()
 



More information about the llvm-commits mailing list