From 6f6cb6a13dca7d272553effa1ed1fc9b6bc0eff4 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Thu, 7 Nov 2024 15:48:36 +0800 Subject: [PATCH 1/3] fix cmake can't find pti_view on Windows. --- libkineto/src/plugin/xpupti/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libkineto/src/plugin/xpupti/CMakeLists.txt b/libkineto/src/plugin/xpupti/CMakeLists.txt index aabb93663..5260c70b6 100644 --- a/libkineto/src/plugin/xpupti/CMakeLists.txt +++ b/libkineto/src/plugin/xpupti/CMakeLists.txt @@ -24,8 +24,18 @@ find_package(Pti REQUIRED) if(TARGET Pti::pti_view) message(INFO " Found XPUPTI") + set(pti_view_names) + # Original file name. + list(APPEND pti_view_names pti_view) + # For Windows, file name with version number. + foreach(ver_major RANGE 0 1) + foreach(ver_minor RANGE 0 9) + list(APPEND pti_view_names pti_view-${ver_major}-${ver_minor}) + endforeach() + endforeach() + get_target_property(PTI_INCLUDE_DIR Pti::pti_view INTERFACE_INCLUDE_DIRECTORIES) - find_library(PTI_VIEW_LIBRARY NAMES pti_view PATHS "${PTI_INCLUDE_DIR}/../lib") + find_library(PTI_VIEW_LIBRARY NAMES ${pti_view_names} PATHS "${PTI_INCLUDE_DIR}/../lib") set(PTI_LIBRARY ${PTI_VIEW_LIBRARY} CACHE STRING "Imported PTI library.") set(PTI_INCLUDE_DIR ${PTI_INCLUDE_DIR} CACHE STRING "PTI include directory.") From 895461af4776e2c121a9e806baa7410a07ce9ade Mon Sep 17 00:00:00 2001 From: Xu Han Date: Thu, 7 Nov 2024 23:40:23 +0800 Subject: [PATCH 2/3] update comments. --- libkineto/src/plugin/xpupti/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libkineto/src/plugin/xpupti/CMakeLists.txt b/libkineto/src/plugin/xpupti/CMakeLists.txt index 5260c70b6..09e85c243 100644 --- a/libkineto/src/plugin/xpupti/CMakeLists.txt +++ b/libkineto/src/plugin/xpupti/CMakeLists.txt @@ -25,9 +25,9 @@ if(TARGET Pti::pti_view) message(INFO " Found XPUPTI") set(pti_view_names) - # Original file name. + # For Linux, due to it has soft link original file name is fine. list(APPEND pti_view_names pti_view) - # For Windows, file name with version number. + # For Windows, file name to be appended with version number. foreach(ver_major RANGE 0 1) foreach(ver_minor RANGE 0 9) list(APPEND pti_view_names pti_view-${ver_major}-${ver_minor}) From 1b2e93ff0f2e6356ad2c5db375462c3c60a41280 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Wed, 20 Nov 2024 10:59:57 +0800 Subject: [PATCH 3/3] update ver_minor range. --- libkineto/src/plugin/xpupti/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libkineto/src/plugin/xpupti/CMakeLists.txt b/libkineto/src/plugin/xpupti/CMakeLists.txt index 09e85c243..45dae60db 100644 --- a/libkineto/src/plugin/xpupti/CMakeLists.txt +++ b/libkineto/src/plugin/xpupti/CMakeLists.txt @@ -29,7 +29,7 @@ if(TARGET Pti::pti_view) list(APPEND pti_view_names pti_view) # For Windows, file name to be appended with version number. foreach(ver_major RANGE 0 1) - foreach(ver_minor RANGE 0 9) + foreach(ver_minor RANGE 0 19) list(APPEND pti_view_names pti_view-${ver_major}-${ver_minor}) endforeach() endforeach()