From 6e195ded9b833c499c8b404e158072b9db9c7d2e Mon Sep 17 00:00:00 2001 From: Jason Bonnell <166553723+jbonnell-amd@users.noreply.github.com> Date: Thu, 6 Nov 2025 23:50:02 -0500 Subject: [PATCH] Update rocprofiler_config_interfaces.cmake to use different elf naming (#1722) * Update rocprofiler_config_interfaces.cmake to use different elf naming * try out conditional for libelf * run cmake-format to fix formatting issue * Remove libelf.patch file from therock-ci-windows.yml * Remove libelf patch from therock-ci-linux.yml as well --- .github/workflows/therock-ci-linux.yml | 1 + .github/workflows/therock-ci-windows.yml | 1 + .../cmake/rocprofiler_config_interfaces.cmake | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/therock-ci-linux.yml b/.github/workflows/therock-ci-linux.yml index eed78f6e31..8e0122885a 100644 --- a/.github/workflows/therock-ci-linux.yml +++ b/.github/workflows/therock-ci-linux.yml @@ -66,6 +66,7 @@ jobs: run: | # Remove patches here if they cannot be applied cleanly, and they have not been deleted from TheRock repo # rm ./TheRock/patches/amd-mainline/rocm-systems/*.patch + rm ./TheRock/patches/amd-mainline/rocm-systems/0008-Find-bundled-libelf.patch ./TheRock/build_tools/fetch_sources.py --jobs 12 --no-include-rocm-systems --no-include-rocm-libraries --no-include-ml-frameworks diff --git a/.github/workflows/therock-ci-windows.yml b/.github/workflows/therock-ci-windows.yml index 7f9f4ada5a..072bfa5bd6 100644 --- a/.github/workflows/therock-ci-windows.yml +++ b/.github/workflows/therock-ci-windows.yml @@ -54,6 +54,7 @@ jobs: run: | # Remove patches here if they cannot be applied cleanly, and they have not been deleted from TheRock repo # rm ./TheRock/patches/amd-mainline/rocm-systems/*.patch + rm ./TheRock/patches/amd-mainline/rocm-systems/0008-Find-bundled-libelf.patch git -c user.name="therockbot" -c "user.email=therockbot@amd.com" am --whitespace=nowarn ./TheRock/patches/amd-mainline/rocm-systems/*.patch - name: Install requirements diff --git a/projects/rocprofiler-sdk/cmake/rocprofiler_config_interfaces.cmake b/projects/rocprofiler-sdk/cmake/rocprofiler_config_interfaces.cmake index 8aadc8dcff..0c9e2cda18 100644 --- a/projects/rocprofiler-sdk/cmake/rocprofiler_config_interfaces.cmake +++ b/projects/rocprofiler-sdk/cmake/rocprofiler_config_interfaces.cmake @@ -198,8 +198,13 @@ target_link_libraries(rocprofiler-sdk-ptl INTERFACE PTL::ptl-static) # # ----------------------------------------------------------------------------------------# -find_package(libelf REQUIRED) -target_link_libraries(rocprofiler-sdk-elf INTERFACE libelf::libelf) +find_package(LibElf) +if(LibElf_FOUND) + target_link_libraries(rocprofiler-sdk-elf INTERFACE elf::elf) +else() + find_package(libelf REQUIRED) + target_link_libraries(rocprofiler-sdk-elf INTERFACE libelf::libelf) +endif() # ----------------------------------------------------------------------------------------# #