From 66465c3954eb477262dc95c874a813491bb25ce6 Mon Sep 17 00:00:00 2001 From: "Cheruvally, Aravindan" Date: Wed, 22 Jan 2025 12:19:47 -0500 Subject: [PATCH] Enhance CMAKE install instructions with std install location/destination (#85) * Enhancement - usage of package name flags commonly across for getting unique folder name * Enhancements - updating libexec/pkg usage, avoid sbin * CMAKE Format Update * Python Format Update * Revert "Enhancement - usage of package name flags commonly across for getting unique folder name" This reverts commit 2dcd1ac5f22ab90112d90648e4b5dab5c54bc639. * REview Comments - Revert PACKAGE_NAME usage * Review Comments - Update source folders accordingly to new cmake install locations [ROCm/rocprofiler-sdk commit: 6bb60bf93050a47c52bef74178a61e23fab1eb74] --- .../rocprofiler-sdk-custom-compilation.cmake | 2 +- projects/rocprofiler-sdk/source/CMakeLists.txt | 1 - projects/rocprofiler-sdk/source/bin/rocprofv3.py | 4 +++- .../source/libexec/CMakeLists.txt | 2 +- .../libexec/rocprofiler-sdk/CMakeLists.txt | 6 ++++++ .../rocprofiler-avail/CMakeLists.txt | 5 +++-- .../rocprofiler-avail/rocprofv3_avail.cpp | 0 .../CMakeLists.txt | 16 ++++++++++++++++ .../rocprofiler-sdk-launch-compiler.sh | 0 .../rocprofiler-sdk/source/sbin/CMakeLists.txt | 15 --------------- 10 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/CMakeLists.txt rename projects/rocprofiler-sdk/source/libexec/{ => rocprofiler-sdk}/rocprofiler-avail/CMakeLists.txt (81%) rename projects/rocprofiler-sdk/source/libexec/{ => rocprofiler-sdk}/rocprofiler-avail/rocprofv3_avail.cpp (100%) create mode 100644 projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/CMakeLists.txt rename projects/rocprofiler-sdk/source/{sbin => libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler}/rocprofiler-sdk-launch-compiler.sh (100%) delete mode 100644 projects/rocprofiler-sdk/source/sbin/CMakeLists.txt diff --git a/projects/rocprofiler-sdk/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake b/projects/rocprofiler-sdk/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake index a403587241..c66f90d758 100644 --- a/projects/rocprofiler-sdk/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake +++ b/projects/rocprofiler-sdk/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/projects/rocprofiler-sdk/source/CMakeLists.txt b/projects/rocprofiler-sdk/source/CMakeLists.txt index f6abaab497..4b945f28e7 100644 --- a/projects/rocprofiler-sdk/source/CMakeLists.txt +++ b/projects/rocprofiler-sdk/source/CMakeLists.txt @@ -9,5 +9,4 @@ add_subdirectory(include) add_subdirectory(lib) add_subdirectory(libexec) add_subdirectory(bin) -add_subdirectory(sbin) add_subdirectory(docs) diff --git a/projects/rocprofiler-sdk/source/bin/rocprofv3.py b/projects/rocprofiler-sdk/source/bin/rocprofv3.py index 34dcc8f1e0..a9203d6584 100755 --- a/projects/rocprofiler-sdk/source/bin/rocprofv3.py +++ b/projects/rocprofiler-sdk/source/bin/rocprofv3.py @@ -703,7 +703,9 @@ def run(app_args, args, **kwargs): 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/projects/rocprofiler-sdk/source/libexec/CMakeLists.txt b/projects/rocprofiler-sdk/source/libexec/CMakeLists.txt index c4edd0db0f..9bfe2269d0 100644 --- a/projects/rocprofiler-sdk/source/libexec/CMakeLists.txt +++ b/projects/rocprofiler-sdk/source/libexec/CMakeLists.txt @@ -2,4 +2,4 @@ # # -add_subdirectory(rocprofiler-avail) +add_subdirectory(rocprofiler-sdk) diff --git a/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/CMakeLists.txt b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/CMakeLists.txt new file mode 100644 index 0000000000..2ad7b2e346 --- /dev/null +++ b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/CMakeLists.txt @@ -0,0 +1,6 @@ +# +# +# + +add_subdirectory(rocprofiler-avail) +add_subdirectory(rocprofiler-sdk-launch-compiler) diff --git a/projects/rocprofiler-sdk/source/libexec/rocprofiler-avail/CMakeLists.txt b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-avail/CMakeLists.txt similarity index 81% rename from projects/rocprofiler-sdk/source/libexec/rocprofiler-avail/CMakeLists.txt rename to projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-avail/CMakeLists.txt index fd6e9b3110..965581dff8 100644 --- a/projects/rocprofiler-sdk/source/libexec/rocprofiler-avail/CMakeLists.txt +++ b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-avail/CMakeLists.txt @@ -13,7 +13,8 @@ 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}/rocprofiler-sdk SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION} BUILD_RPATH "\$ORIGIN:\$ORIGIN/.." @@ -21,6 +22,6 @@ set_target_properties( install( TARGETS rocprofv3-list-avail - DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/rocprofiler-sdk COMPONENT tools EXPORT rocprofiler-sdk-tool-targets) diff --git a/projects/rocprofiler-sdk/source/libexec/rocprofiler-avail/rocprofv3_avail.cpp b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-avail/rocprofv3_avail.cpp similarity index 100% rename from projects/rocprofiler-sdk/source/libexec/rocprofiler-avail/rocprofv3_avail.cpp rename to projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-avail/rocprofv3_avail.cpp diff --git a/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/CMakeLists.txt b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/CMakeLists.txt new file mode 100644 index 0000000000..566a1279bf --- /dev/null +++ b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# +# + +configure_file( + rocprofiler-sdk-launch-compiler.sh + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR}/rocprofiler-sdk/rocprofiler-sdk-launch-compiler + COPYONLY) + +install( + FILES + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR}/rocprofiler-sdk/rocprofiler-sdk-launch-compiler + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/rocprofiler-sdk + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ + WORLD_EXECUTE + COMPONENT tools) diff --git a/projects/rocprofiler-sdk/source/sbin/rocprofiler-sdk-launch-compiler.sh b/projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/rocprofiler-sdk-launch-compiler.sh similarity index 100% rename from projects/rocprofiler-sdk/source/sbin/rocprofiler-sdk-launch-compiler.sh rename to projects/rocprofiler-sdk/source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/rocprofiler-sdk-launch-compiler.sh diff --git a/projects/rocprofiler-sdk/source/sbin/CMakeLists.txt b/projects/rocprofiler-sdk/source/sbin/CMakeLists.txt deleted file mode 100644 index 1e214276d8..0000000000 --- a/projects/rocprofiler-sdk/source/sbin/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# -# -# - -configure_file( - rocprofiler-sdk-launch-compiler.sh - ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_SBINDIR}/rocprofiler-sdk-launch-compiler - COPYONLY) - -install( - FILES ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_SBINDIR}/rocprofiler-sdk-launch-compiler - DESTINATION ${CMAKE_INSTALL_SBINDIR} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ - WORLD_EXECUTE - COMPONENT tools)