From 0555ae177434640744f335fc8a48ec020be70549 Mon Sep 17 00:00:00 2001 From: AravindanC Date: Tue, 17 Dec 2024 07:23:40 -0800 Subject: [PATCH 1/2] Enhancement using package name flags for getting unique folder name for the package --- source/include/rocprofiler-sdk-roctx/CMakeLists.txt | 2 +- source/include/rocprofiler-sdk/CMakeLists.txt | 2 +- .../include/rocprofiler-sdk/amd_detail/CMakeLists.txt | 2 +- source/include/rocprofiler-sdk/cxx/CMakeLists.txt | 2 +- .../include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt | 2 +- .../include/rocprofiler-sdk/cxx/details/CMakeLists.txt | 2 +- .../rocprofiler-sdk/experimental/CMakeLists.txt | 2 +- source/include/rocprofiler-sdk/hip/CMakeLists.txt | 2 +- source/include/rocprofiler-sdk/hsa/CMakeLists.txt | 2 +- source/include/rocprofiler-sdk/kfd/CMakeLists.txt | 2 +- source/include/rocprofiler-sdk/marker/CMakeLists.txt | 2 +- source/include/rocprofiler-sdk/rccl/CMakeLists.txt | 2 +- .../rocprofiler-sdk/rccl/details/CMakeLists.txt | 2 +- source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt | 4 ++-- source/lib/rocprofiler-sdk/counters/xml/CMakeLists.txt | 10 +++++----- .../lib/rocprofiler-sdk/counters/yaml/CMakeLists.txt | 6 +++--- 16 files changed, 23 insertions(+), 23 deletions(-) diff --git a/source/include/rocprofiler-sdk-roctx/CMakeLists.txt b/source/include/rocprofiler-sdk-roctx/CMakeLists.txt index 7a5caa2d..028ccaaa 100644 --- a/source/include/rocprofiler-sdk-roctx/CMakeLists.txt +++ b/source/include/rocprofiler-sdk-roctx/CMakeLists.txt @@ -14,5 +14,5 @@ set(ROCTX_HEADER_FILES install( FILES ${ROCTX_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk-roctx + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}-roctx COMPONENT roctx) diff --git a/source/include/rocprofiler-sdk/CMakeLists.txt b/source/include/rocprofiler-sdk/CMakeLists.txt index 45431b81..b3ea76d1 100644 --- a/source/include/rocprofiler-sdk/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/CMakeLists.txt @@ -36,7 +36,7 @@ set(ROCPROFILER_HEADER_FILES install( FILES ${ROCPROFILER_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME} COMPONENT development) add_subdirectory(hip) diff --git a/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt b/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt index 8d00d134..e9ce42b6 100644 --- a/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/amd_detail/CMakeLists.txt @@ -8,5 +8,5 @@ set(ROCPROFILER_AMD_DETAIL_HEADER_FILES thread_trace.h thread_trace_core.h install( FILES ${ROCPROFILER_AMD_DETAIL_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/amd_detail/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/amd_detail/ COMPONENT development) diff --git a/source/include/rocprofiler-sdk/cxx/CMakeLists.txt b/source/include/rocprofiler-sdk/cxx/CMakeLists.txt index bacc4678..4a584c38 100644 --- a/source/include/rocprofiler-sdk/cxx/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/cxx/CMakeLists.txt @@ -8,7 +8,7 @@ set(ROCPROFILER_CXX_HEADER_FILES hash.hpp name_info.hpp operators.hpp perfetto.h install( FILES ${ROCPROFILER_CXX_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/cxx + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/cxx COMPONENT development) add_subdirectory(codeobj) diff --git a/source/include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt b/source/include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt index 96473009..a76575d1 100644 --- a/source/include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/cxx/codeobj/CMakeLists.txt @@ -2,5 +2,5 @@ set(ROCPROFILER_CXX_CODEOBJ_HEADERS code_printing.hpp disassembly.hpp segment.hp install( FILES ${ROCPROFILER_CXX_CODEOBJ_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/cxx/codeobj + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/cxx/codeobj COMPONENT development) diff --git a/source/include/rocprofiler-sdk/cxx/details/CMakeLists.txt b/source/include/rocprofiler-sdk/cxx/details/CMakeLists.txt index a97f70e0..6d18b729 100644 --- a/source/include/rocprofiler-sdk/cxx/details/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/cxx/details/CMakeLists.txt @@ -7,5 +7,5 @@ set(ROCPROFILER_CXX_DETAILS_HEADER_FILES tokenize.hpp join.hpp mpl.hpp name_info install( FILES ${ROCPROFILER_CXX_DETAILS_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/cxx/details + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/cxx/details COMPONENT development) diff --git a/source/include/rocprofiler-sdk/experimental/CMakeLists.txt b/source/include/rocprofiler-sdk/experimental/CMakeLists.txt index eafdfca0..bb33cb9b 100644 --- a/source/include/rocprofiler-sdk/experimental/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/experimental/CMakeLists.txt @@ -2,5 +2,5 @@ set(ROCPROFILER_EXPERIMENTAL_HEADER_FILES counters.h) install( FILES ${ROCPROFILER_EXPERIMENTAL_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/experimental + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/experimental COMPONENT development) diff --git a/source/include/rocprofiler-sdk/hip/CMakeLists.txt b/source/include/rocprofiler-sdk/hip/CMakeLists.txt index a9578e00..84206dbe 100644 --- a/source/include/rocprofiler-sdk/hip/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/hip/CMakeLists.txt @@ -8,5 +8,5 @@ set(ROCPROFILER_HIP_HEADER_FILES api_args.h api_id.h compiler_api_id.h runtime_a install( FILES ${ROCPROFILER_HIP_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/hip + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/hip COMPONENT development) diff --git a/source/include/rocprofiler-sdk/hsa/CMakeLists.txt b/source/include/rocprofiler-sdk/hsa/CMakeLists.txt index f4229b96..f0158683 100644 --- a/source/include/rocprofiler-sdk/hsa/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/hsa/CMakeLists.txt @@ -17,5 +17,5 @@ set(ROCPROFILER_HSA_HEADER_FILES install( FILES ${ROCPROFILER_HSA_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/hsa + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/hsa COMPONENT development) diff --git a/source/include/rocprofiler-sdk/kfd/CMakeLists.txt b/source/include/rocprofiler-sdk/kfd/CMakeLists.txt index 2a631112..092fb960 100644 --- a/source/include/rocprofiler-sdk/kfd/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/kfd/CMakeLists.txt @@ -7,5 +7,5 @@ set(ROCPROFILER_KFD_HEADER_FILES page_migration_args.h page_migration_id.h) install( FILES ${ROCPROFILER_KFD_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/kfd + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/kfd COMPONENT development) diff --git a/source/include/rocprofiler-sdk/marker/CMakeLists.txt b/source/include/rocprofiler-sdk/marker/CMakeLists.txt index 15209faa..0f195c5b 100644 --- a/source/include/rocprofiler-sdk/marker/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/marker/CMakeLists.txt @@ -7,5 +7,5 @@ set(ROCPROFILER_MARKER_HEADER_FILES api_args.h api_id.h table_id.h) install( FILES ${ROCPROFILER_MARKER_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/marker + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/marker COMPONENT development) diff --git a/source/include/rocprofiler-sdk/rccl/CMakeLists.txt b/source/include/rocprofiler-sdk/rccl/CMakeLists.txt index 5ac407e7..a7787ee5 100644 --- a/source/include/rocprofiler-sdk/rccl/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/rccl/CMakeLists.txt @@ -7,7 +7,7 @@ set(ROCPROFILER_RCCL_HEADER_FILES api_args.h api_id.h table_id.h) install( FILES ${ROCPROFILER_RCCL_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/rccl + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/rccl COMPONENT development) add_subdirectory(details) diff --git a/source/include/rocprofiler-sdk/rccl/details/CMakeLists.txt b/source/include/rocprofiler-sdk/rccl/details/CMakeLists.txt index 68deec27..a35b5660 100644 --- a/source/include/rocprofiler-sdk/rccl/details/CMakeLists.txt +++ b/source/include/rocprofiler-sdk/rccl/details/CMakeLists.txt @@ -7,5 +7,5 @@ set(ROCPROFILER_RCCL_DETAILS_HEADER_FILES api_trace.h rccl.h) install( FILES ${ROCPROFILER_RCCL_DETAILS_HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/rccl/details + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}/rccl/details COMPONENT development) diff --git a/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt b/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt index aa95127b..b76e9d2e 100644 --- a/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt @@ -20,7 +20,7 @@ target_link_libraries( set_target_properties( rocprofiler-sdk-tool-kokkosp PROPERTIES LIBRARY_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/rocprofiler-sdk + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME} SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION} SKIP_BUILD_RPATH OFF @@ -29,6 +29,6 @@ set_target_properties( install( TARGETS rocprofiler-sdk-tool-kokkosp - DESTINATION ${CMAKE_INSTALL_LIBDIR}/rocprofiler-sdk + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME} COMPONENT tools EXPORT rocprofiler-sdk-tool-targets) diff --git a/source/lib/rocprofiler-sdk/counters/xml/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/xml/CMakeLists.txt index 4503aa17..780e77b4 100644 --- a/source/lib/rocprofiler-sdk/counters/xml/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/counters/xml/CMakeLists.txt @@ -1,10 +1,10 @@ configure_file(basic_counters.xml - ${PROJECT_BINARY_DIR}/share/rocprofiler-sdk/basic_counters.xml COPYONLY) + ${PROJECT_BINARY_DIR}/share/${PACKAGE_NAME}/basic_counters.xml COPYONLY) configure_file(derived_counters.xml - ${PROJECT_BINARY_DIR}/share/rocprofiler-sdk/derived_counters.xml COPYONLY) + ${PROJECT_BINARY_DIR}/share/${PACKAGE_NAME}/derived_counters.xml COPYONLY) install( - FILES ${PROJECT_BINARY_DIR}/share/rocprofiler-sdk/basic_counters.xml - ${PROJECT_BINARY_DIR}/share/rocprofiler-sdk/derived_counters.xml - DESTINATION share/rocprofiler-sdk + FILES ${PROJECT_BINARY_DIR}/share/${PACKAGE_NAME}/basic_counters.xml + ${PROJECT_BINARY_DIR}/share/${PACKAGE_NAME}/derived_counters.xml + DESTINATION share/${PACKAGE_NAME} COMPONENT core) diff --git a/source/lib/rocprofiler-sdk/counters/yaml/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/yaml/CMakeLists.txt index 312d825d..a3304082 100644 --- a/source/lib/rocprofiler-sdk/counters/yaml/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/counters/yaml/CMakeLists.txt @@ -1,6 +1,6 @@ configure_file(counter_defs.yaml - ${PROJECT_BINARY_DIR}/share/rocprofiler-sdk/counter_defs.yaml COPYONLY) + ${PROJECT_BINARY_DIR}/share/${PACKAGE_NAME}/counter_defs.yaml COPYONLY) install( - FILES ${PROJECT_BINARY_DIR}/share/rocprofiler-sdk/counter_defs.yaml - DESTINATION share/rocprofiler-sdk + FILES ${PROJECT_BINARY_DIR}/share/${PACKAGE_NAME}/counter_defs.yaml + DESTINATION share/${PACKAGE_NAME} COMPONENT core) From d3669e1022c62e5319e4ae6221b87dd5d87d1851 Mon Sep 17 00:00:00 2001 From: AravindanC Date: Tue, 17 Dec 2024 07:39:56 -0800 Subject: [PATCH 2/2] Enhancements for updating sbin to libexec usage --- cmake/Modules/rocprofiler-sdk-custom-compilation.cmake | 2 +- source/bin/rocprofv3.py | 2 +- source/lib/rocprofiler-sdk-tool/CMakeLists.txt | 4 ++-- source/libexec/rocprofiler-avail/CMakeLists.txt | 4 ++-- source/sbin/CMakeLists.txt | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake b/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake index a4035872..c66f90d7 100644 --- a/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake +++ b/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake @@ -23,7 +23,7 @@ function(rocprofiler_sdk_custom_compilation) NAMES rocprofiler-sdk-launch-compiler HINTS ${rocprofiler-sdk_ROOT_DIR} ${PROJECT_BINARY_DIR} ${CMAKE_BINARY_DIR} PATHS ${rocprofiler-sdk_ROOT_DIR} ${PROJECT_BINARY_DIR} ${CMAKE_BINARY_DIR} - PATH_SUFFIXES sbin) + PATH_SUFFIXES libexec/rocprofiler-sdk) if(NOT COMP_COMPILER) message( diff --git a/source/bin/rocprofv3.py b/source/bin/rocprofv3.py index cd7f4f5c..51490c23 100755 --- a/source/bin/rocprofv3.py +++ b/source/bin/rocprofv3.py @@ -699,7 +699,7 @@ def _write_env_value(): ROCPROF_KOKKOSP_LIBRARY = ( f"{ROCM_DIR}/lib/rocprofiler-sdk/librocprofiler-sdk-tool-kokkosp.so" ) - ROCPROF_LIST_AVAIL_TOOL_LIBRARY = f"{ROCM_DIR}/libexec/librocprofv3-list-avail.so" + ROCPROF_LIST_AVAIL_TOOL_LIBRARY = f"{ROCM_DIR}/libexec/rocprofiler-sdk/librocprofv3-list-avail.so" prepend_preload = [itr for itr in args.preload if itr] append_preload = [ diff --git a/source/lib/rocprofiler-sdk-tool/CMakeLists.txt b/source/lib/rocprofiler-sdk-tool/CMakeLists.txt index 264eb310..cb5aa292 100644 --- a/source/lib/rocprofiler-sdk-tool/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk-tool/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries( set_target_properties( rocprofiler-sdk-tool PROPERTIES LIBRARY_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/rocprofiler-sdk + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME} SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION} BUILD_RPATH "\$ORIGIN:\$ORIGIN/.." @@ -36,7 +36,7 @@ set_target_properties( install( TARGETS rocprofiler-sdk-tool - DESTINATION ${CMAKE_INSTALL_LIBDIR}/rocprofiler-sdk + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME} COMPONENT tools EXPORT rocprofiler-sdk-tool-targets) diff --git a/source/libexec/rocprofiler-avail/CMakeLists.txt b/source/libexec/rocprofiler-avail/CMakeLists.txt index fd6e9b31..15055620 100644 --- a/source/libexec/rocprofiler-avail/CMakeLists.txt +++ b/source/libexec/rocprofiler-avail/CMakeLists.txt @@ -13,7 +13,7 @@ target_link_libraries( set_target_properties( rocprofv3-list-avail - PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR} + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR}/${PACKAGE_NAME} SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION} BUILD_RPATH "\$ORIGIN:\$ORIGIN/.." @@ -21,6 +21,6 @@ set_target_properties( install( TARGETS rocprofv3-list-avail - DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/${PACKAGE_NAME} COMPONENT tools EXPORT rocprofiler-sdk-tool-targets) diff --git a/source/sbin/CMakeLists.txt b/source/sbin/CMakeLists.txt index 1e214276..a3cdd46e 100644 --- a/source/sbin/CMakeLists.txt +++ b/source/sbin/CMakeLists.txt @@ -4,12 +4,12 @@ configure_file( rocprofiler-sdk-launch-compiler.sh - ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_SBINDIR}/rocprofiler-sdk-launch-compiler + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR}/${PACKAGE_NAME}/rocprofiler-sdk-launch-compiler COPYONLY) install( - FILES ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_SBINDIR}/rocprofiler-sdk-launch-compiler - DESTINATION ${CMAKE_INSTALL_SBINDIR} + FILES ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR}/${PACKAGE_NAME}/rocprofiler-sdk-launch-compiler + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/${PACKAGE_NAME} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT tools)