From 74facf87a6a0cb2e3efe6b927c4ae5c7e1a97277 Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Fri, 25 Oct 2024 11:17:34 -0500 Subject: [PATCH] CMake: Consistently name CMake Targets (#1082) * Change all rocprofiler-X target names to rocprofiler-sdk-X * Update rocprofiler-sdk-config.cmake - fix install tree target names - simplify logic for using find w/ components and find w/o components * Update rocprofiler-sdk-roctx-config.cmake - simplify logic for using find w/ components and find w/o components * Update samples/intercept_table/CMakeLists.txt - demonstrate/test use of `find_package(rocprofiler-sdk ... COMPONENTS ...)` --- .../rocprofiler-sdk-roctx/config.cmake.in | 14 +-- .../rocprofiler-sdk/build-config.cmake.in | 4 +- .../Templates/rocprofiler-sdk/config.cmake.in | 16 ++- cmake/rocprofiler_build_settings.cmake | 77 ++++++------- cmake/rocprofiler_config_install_roctx.cmake | 6 +- cmake/rocprofiler_config_interfaces.cmake | 58 +++++----- cmake/rocprofiler_interfaces.cmake | 88 +++++++------- cmake/rocprofiler_memcheck.cmake | 6 +- external/CMakeLists.txt | 50 ++++---- samples/common/CMakeLists.txt | 27 ++--- samples/intercept_table/CMakeLists.txt | 5 +- source/lib/common/CMakeLists.txt | 41 +++---- source/lib/common/container/CMakeLists.txt | 4 +- source/lib/common/memory/CMakeLists.txt | 2 +- .../rocprofiler-sdk-codeobj/CMakeLists.txt | 4 +- .../tests/CMakeLists.txt | 10 +- .../lib/rocprofiler-sdk-roctx/CMakeLists.txt | 8 +- .../lib/rocprofiler-sdk-tool/CMakeLists.txt | 16 +-- .../kokkosp/CMakeLists.txt | 5 +- source/lib/rocprofiler-sdk/CMakeLists.txt | 107 +++++++++--------- source/lib/rocprofiler-sdk/aql/CMakeLists.txt | 4 +- .../rocprofiler-sdk/aql/tests/CMakeLists.txt | 10 +- .../code_object/CMakeLists.txt | 5 +- .../code_object/hip/CMakeLists.txt | 4 +- .../code_object/hsa/CMakeLists.txt | 4 +- .../rocprofiler-sdk/context/CMakeLists.txt | 4 +- .../rocprofiler-sdk/counters/CMakeLists.txt | 4 +- .../counters/parser/CMakeLists.txt | 23 ++-- .../counters/parser/tests/CMakeLists.txt | 5 +- .../counters/tests/CMakeLists.txt | 15 +-- .../rocprofiler-sdk/details/CMakeLists.txt | 4 +- source/lib/rocprofiler-sdk/hip/CMakeLists.txt | 4 +- .../hip/details/CMakeLists.txt | 5 +- source/lib/rocprofiler-sdk/hsa/CMakeLists.txt | 4 +- .../hsa/details/CMakeLists.txt | 5 +- .../kernel_dispatch/CMakeLists.txt | 4 +- .../lib/rocprofiler-sdk/marker/CMakeLists.txt | 4 +- .../page_migration/CMakeLists.txt | 4 +- .../pc_sampling/CMakeLists.txt | 4 +- .../pc_sampling/ioctl/CMakeLists.txt | 4 +- .../pc_sampling/parser/CMakeLists.txt | 4 +- .../pc_sampling/parser/tests/CMakeLists.txt | 20 ++-- .../pc_sampling/tests/CMakeLists.txt | 5 +- .../lib/rocprofiler-sdk/rccl/CMakeLists.txt | 4 +- .../lib/rocprofiler-sdk/tests/CMakeLists.txt | 39 +++---- .../thread_trace/CMakeLists.txt | 5 +- .../thread_trace/tests/CMakeLists.txt | 10 +- .../rocprofiler-sdk/tracing/CMakeLists.txt | 4 +- source/lib/tests/buffering/CMakeLists.txt | 5 +- source/lib/tests/common/CMakeLists.txt | 5 +- .../CMakeLists.txt | 2 +- tests/async-copy-tracing/CMakeLists.txt | 2 +- tests/c-tool/CMakeLists.txt | 4 +- tests/common/CMakeLists.txt | 62 +++++----- tests/hip-graph-tracing/CMakeLists.txt | 2 +- tests/kernel-tracing/CMakeLists.txt | 2 +- tests/page-migration/CMakeLists.txt | 2 +- tests/scratch-memory-tracing/CMakeLists.txt | 2 +- tests/tools/CMakeLists.txt | 2 +- 59 files changed, 441 insertions(+), 408 deletions(-) diff --git a/cmake/Templates/rocprofiler-sdk-roctx/config.cmake.in b/cmake/Templates/rocprofiler-sdk-roctx/config.cmake.in index f5b998a0..f12f3647 100644 --- a/cmake/Templates/rocprofiler-sdk-roctx/config.cmake.in +++ b/cmake/Templates/rocprofiler-sdk-roctx/config.cmake.in @@ -43,14 +43,6 @@ else() include("${@PACKAGE_NAME@_CMAKE_DIR}/@PACKAGE_NAME@-targets.cmake") # Library dependencies - foreach(TARG @PROJECT_BUILD_TARGETS@) - set(TARG @PACKAGE_NAME@::${TARG}) - if(NOT @PACKAGE_NAME@_FIND_COMPONENTS) - list(APPEND @PACKAGE_NAME@_LIBRARIES ${TARG}) - target_link_libraries(@PACKAGE_NAME@::@PACKAGE_NAME@ INTERFACE ${TARG}) - endif() - endforeach() - if(@PACKAGE_NAME@_FIND_COMPONENTS) foreach(COMP ${@PACKAGE_NAME@_FIND_COMPONENTS}) set(TARG @PACKAGE_NAME@::@PACKAGE_NAME@-${COMP}) @@ -62,6 +54,12 @@ else() set(@PACKAGE_NAME@_${COMP}_FOUND 0) endif() endforeach() + else() + foreach(TARG @PROJECT_BUILD_TARGETS@) + set(TARG @PACKAGE_NAME@::${TARG}) + list(APPEND @PACKAGE_NAME@_LIBRARIES ${TARG}) + target_link_libraries(@PACKAGE_NAME@::@PACKAGE_NAME@ INTERFACE ${TARG}) + endforeach() endif() endif() diff --git a/cmake/Templates/rocprofiler-sdk/build-config.cmake.in b/cmake/Templates/rocprofiler-sdk/build-config.cmake.in index 04bd06a5..16a07804 100644 --- a/cmake/Templates/rocprofiler-sdk/build-config.cmake.in +++ b/cmake/Templates/rocprofiler-sdk/build-config.cmake.in @@ -3,7 +3,7 @@ if(@PACKAGE_NAME@_FIND_COMPONENTS) foreach(COMP ${@PACKAGE_NAME@_FIND_COMPONENTS}) - set(TARG @PACKAGE_NAME@::@PROJECT_NAME@-${COMP}) + set(TARG @PACKAGE_NAME@::@PACKAGE_NAME@-${COMP}) if(TARGET ${TARG}) set(@PACKAGE_NAME@_${COMP}_FOUND 1) list(APPEND @PACKAGE_NAME@_LIBRARIES ${TARG}) @@ -17,7 +17,7 @@ else() endif() foreach(COMP @PROJECT_BUILD_TREE_TARGETS@) - set(TARG @PACKAGE_NAME@::@PROJECT_NAME@-${COMP}) + set(TARG @PACKAGE_NAME@::@PACKAGE_NAME@-${COMP}) if(TARGET ${TARG}) list(APPEND @PACKAGE_NAME@_LIBRARIES ${TARG}) target_link_libraries(@PACKAGE_NAME@::@PACKAGE_NAME@ INTERFACE ${TARG}) diff --git a/cmake/Templates/rocprofiler-sdk/config.cmake.in b/cmake/Templates/rocprofiler-sdk/config.cmake.in index 49178408..c69e6774 100644 --- a/cmake/Templates/rocprofiler-sdk/config.cmake.in +++ b/cmake/Templates/rocprofiler-sdk/config.cmake.in @@ -110,17 +110,9 @@ else() @PROJECT_NAME@_config_nolink_target(@PACKAGE_NAME@::@PACKAGE_NAME@-external-nolink amd_comgr) # Library dependencies - foreach(TARG @PROJECT_BUILD_TARGETS@) - set(TARG @PACKAGE_NAME@::@PROJECT_NAME@-${TARG}) - if(NOT @PACKAGE_NAME@_FIND_COMPONENTS) - list(APPEND @PACKAGE_NAME@_LIBRARIES ${TARG}) - target_link_libraries(@PACKAGE_NAME@::@PACKAGE_NAME@ INTERFACE ${TARG}) - endif() - endforeach() - if(@PACKAGE_NAME@_FIND_COMPONENTS) foreach(COMP ${@PACKAGE_NAME@_FIND_COMPONENTS}) - set(TARG @PACKAGE_NAME@::${COMP}) + set(TARG @PACKAGE_NAME@::@PACKAGE_NAME@-${COMP}) if(TARGET ${TARG}) set(@PACKAGE_NAME@_${COMP}_FOUND 1) list(APPEND @PACKAGE_NAME@_LIBRARIES ${TARG}) @@ -129,6 +121,12 @@ else() set(@PACKAGE_NAME@_${COMP}_FOUND 0) endif() endforeach() + else() + foreach(TARG @PROJECT_BUILD_TARGETS@) + set(TARG @PACKAGE_NAME@::@PACKAGE_NAME@-${TARG}) + list(APPEND @PACKAGE_NAME@_LIBRARIES ${TARG}) + target_link_libraries(@PACKAGE_NAME@::@PACKAGE_NAME@ INTERFACE ${TARG}) + endforeach() endif() target_link_libraries(@PACKAGE_NAME@::@PACKAGE_NAME@ diff --git a/cmake/rocprofiler_build_settings.cmake b/cmake/rocprofiler_build_settings.cmake index 890bd1be..2ee13314 100644 --- a/cmake/rocprofiler_build_settings.cmake +++ b/cmake/rocprofiler_build_settings.cmake @@ -11,15 +11,15 @@ include(FindPackageHandleStandardArgs) include(rocprofiler_compilers) include(rocprofiler_utilities) -target_compile_definitions(rocprofiler-build-flags INTERFACE $<$:DEBUG>) +target_compile_definitions(rocprofiler-sdk-build-flags INTERFACE $<$:DEBUG>) if(ROCPROFILER_BUILD_CI) - rocprofiler_target_compile_definitions(rocprofiler-build-flags + rocprofiler_target_compile_definitions(rocprofiler-sdk-build-flags INTERFACE ROCPROFILER_CI) endif() if(ROCPROFILER_BUILD_CODECOV) - target_link_libraries(rocprofiler-build-flags INTERFACE gcov) + target_link_libraries(rocprofiler-sdk-build-flags INTERFACE gcov) endif() # ----------------------------------------------------------------------------------------# @@ -38,32 +38,33 @@ foreach(_TYPE dl rt) find_package_handle_standard_args(${_TYPE}-library REQUIRED_VARS ${_TYPE}_LIBRARY) if(${_TYPE}-library_FOUND) string(TOUPPER "${_TYPE}" _TYPE_UC) - rocprofiler_target_compile_definitions(rocprofiler-${_TYPE} + rocprofiler_target_compile_definitions(rocprofiler-sdk-${_TYPE} INTERFACE ROCPROFILER_${_TYPE_UC}=1) - target_link_libraries(rocprofiler-${_TYPE} INTERFACE ${${_TYPE}_LIBRARY}) + target_link_libraries(rocprofiler-sdk-${_TYPE} INTERFACE ${${_TYPE}_LIBRARY}) if("${_TYPE}" STREQUAL "dl" AND NOT ROCPROFILER_ENABLE_CLANG_TIDY) # This instructs the linker to add all symbols, not only used ones, to the # dynamic symbol table. This option is needed for some uses of dlopen or # to allow obtaining backtraces from within a program. rocprofiler_target_compile_options( - rocprofiler-${_TYPE} + rocprofiler-sdk-${_TYPE} LANGUAGES C CXX LINK_LANGUAGES C CXX INTERFACE "-rdynamic") endif() else() - rocprofiler_target_compile_definitions(rocprofiler-${_TYPE} + rocprofiler_target_compile_definitions(rocprofiler-sdk-${_TYPE} INTERFACE ROCPROFILER_${_TYPE_UC}=0) endif() endif() endforeach() -target_link_libraries(rocprofiler-build-flags INTERFACE rocprofiler-sdk::rocprofiler-dl) +target_link_libraries(rocprofiler-sdk-build-flags + INTERFACE rocprofiler-sdk::rocprofiler-sdk-dl) # ----------------------------------------------------------------------------------------# # set the compiler flags # -rocprofiler_target_compile_options(rocprofiler-build-flags +rocprofiler_target_compile_options(rocprofiler-sdk-build-flags INTERFACE "-W" "-Wall" "-Wno-unknown-pragmas") # compiler version specific flags @@ -71,7 +72,7 @@ function(set_compiler_options compiler_id version) if(CMAKE_CXX_COMPILER_ID STREQUAL ${compiler_id} AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL ${version}) rocprofiler_target_compile_options( - rocprofiler-build-flags + rocprofiler-sdk-build-flags INTERFACE "-Wno-error=extra" "-Wno-unused-variable" "-Wno-error=unused-but-set-variable" "-Wno-error=unused-but-set-parameter" "-Wno-error=shadow") @@ -89,37 +90,37 @@ set_compiler_options("Clang" "13.0") # rocprofiler_target_compile_options( - rocprofiler-debug-flags INTERFACE "-g3" "-fno-omit-frame-pointer" - "-fno-optimize-sibling-calls") + rocprofiler-sdk-debug-flags INTERFACE "-g3" "-fno-omit-frame-pointer" + "-fno-optimize-sibling-calls") target_compile_options( - rocprofiler-debug-flags + rocprofiler-sdk-debug-flags INTERFACE $<$:$<$:-rdynamic>> $<$:$<$:-rdynamic>>) if(NOT APPLE AND NOT ROCPROFILER_ENABLE_CLANG_TIDY) - target_link_options(rocprofiler-debug-flags INTERFACE + target_link_options(rocprofiler-sdk-debug-flags INTERFACE $<$:-rdynamic>) endif() if(dl_LIBRARY) - target_link_libraries(rocprofiler-debug-flags INTERFACE ${dl_LIBRARY}) + target_link_libraries(rocprofiler-sdk-debug-flags INTERFACE ${dl_LIBRARY}) endif() if(rt_LIBRARY) - target_link_libraries(rocprofiler-debug-flags INTERFACE ${rt_LIBRARY}) + target_link_libraries(rocprofiler-sdk-debug-flags INTERFACE ${rt_LIBRARY}) endif() if(ROCPROFILER_BUILD_DEBUG) - target_link_libraries(rocprofiler-build-flags - INTERFACE rocprofiler-sdk::rocprofiler-debug-flags) + target_link_libraries(rocprofiler-sdk-build-flags + INTERFACE rocprofiler-sdk::rocprofiler-sdk-debug-flags) endif() # ----------------------------------------------------------------------------------------# # debug-safe optimizations # rocprofiler_target_compile_options( - rocprofiler-build-flags + rocprofiler-sdk-build-flags LANGUAGES CXX INTERFACE "-faligned-new") @@ -127,73 +128,73 @@ rocprofiler_target_compile_options( # fstack-protector # rocprofiler_target_compile_options( - rocprofiler-stack-protector + rocprofiler-sdk-stack-protector LANGUAGES C CXX INTERFACE "-fstack-protector-strong" "-Wstack-protector") if(ROCPROFILER_BUILD_STACK_PROTECTOR) - target_link_libraries(rocprofiler-build-flags - INTERFACE rocprofiler-sdk::rocprofiler-stack-protector) + target_link_libraries(rocprofiler-sdk-build-flags + INTERFACE rocprofiler-sdk::rocprofiler-sdk-stack-protector) endif() # ----------------------------------------------------------------------------------------# # developer build flags # rocprofiler_target_compile_options( - rocprofiler-developer-flags + rocprofiler-sdk-developer-flags LANGUAGES C CXX INTERFACE "-Werror" "-Wdouble-promotion" "-Wshadow" "-Wextra" "-Wvla") if(ROCPROFILER_BUILD_DEVELOPER) - target_link_libraries(rocprofiler-build-flags - INTERFACE rocprofiler-sdk::rocprofiler-developer-flags) + target_link_libraries(rocprofiler-sdk-build-flags + INTERFACE rocprofiler-sdk::rocprofiler-sdk-developer-flags) endif() # ----------------------------------------------------------------------------------------# # release build flags # rocprofiler_target_compile_options( - rocprofiler-release-flags + rocprofiler-sdk-release-flags LANGUAGES C CXX INTERFACE "-g1" "-feliminate-unused-debug-symbols" "-gno-column-info" "-gno-variable-location-views" "-gline-tables-only") if(ROCPROFILER_BUILD_RELEASE) - target_link_libraries(rocprofiler-build-flags - INTERFACE rocprofiler-sdk::rocprofiler-release-flags) + target_link_libraries(rocprofiler-sdk-build-flags + INTERFACE rocprofiler-sdk::rocprofiler-sdk-release-flags) endif() # ----------------------------------------------------------------------------------------# # static lib flags # target_compile_options( - rocprofiler-static-libgcc + rocprofiler-sdk-static-libgcc INTERFACE $<$:$<$:-static-libgcc>> $<$:$<$:-static-libgcc>>) target_link_options( - rocprofiler-static-libgcc INTERFACE + rocprofiler-sdk-static-libgcc INTERFACE $<$:$<$:-static-libgcc>> $<$:$<$:-static-libgcc>>) target_compile_options( - rocprofiler-static-libstdcxx + rocprofiler-sdk-static-libstdcxx INTERFACE $<$:$<$:-static-libstdc++>>) target_link_options( - rocprofiler-static-libstdcxx INTERFACE + rocprofiler-sdk-static-libstdcxx INTERFACE $<$:$<$:-static-libstdc++>>) if(ROCPROFILER_BUILD_STATIC_LIBGCC) - target_link_libraries(rocprofiler-build-flags - INTERFACE rocprofiler-sdk::rocprofiler-static-libgcc) + target_link_libraries(rocprofiler-sdk-build-flags + INTERFACE rocprofiler-sdk::rocprofiler-sdk-static-libgcc) endif() if(ROCPROFILER_BUILD_STATIC_LIBSTDCXX) - target_link_libraries(rocprofiler-build-flags - INTERFACE rocprofiler-sdk::rocprofiler-static-libstdcxx) + target_link_libraries(rocprofiler-sdk-build-flags + INTERFACE rocprofiler-sdk::rocprofiler-sdk-static-libstdcxx) endif() if(ROCPROFILER_UNSAFE_NO_VERSION_CHECK) - rocprofiler_target_compile_definitions(rocprofiler-build-flags + rocprofiler_target_compile_definitions(rocprofiler-sdk-build-flags INTERFACE ROCPROFILER_UNSAFE_NO_VERSION_CHECK) endif() @@ -203,5 +204,5 @@ endif() get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) if(NOT APPLE OR "$ENV{CONDA_PYTHON_EXE}" STREQUAL "") - rocprofiler_target_user_flags(rocprofiler-build-flags "CXX") + rocprofiler_target_user_flags(rocprofiler-sdk-build-flags "CXX") endif() diff --git a/cmake/rocprofiler_config_install_roctx.cmake b/cmake/rocprofiler_config_install_roctx.cmake index 6ed66c82..66340940 100644 --- a/cmake/rocprofiler_config_install_roctx.cmake +++ b/cmake/rocprofiler_config_install_roctx.cmake @@ -59,9 +59,9 @@ set(${PACKAGE_NAME}_BUILD_TREE set(PROJECT_BUILD_TREE_TARGETS ${SDK_PACKAGE_NAME}::${PACKAGE_NAME}-shared-library - ${SDK_PACKAGE_NAME}::${PROJECT_NAME}-headers - ${SDK_PACKAGE_NAME}::${PROJECT_NAME}-build-flags - ${SDK_PACKAGE_NAME}::${PROJECT_NAME}-stack-protector) + ${SDK_PACKAGE_NAME}::${SDK_PACKAGE_NAME}-headers + ${SDK_PACKAGE_NAME}::${SDK_PACKAGE_NAME}-build-flags + ${SDK_PACKAGE_NAME}::${SDK_PACKAGE_NAME}-stack-protector) configure_file( ${PROJECT_SOURCE_DIR}/cmake/Templates/${PACKAGE_NAME}/build-config.cmake.in diff --git a/cmake/rocprofiler_config_interfaces.cmake b/cmake/rocprofiler_config_interfaces.cmake index 2b9fefd8..69637b4d 100644 --- a/cmake/rocprofiler_config_interfaces.cmake +++ b/cmake/rocprofiler_config_interfaces.cmake @@ -10,15 +10,15 @@ include(rocprofiler_config_nolink_target) # ######################################################################################## target_include_directories( - rocprofiler-headers + rocprofiler-sdk-headers INTERFACE $ $ $ $) target_compile_definitions( - rocprofiler-headers INTERFACE $ - $) + rocprofiler-sdk-headers INTERFACE $ + $) # ensure the env overrides the appending /opt/rocm later string(REPLACE ":" ";" CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH};${CMAKE_PREFIX_PATH}") @@ -55,12 +55,12 @@ find_library(pthread_LIBRARY NAMES pthread pthreads) find_package_handle_standard_args(pthread-library REQUIRED_VARS pthread_LIBRARY) if(pthread_LIBRARY) - target_link_libraries(rocprofiler-threading INTERFACE ${pthread_LIBRARY}) + target_link_libraries(rocprofiler-sdk-threading INTERFACE ${pthread_LIBRARY}) else() find_package(Threads ${rocprofiler_FIND_QUIETLY} ${rocprofiler_FIND_REQUIREMENT}) if(Threads_FOUND) - target_link_libraries(rocprofiler-threading INTERFACE Threads::Threads) + target_link_libraries(rocprofiler-sdk-threading INTERFACE Threads::Threads) endif() endif() @@ -75,7 +75,7 @@ foreach(_LIB dl rt) find_package_handle_standard_args(${_LIB}-library REQUIRED_VARS ${_LIB}_LIBRARY) if(${_LIB}_LIBRARY) - target_link_libraries(rocprofiler-threading INTERFACE ${${_LIB}_LIBRARY}) + target_link_libraries(rocprofiler-sdk-threading INTERFACE ${${_LIB}_LIBRARY}) endif() endforeach() @@ -85,7 +85,7 @@ endforeach() # # ----------------------------------------------------------------------------------------# -target_link_libraries(rocprofiler-atomic INTERFACE atomic) +target_link_libraries(rocprofiler-sdk-atomic INTERFACE atomic) # ----------------------------------------------------------------------------------------# # @@ -95,9 +95,9 @@ target_link_libraries(rocprofiler-atomic INTERFACE atomic) if(NOT ROCPROFILER_BUILD_GHC_FS) if(CMAKE_CXX_COMPILER_IS_GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) - target_link_libraries(rocprofiler-cxx-filesystem INTERFACE stdc++fs) + target_link_libraries(rocprofiler-sdk-cxx-filesystem INTERFACE stdc++fs) elseif(CMAKE_CXX_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) - target_link_libraries(rocprofiler-cxx-filesystem INTERFACE c++fs) + target_link_libraries(rocprofiler-sdk-cxx-filesystem INTERFACE c++fs) endif() endif() @@ -126,8 +126,8 @@ find_package( PATHS ${rocm_version_DIR} ${ROCM_PATH}) -target_link_libraries(rocprofiler-hip INTERFACE hip::host) -rocprofiler_config_nolink_target(rocprofiler-hip-nolink hip::host) +target_link_libraries(rocprofiler-sdk-hip INTERFACE hip::host) +rocprofiler_config_nolink_target(rocprofiler-sdk-hip-nolink hip::host) # ----------------------------------------------------------------------------------------# # @@ -153,11 +153,11 @@ string(REPLACE "." ";" HSA_RUNTIME_VERSION "${hsa-runtime64_VERSION}") list(GET HSA_RUNTIME_VERSION 0 HSA_RUNTIME_VERSION_MAJOR) list(GET HSA_RUNTIME_VERSION 1 HSA_RUNTIME_VERSION_MINOR) -target_link_libraries(rocprofiler-hsa-runtime INTERFACE hsa-runtime64::hsa-runtime64) -rocprofiler_config_nolink_target(rocprofiler-hsa-runtime-nolink +target_link_libraries(rocprofiler-sdk-hsa-runtime INTERFACE hsa-runtime64::hsa-runtime64) +rocprofiler_config_nolink_target(rocprofiler-sdk-hsa-runtime-nolink hsa-runtime64::hsa-runtime64) -rocprofiler_parse_hsa_api_table_versions(rocprofiler-hsa-runtime-nolink) +rocprofiler_parse_hsa_api_table_versions(rocprofiler-sdk-hsa-runtime-nolink) # ----------------------------------------------------------------------------------------# # @@ -178,7 +178,7 @@ find_package( PATH_SUFFIXES lib/cmake/amd_comgr) -target_link_libraries(rocprofiler-amd-comgr INTERFACE amd_comgr) +target_link_libraries(rocprofiler-sdk-amd-comgr INTERFACE amd_comgr) # ----------------------------------------------------------------------------------------# # @@ -186,7 +186,7 @@ target_link_libraries(rocprofiler-amd-comgr INTERFACE amd_comgr) # # ----------------------------------------------------------------------------------------# -target_link_libraries(rocprofiler-ptl INTERFACE PTL::ptl-static) +target_link_libraries(rocprofiler-sdk-ptl INTERFACE PTL::ptl-static) # ----------------------------------------------------------------------------------------# # @@ -195,7 +195,7 @@ target_link_libraries(rocprofiler-ptl INTERFACE PTL::ptl-static) # ----------------------------------------------------------------------------------------# find_package(libelf REQUIRED) -target_link_libraries(rocprofiler-elf INTERFACE libelf::libelf) +target_link_libraries(rocprofiler-sdk-elf INTERFACE libelf::libelf) # ----------------------------------------------------------------------------------------# # @@ -204,7 +204,7 @@ target_link_libraries(rocprofiler-elf INTERFACE libelf::libelf) # ----------------------------------------------------------------------------------------# find_package(libdw REQUIRED) -target_link_libraries(rocprofiler-dw INTERFACE libdw::libdw) +target_link_libraries(rocprofiler-sdk-dw INTERFACE libdw::libdw) # ----------------------------------------------------------------------------------------# # @@ -218,7 +218,7 @@ find_library( HINTS ${rocm_version_DIR} ${ROCM_PATH} PATHS ${rocm_version_DIR} ${ROCM_PATH}) -target_link_libraries(rocprofiler-hsa-aql INTERFACE ${hsa-amd-aqlprofile64_library}) +target_link_libraries(rocprofiler-sdk-hsa-aql INTERFACE ${hsa-amd-aqlprofile64_library}) # ----------------------------------------------------------------------------------------# # @@ -239,8 +239,8 @@ find_package( PATH_SUFFIXES lib/cmake/hsakmt) -target_link_libraries(rocprofiler-hsakmt INTERFACE hsakmt::hsakmt) -rocprofiler_config_nolink_target(rocprofiler-hsakmt-nolink hsakmt::hsakmt) +target_link_libraries(rocprofiler-sdk-hsakmt INTERFACE hsakmt::hsakmt) +rocprofiler_config_nolink_target(rocprofiler-sdk-hsakmt-nolink hsakmt::hsakmt) # ----------------------------------------------------------------------------------------# # @@ -274,9 +274,9 @@ find_library( HINTS ${rocm_version_DIR} ${ROCM_PATH} /opt/amdgpu PATHS ${rocm_version_DIR} ${ROCM_PATH} /opt/amdgpu REQUIRED) -target_include_directories(rocprofiler-drm SYSTEM INTERFACE ${drm_INCLUDE_DIR} - ${xf86drm_INCLUDE_DIR}) -target_link_libraries(rocprofiler-drm INTERFACE ${drm_LIBRARY} ${drm_amdgpu_LIBRARY}) +target_include_directories(rocprofiler-sdk-drm SYSTEM INTERFACE ${drm_INCLUDE_DIR} + ${xf86drm_INCLUDE_DIR}) +target_link_libraries(rocprofiler-sdk-drm INTERFACE ${drm_LIBRARY} ${drm_amdgpu_LIBRARY}) # ----------------------------------------------------------------------------------------# # @@ -285,8 +285,8 @@ target_link_libraries(rocprofiler-drm INTERFACE ${drm_LIBRARY} ${drm_amdgpu_LIBR # ----------------------------------------------------------------------------------------# # get_target_property(ELFIO_INCLUDE_DIR elfio::elfio INTERFACE_INCLUDE_DIRECTORIES) -# target_include_directories(rocprofiler-elfio SYSTEM INTERFACE ${ELFIO_INCLUDE_DIR}) -target_link_libraries(rocprofiler-elfio INTERFACE elfio::elfio) +# target_include_directories(rocprofiler-sdk-elfio SYSTEM INTERFACE ${ELFIO_INCLUDE_DIR}) +target_link_libraries(rocprofiler-sdk-elfio INTERFACE elfio::elfio) # ----------------------------------------------------------------------------------------# # @@ -294,7 +294,7 @@ target_link_libraries(rocprofiler-elfio INTERFACE elfio::elfio) # # ----------------------------------------------------------------------------------------# -target_link_libraries(rocprofiler-otf2 INTERFACE otf2::otf2) +target_link_libraries(rocprofiler-sdk-otf2 INTERFACE otf2::otf2) # ----------------------------------------------------------------------------------------# # @@ -318,10 +318,10 @@ if(rccl_FOUND AND rccl_INCLUDE_DIR AND EXISTS "${rccl_INCLUDE_DIR}/rccl/amd_detail/api_trace.h") set(rccl_API_TRACE_FOUND ON) - rocprofiler_config_nolink_target(rocprofiler-rccl-nolink rccl::rccl) + rocprofiler_config_nolink_target(rocprofiler-sdk-rccl-nolink rccl::rccl) else() set(rccl_API_TRACE_FOUND OFF) - target_compile_definitions(rocprofiler-rccl-nolink + target_compile_definitions(rocprofiler-sdk-rccl-nolink INTERFACE ROCPROFILER_SDK_USE_SYSTEM_RCCL=0) endif() diff --git a/cmake/rocprofiler_interfaces.cmake b/cmake/rocprofiler_interfaces.cmake index c07b4881..e954613f 100644 --- a/cmake/rocprofiler_interfaces.cmake +++ b/cmake/rocprofiler_interfaces.cmake @@ -10,77 +10,83 @@ include(rocprofiler_utilities) # interfaces for build flags # rocprofiler_add_interface_library( - rocprofiler-headers + rocprofiler-sdk-headers "Provides minimal set of include flags to compile with rocprofiler") rocprofiler_add_interface_library( - rocprofiler-build-flags "Provides generalized build flags for rocprofiler" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-threading "Enables multithreading support" - INTERNAL) -rocprofiler_add_interface_library(rocprofiler-perfetto "Enables Perfetto support" + rocprofiler-sdk-build-flags "Provides generalized build flags for rocprofiler" + INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-threading + "Enables multithreading support" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-perfetto "Enables Perfetto support" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-otf2 "Enables OTF2 support" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-cereal "Enables Cereal support" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-compile-definitions "Compile definitions" +rocprofiler_add_interface_library(rocprofiler-sdk-otf2 "Enables OTF2 support" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-cereal "Enables Cereal support" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-static-libgcc +rocprofiler_add_interface_library(rocprofiler-sdk-compile-definitions + "Compile definitions" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-static-libgcc "Link to static version of libgcc" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-static-libstdcxx +rocprofiler_add_interface_library(rocprofiler-sdk-static-libstdcxx "Link to static version of libstdc++" INTERNAL) rocprofiler_add_interface_library( - rocprofiler-developer-flags "Compiler flags for developers (more warnings, etc.)" + rocprofiler-sdk-developer-flags "Compiler flags for developers (more warnings, etc.)" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-debug-flags +rocprofiler_add_interface_library(rocprofiler-sdk-debug-flags "Compiler flags for more debug info" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-release-flags +rocprofiler_add_interface_library(rocprofiler-sdk-release-flags "Compiler flags for more debug info" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-stack-protector +rocprofiler_add_interface_library(rocprofiler-sdk-stack-protector "Adds stack-protector compiler flags" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-memcheck INTERFACE INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-memcheck INTERFACE INTERNAL) # # interfaces for libraries (general) # -rocprofiler_add_interface_library(rocprofiler-dl +rocprofiler_add_interface_library(rocprofiler-sdk-dl "Build flags for dynamic linking library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-rt "Build flags for runtime library" +rocprofiler_add_interface_library(rocprofiler-sdk-rt "Build flags for runtime library" + INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-atomic "atomic library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-gtest "Google Test library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-glog "Google Log library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-fmt "C++ format string library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-atomic "atomic library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-gtest "Google Test library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-glog "Google Log library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-fmt "C++ format string library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-cxx-filesystem "C++ filesystem library" +rocprofiler_add_interface_library(rocprofiler-sdk-cxx-filesystem "C++ filesystem library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-ptl "Parallel Tasking Library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-elf "ElfUtils elf library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-dw "ElfUtils dw library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-elfio "ELFIO header-only C++ library" +rocprofiler_add_interface_library(rocprofiler-sdk-ptl "Parallel Tasking Library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-elf "ElfUtils elf library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-dw "ElfUtils dw library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-elfio "ELFIO header-only C++ library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-yaml-cpp "YAML CPP Parser" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-yaml-cpp "YAML CPP Parser" INTERNAL) # # interface for libraries (ROCm-specific) # -rocprofiler_add_interface_library(rocprofiler-hip "HIP library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-hsa-runtime "HSA runtime library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-amd-comgr "AMD comgr library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-hsa-aql "AQL library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-hsakmt "HSAKMT library for AMD KFD support" +rocprofiler_add_interface_library(rocprofiler-sdk-hip "HIP library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-hsa-runtime "HSA runtime library" INTERNAL) -rocprofiler_add_interface_library(rocprofiler-drm "drm (amdgpu) library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-amd-comgr "AMD comgr library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-hsa-aql "AQL library" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-hsakmt + "HSAKMT library for AMD KFD support" INTERNAL) +rocprofiler_add_interface_library(rocprofiler-sdk-drm "drm (amdgpu) library" INTERNAL) # # "nolink" interface targets emulate another interface target but do not link to the -# library. E.g. rocprofiler-hip-nolink has the include directories, compile definitions, -# and compile options of rocprofiler-hip but does not link to the HIP runtime library +# library. E.g. rocprofiler-sdk-hip-nolink has the include directories, compile +# definitions, and compile options of rocprofiler-sdk-hip but does not link to the HIP +# runtime library # rocprofiler_add_interface_library( - rocprofiler-hip-nolink "rocprofiler-hip without linking to HIP library" IMPORTED) + rocprofiler-sdk-hip-nolink "rocprofiler-sdk-hip without linking to HIP library" + IMPORTED) rocprofiler_add_interface_library( - rocprofiler-hsa-runtime-nolink - "rocprofiler-hsa-runtime without linking to HSA library" IMPORTED) + rocprofiler-sdk-hsa-runtime-nolink + "rocprofiler-sdk-hsa-runtime without linking to HSA library" IMPORTED) rocprofiler_add_interface_library( - rocprofiler-hsakmt-nolink "rocprofiler-hsakmt without linking to HSAKMT library" - IMPORTED) -rocprofiler_add_interface_library(rocprofiler-rccl-nolink + rocprofiler-sdk-hsakmt-nolink + "rocprofiler-sdk-hsakmt without linking to HSAKMT library" IMPORTED) +rocprofiler_add_interface_library(rocprofiler-sdk-rccl-nolink "RCCL headers without linking to RCCL library" IMPORTED) diff --git a/cmake/rocprofiler_memcheck.cmake b/cmake/rocprofiler_memcheck.cmake index b3d31163..d81b8f23 100644 --- a/cmake/rocprofiler_memcheck.cmake +++ b/cmake/rocprofiler_memcheck.cmake @@ -15,10 +15,10 @@ set_property(CACHE ROCPROFILER_MEMCHECK PROPERTY STRINGS "${ROCPROFILER_MEMCHECK function(rocprofiler_add_memcheck_flags _TYPE _FLAG _LIB_BASE) target_compile_options( - rocprofiler-memcheck + rocprofiler-sdk-memcheck INTERFACE $) - target_link_options(rocprofiler-memcheck INTERFACE + target_link_options(rocprofiler-sdk-memcheck INTERFACE $) if(NOT EXISTS ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp) @@ -60,7 +60,7 @@ function(rocprofiler_set_memcheck_env _TYPE _LIB_BASE) endforeach() endif() - target_link_libraries(rocprofiler-memcheck INTERFACE ${_LIB_BASE}) + target_link_libraries(rocprofiler-sdk-memcheck INTERFACE ${_LIB_BASE}) if(${_TYPE}_LIBRARY) set(ROCPROFILER_MEMCHECK_PRELOAD_ENV diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 075d0b30..c6a4dc3a 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -24,10 +24,10 @@ if(ROCPROFILER_BUILD_GHC_FS) REPO_BRANCH "v1.5.14") target_compile_definitions( - rocprofiler-cxx-filesystem + rocprofiler-sdk-cxx-filesystem INTERFACE $) target_include_directories( - rocprofiler-cxx-filesystem SYSTEM + rocprofiler-sdk-cxx-filesystem SYSTEM INTERFACE $) endif() @@ -50,9 +50,9 @@ if(ROCPROFILER_BUILD_TESTS) message(FATAL_ERROR "missing GTest::gtest") endif() - target_link_libraries(rocprofiler-gtest INTERFACE GTest::gtest) + target_link_libraries(rocprofiler-sdk-gtest INTERFACE GTest::gtest) target_include_directories( - rocprofiler-gtest SYSTEM + rocprofiler-sdk-gtest SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include) mark_as_advanced(INSTALL_GTEST) @@ -60,7 +60,7 @@ if(ROCPROFILER_BUILD_TESTS) mark_as_advanced(GTEST_HAS_ABSL) else() find_package(GTest REQUIRED) - target_link_libraries(rocprofiler-gtest INTERFACE GTest::gtest) + target_link_libraries(rocprofiler-sdk-gtest INTERFACE GTest::gtest) endif() endif() @@ -79,14 +79,14 @@ if(ROCPROFILER_BUILD_GLOG) set(WITH_UNWIND "none") add_subdirectory(glog EXCLUDE_FROM_ALL) - target_link_libraries(rocprofiler-glog INTERFACE $) + target_link_libraries(rocprofiler-sdk-glog INTERFACE $) target_include_directories( - rocprofiler-glog SYSTEM + rocprofiler-sdk-glog SYSTEM INTERFACE $ $) else() find_package(glog REQUIRED) - target_link_libraries(rocprofiler-glog INTERFACE glog::glog) + target_link_libraries(rocprofiler-sdk-glog INTERFACE glog::glog) endif() if(ROCPROFILER_BUILD_FMT) @@ -101,13 +101,13 @@ if(ROCPROFILER_BUILD_FMT) set(FMT_TEST OFF) add_subdirectory(fmt EXCLUDE_FROM_ALL) - target_link_libraries(rocprofiler-fmt INTERFACE $) + target_link_libraries(rocprofiler-sdk-fmt INTERFACE $) target_include_directories( - rocprofiler-fmt SYSTEM + rocprofiler-sdk-fmt SYSTEM INTERFACE $) else() find_package(fmt REQUIRED) - target_link_libraries(rocprofiler-fmt INTERFACE fmt::fmt) + target_link_libraries(rocprofiler-sdk-fmt INTERFACE fmt::fmt) endif() if(NOT TARGET PTL::ptl-static) @@ -135,10 +135,10 @@ rocprofiler_checkout_git_submodule( add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) -target_link_libraries(rocprofiler-yaml-cpp +target_link_libraries(rocprofiler-sdk-yaml-cpp INTERFACE $) target_include_directories( - rocprofiler-yaml-cpp + rocprofiler-sdk-yaml-cpp INTERFACE $) # checkout submodule if not already checked out or clone repo if no .gitmodules file @@ -149,10 +149,10 @@ rocprofiler_checkout_git_submodule( REPO_URL https://github.com/jrmadsen/cereal.git REPO_BRANCH "rocprofiler") -target_compile_definitions(rocprofiler-cereal +target_compile_definitions(rocprofiler-sdk-cereal INTERFACE $) target_include_directories( - rocprofiler-cereal + rocprofiler-sdk-cereal INTERFACE $) # doxygen-awesome @@ -175,19 +175,20 @@ rocprofiler_checkout_git_submodule( REPO_URL https://android.googlesource.com/platform/external/perfetto external/perfetto REPO_BRANCH "v44.0") -add_library(rocprofiler-perfetto-static-library STATIC) +add_library(rocprofiler-sdk-perfetto-static-library STATIC) target_sources( - rocprofiler-perfetto-static-library + rocprofiler-sdk-perfetto-static-library PRIVATE ${PROJECT_SOURCE_DIR}/external/perfetto/sdk/perfetto.h ${PROJECT_SOURCE_DIR}/external/perfetto/sdk/perfetto.cc) target_include_directories( - rocprofiler-perfetto-static-library SYSTEM + rocprofiler-sdk-perfetto-static-library SYSTEM INTERFACE $) set_target_properties( - rocprofiler-perfetto-static-library PROPERTIES POSITION_INDEPENDENT_CODE ON - OUTPUT_NAME rocprofiler-sdk-perfetto) -target_link_libraries(rocprofiler-perfetto - INTERFACE $) + rocprofiler-sdk-perfetto-static-library + PROPERTIES POSITION_INDEPENDENT_CODE ON OUTPUT_NAME rocprofiler-sdk-perfetto) +target_link_libraries( + rocprofiler-sdk-perfetto + INTERFACE $) # ELFIO rocprofiler_checkout_git_submodule( @@ -200,9 +201,10 @@ rocprofiler_checkout_git_submodule( set(ELFIO_BUILD_EXAMPLES OFF) set(ELFIO_BUILD_TESTS OFF) add_subdirectory(elfio EXCLUDE_FROM_ALL) -if(TARGET rocprofiler-elfio) +if(TARGET rocprofiler-sdk-elfio) get_target_property(ELFIO_INCLUDE_DIR elfio::elfio INTERFACE_INCLUDE_DIRECTORIES) - target_include_directories(rocprofiler-elfio SYSTEM INTERFACE ${ELFIO_INCLUDE_DIR}) + target_include_directories(rocprofiler-sdk-elfio SYSTEM + INTERFACE ${ELFIO_INCLUDE_DIR}) endif() # OTF2 diff --git a/samples/common/CMakeLists.txt b/samples/common/CMakeLists.txt index 43eb8702..f36a4300 100644 --- a/samples/common/CMakeLists.txt +++ b/samples/common/CMakeLists.txt @@ -65,26 +65,27 @@ set(ROCPROFILER_DEFAULT_FAIL_REGEX CACHE STRING "Default FAIL_REGULAR_EXPRESSION for tests") # build flags -add_library(rocprofiler-samples-build-flags INTERFACE) -add_library(rocprofiler-sdk::samples-build-flags ALIAS rocprofiler-samples-build-flags) -target_compile_options(rocprofiler-samples-build-flags INTERFACE -W -Wall -Wextra - -Wshadow) -target_compile_features(rocprofiler-samples-build-flags INTERFACE cxx_std_17) +add_library(rocprofiler-sdk-samples-build-flags INTERFACE) +add_library(rocprofiler-sdk::samples-build-flags ALIAS + rocprofiler-sdk-samples-build-flags) +target_compile_options(rocprofiler-sdk-samples-build-flags INTERFACE -W -Wall -Wextra + -Wshadow) +target_compile_features(rocprofiler-sdk-samples-build-flags INTERFACE cxx_std_17) if(ROCPROFILER_BUILD_CI OR ROCPROFILER_BUILD_WERROR) - target_compile_options(rocprofiler-samples-build-flags INTERFACE -Werror) + target_compile_options(rocprofiler-sdk-samples-build-flags INTERFACE -Werror) endif() # common utilities cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH COMMON_LIBRARY_INCLUDE_DIR) -add_library(rocprofiler-samples-common-library INTERFACE) +add_library(rocprofiler-sdk-samples-common-library INTERFACE) add_library(rocprofiler-sdk::samples-common-library ALIAS - rocprofiler-samples-common-library) -target_link_libraries(rocprofiler-samples-common-library + rocprofiler-sdk-samples-common-library) +target_link_libraries(rocprofiler-sdk-samples-common-library INTERFACE rocprofiler-sdk::samples-build-flags libdw::libdw) -target_compile_features(rocprofiler-samples-common-library INTERFACE cxx_std_17) -target_include_directories(rocprofiler-samples-common-library +target_compile_features(rocprofiler-sdk-samples-common-library INTERFACE cxx_std_17) +target_include_directories(rocprofiler-sdk-samples-common-library INTERFACE ${COMMON_LIBRARY_INCLUDE_DIR}) set(EXTERNAL_SUBMODULE_DIR "${PROJECT_SOURCE_DIR}/../external") @@ -92,10 +93,10 @@ cmake_path(ABSOLUTE_PATH EXTERNAL_SUBMODULE_DIR NORMALIZE) if(EXISTS ${EXTERNAL_SUBMODULE_DIR}/filesystem/include/ghc/filesystem.hpp) target_compile_definitions( - rocprofiler-samples-common-library + rocprofiler-sdk-samples-common-library INTERFACE $) target_include_directories( - rocprofiler-samples-common-library SYSTEM + rocprofiler-sdk-samples-common-library SYSTEM INTERFACE $) endif() diff --git a/samples/intercept_table/CMakeLists.txt b/samples/intercept_table/CMakeLists.txt index 448af53c..63e3ce52 100644 --- a/samples/intercept_table/CMakeLists.txt +++ b/samples/intercept_table/CMakeLists.txt @@ -25,7 +25,10 @@ foreach(_TYPE DEBUG MINSIZEREL RELEASE RELWITHDEBINFO) endif() endforeach() -find_package(rocprofiler-sdk REQUIRED) +# +# below is equivalent to: ``find_package(rocprofiler-sdk REQUIRED)``. Use COMPONENTS below +# to demonstrate/test support for COMPONENTS +find_package(rocprofiler-sdk REQUIRED COMPONENTS headers shared-library) add_library(intercept-table-client SHARED) target_sources(intercept-table-client PRIVATE client.cpp client.hpp) diff --git a/source/lib/common/CMakeLists.txt b/source/lib/common/CMakeLists.txt index 4eb708d3..bb43bc28 100644 --- a/source/lib/common/CMakeLists.txt +++ b/source/lib/common/CMakeLists.txt @@ -23,31 +23,32 @@ set(common_headers units.hpp utility.hpp) -add_library(rocprofiler-common-library STATIC) -add_library(rocprofiler-sdk::rocprofiler-common-library ALIAS rocprofiler-common-library) +add_library(rocprofiler-sdk-common-library STATIC) +add_library(rocprofiler-sdk::rocprofiler-sdk-common-library ALIAS + rocprofiler-sdk-common-library) add_subdirectory(container) add_subdirectory(memory) -target_sources(rocprofiler-common-library PRIVATE ${common_sources} ${common_headers}) -target_include_directories(rocprofiler-common-library +target_sources(rocprofiler-sdk-common-library PRIVATE ${common_sources} ${common_headers}) +target_include_directories(rocprofiler-sdk-common-library PUBLIC $) target_link_libraries( - rocprofiler-common-library - PUBLIC $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $) + rocprofiler-sdk-common-library + PUBLIC $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $) -set_target_properties(rocprofiler-common-library PROPERTIES OUTPUT_NAME - rocprofiler-common) +set_target_properties(rocprofiler-sdk-common-library PROPERTIES OUTPUT_NAME + rocprofiler-sdk-common) diff --git a/source/lib/common/container/CMakeLists.txt b/source/lib/common/container/CMakeLists.txt index 699dbd7b..f1ab9577 100644 --- a/source/lib/common/container/CMakeLists.txt +++ b/source/lib/common/container/CMakeLists.txt @@ -7,5 +7,5 @@ set(containers_headers set(containers_sources ring_buffer.cpp record_header_buffer.cpp ring_buffer.cpp small_vector.cpp) -target_sources(rocprofiler-common-library PRIVATE ${containers_sources} - ${containers_headers}) +target_sources(rocprofiler-sdk-common-library PRIVATE ${containers_sources} + ${containers_headers}) diff --git a/source/lib/common/memory/CMakeLists.txt b/source/lib/common/memory/CMakeLists.txt index 2aa6c04a..cd5930f8 100644 --- a/source/lib/common/memory/CMakeLists.txt +++ b/source/lib/common/memory/CMakeLists.txt @@ -4,4 +4,4 @@ set(memory_headers deleter.hpp pool.hpp pool_allocator.hpp stateless_allocator.hpp) set(memory_sources) -target_sources(rocprofiler-common-library PRIVATE ${memory_sources} ${memory_headers}) +target_sources(rocprofiler-sdk-common-library PRIVATE ${memory_sources} ${memory_headers}) diff --git a/source/lib/rocprofiler-sdk-codeobj/CMakeLists.txt b/source/lib/rocprofiler-sdk-codeobj/CMakeLists.txt index 334819c2..fa183742 100644 --- a/source/lib/rocprofiler-sdk-codeobj/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk-codeobj/CMakeLists.txt @@ -28,8 +28,8 @@ target_include_directories( target_link_libraries( rocprofiler-sdk-codeobj - INTERFACE rocprofiler-sdk::rocprofiler-amd-comgr rocprofiler-sdk::rocprofiler-dw - rocprofiler-sdk::rocprofiler-elf) + INTERFACE rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-dw rocprofiler-sdk::rocprofiler-sdk-elf) if(ROCPROFILER_BUILD_TESTS) add_subdirectory(tests) diff --git a/source/lib/rocprofiler-sdk-codeobj/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk-codeobj/tests/CMakeLists.txt index a9a36a89..2cd13dc0 100644 --- a/source/lib/rocprofiler-sdk-codeobj/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk-codeobj/tests/CMakeLists.txt @@ -8,11 +8,11 @@ target_sources(codeobj-library-test PRIVATE ${CODEOBJ_LIB_TEST_SOURCES}) target_link_libraries( codeobj-library-test - PRIVATE rocprofiler-sdk::rocprofiler-static-library - rocprofiler-sdk::rocprofiler-glog - rocprofiler-sdk::rocprofiler-hsa-runtime - rocprofiler-sdk::rocprofiler-hip - rocprofiler-sdk::rocprofiler-common-library + PRIVATE rocprofiler-sdk::rocprofiler-sdk-static-library + rocprofiler-sdk::rocprofiler-sdk-glog + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-hip + rocprofiler-sdk::rocprofiler-sdk-common-library GTest::gtest GTest::gtest_main rocprofiler-sdk::rocprofiler-sdk-codeobj) diff --git a/source/lib/rocprofiler-sdk-roctx/CMakeLists.txt b/source/lib/rocprofiler-sdk-roctx/CMakeLists.txt index 94f254ce..a278bd89 100644 --- a/source/lib/rocprofiler-sdk-roctx/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk-roctx/CMakeLists.txt @@ -20,10 +20,10 @@ target_include_directories( target_link_libraries( rocprofiler-sdk-roctx-shared-library PRIVATE rocprofiler-register::rocprofiler-register - rocprofiler-sdk::rocprofiler-headers - rocprofiler-sdk::rocprofiler-build-flags - rocprofiler-sdk::rocprofiler-memcheck - rocprofiler-sdk::rocprofiler-common-library) + rocprofiler-sdk::rocprofiler-sdk-headers + rocprofiler-sdk::rocprofiler-sdk-build-flags + rocprofiler-sdk::rocprofiler-sdk-memcheck + rocprofiler-sdk::rocprofiler-sdk-common-library) set_target_properties( rocprofiler-sdk-roctx-shared-library diff --git a/source/lib/rocprofiler-sdk-tool/CMakeLists.txt b/source/lib/rocprofiler-sdk-tool/CMakeLists.txt index ccdce026..bb2514cc 100644 --- a/source/lib/rocprofiler-sdk-tool/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk-tool/CMakeLists.txt @@ -41,14 +41,14 @@ target_sources(rocprofiler-sdk-tool PRIVATE ${TOOL_SOURCES} ${TOOL_HEADERS}) target_link_libraries( rocprofiler-sdk-tool - PRIVATE rocprofiler-sdk::rocprofiler-shared-library - rocprofiler-sdk::rocprofiler-headers - rocprofiler-sdk::rocprofiler-build-flags - rocprofiler-sdk::rocprofiler-memcheck - rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-cereal - rocprofiler-sdk::rocprofiler-perfetto - rocprofiler-sdk::rocprofiler-otf2) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-shared-library + rocprofiler-sdk::rocprofiler-sdk-headers + rocprofiler-sdk::rocprofiler-sdk-build-flags + rocprofiler-sdk::rocprofiler-sdk-memcheck + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-cereal + rocprofiler-sdk::rocprofiler-sdk-perfetto + rocprofiler-sdk::rocprofiler-sdk-otf2) set_target_properties( rocprofiler-sdk-tool diff --git a/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt b/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt index 01b703fb..aa95127b 100644 --- a/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk-tool/kokkosp/CMakeLists.txt @@ -13,8 +13,9 @@ target_sources(rocprofiler-sdk-tool-kokkosp PRIVATE ${KOKKOSP_SOURCES} ${KOKKOSP target_link_libraries( rocprofiler-sdk-tool-kokkosp PRIVATE rocprofiler-sdk-roctx::rocprofiler-sdk-roctx-shared-library - rocprofiler-sdk::rocprofiler-headers - rocprofiler-sdk::rocprofiler-common-library rocprofiler-sdk::rocprofiler-glog) + rocprofiler-sdk::rocprofiler-sdk-headers + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-glog) set_target_properties( rocprofiler-sdk-tool-kokkosp diff --git a/source/lib/rocprofiler-sdk/CMakeLists.txt b/source/lib/rocprofiler-sdk/CMakeLists.txt index d8d914bb..cef63334 100644 --- a/source/lib/rocprofiler-sdk/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/CMakeLists.txt @@ -29,11 +29,12 @@ set(ROCPROFILER_LIB_SOURCES # # ----------------------------------------------------------------------------------------# -add_library(rocprofiler-object-library OBJECT) -add_library(rocprofiler-sdk::rocprofiler-object-library ALIAS rocprofiler-object-library) +add_library(rocprofiler-sdk-object-library OBJECT) +add_library(rocprofiler-sdk::rocprofiler-sdk-object-library ALIAS + rocprofiler-sdk-object-library) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_SOURCES} - ${ROCPROFILER_LIB_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_SOURCES} + ${ROCPROFILER_LIB_HEADERS}) add_subdirectory(hsa) add_subdirectory(hip) @@ -51,21 +52,23 @@ add_subdirectory(rccl) add_subdirectory(details) target_link_libraries( - rocprofiler-object-library - PUBLIC rocprofiler-sdk::rocprofiler-headers rocprofiler-sdk::rocprofiler-hip-nolink - rocprofiler-sdk::rocprofiler-hsa-runtime-nolink - rocprofiler-sdk::rocprofiler-rccl-nolink - PRIVATE rocprofiler-sdk::rocprofiler-build-flags - rocprofiler-sdk::rocprofiler-memcheck - rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-amd-comgr - rocprofiler-sdk::rocprofiler-hsa-aql - rocprofiler-sdk::rocprofiler-drm - rocprofiler-sdk::rocprofiler-hsakmt-nolink) - -target_compile_definitions(rocprofiler-object-library PRIVATE rocprofiler_EXPORTS=1) - -set_target_properties(rocprofiler-object-library PROPERTIES POSITION_INDEPENDENT_CODE ON) + rocprofiler-sdk-object-library + PUBLIC rocprofiler-sdk::rocprofiler-sdk-headers + rocprofiler-sdk::rocprofiler-sdk-hip-nolink + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime-nolink + rocprofiler-sdk::rocprofiler-sdk-rccl-nolink + PRIVATE rocprofiler-sdk::rocprofiler-sdk-build-flags + rocprofiler-sdk::rocprofiler-sdk-memcheck + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-hsa-aql + rocprofiler-sdk::rocprofiler-sdk-drm + rocprofiler-sdk::rocprofiler-sdk-hsakmt-nolink) + +target_compile_definitions(rocprofiler-sdk-object-library PRIVATE rocprofiler_EXPORTS=1) + +set_target_properties(rocprofiler-sdk-object-library PROPERTIES POSITION_INDEPENDENT_CODE + ON) # ----------------------------------------------------------------------------------------# # @@ -73,30 +76,31 @@ set_target_properties(rocprofiler-object-library PROPERTIES POSITION_INDEPENDENT # # ----------------------------------------------------------------------------------------# -add_library(rocprofiler-shared-library SHARED) -add_library(rocprofiler-sdk::rocprofiler-shared-library ALIAS rocprofiler-shared-library) +add_library(rocprofiler-sdk-shared-library SHARED) +add_library(rocprofiler-sdk::rocprofiler-sdk-shared-library ALIAS + rocprofiler-sdk-shared-library) target_sources( - rocprofiler-shared-library - PRIVATE $ + rocprofiler-sdk-shared-library + PRIVATE $ shared_library.cpp) target_link_libraries( - rocprofiler-shared-library - INTERFACE rocprofiler-sdk::rocprofiler-headers - $ - $ - PRIVATE rocprofiler-sdk::rocprofiler-hsa-runtime-nolink - rocprofiler-sdk::rocprofiler-hip-nolink - rocprofiler-sdk::rocprofiler-build-flags - rocprofiler-sdk::rocprofiler-memcheck - rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-cxx-filesystem - rocprofiler-sdk::rocprofiler-dl - rocprofiler-sdk::rocprofiler-amd-comgr - rocprofiler-sdk::rocprofiler-object-library) + rocprofiler-sdk-shared-library + INTERFACE rocprofiler-sdk::rocprofiler-sdk-headers + $ + $ + PRIVATE rocprofiler-sdk::rocprofiler-sdk-hsa-runtime-nolink + rocprofiler-sdk::rocprofiler-sdk-hip-nolink + rocprofiler-sdk::rocprofiler-sdk-build-flags + rocprofiler-sdk::rocprofiler-sdk-memcheck + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-cxx-filesystem + rocprofiler-sdk::rocprofiler-sdk-dl + rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-object-library) set_target_properties( - rocprofiler-shared-library + rocprofiler-sdk-shared-library PROPERTIES OUTPUT_NAME rocprofiler-sdk SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION} @@ -104,10 +108,10 @@ set_target_properties( INSTALL_RPATH "\$ORIGIN" DEFINE_SYMBOL rocprofiler_EXPORTS) -add_library(rocprofiler-sdk::rocprofiler-library ALIAS rocprofiler-shared-library) +add_library(rocprofiler-sdk::rocprofiler-library ALIAS rocprofiler-sdk-shared-library) install( - TARGETS rocprofiler-shared-library + TARGETS rocprofiler-sdk-shared-library DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT core EXPORT rocprofiler-sdk-targets) @@ -118,22 +122,23 @@ install( # # ----------------------------------------------------------------------------------------# -add_library(rocprofiler-static-library EXCLUDE_FROM_ALL STATIC) -add_library(rocprofiler-sdk::rocprofiler-static-library ALIAS rocprofiler-static-library) +add_library(rocprofiler-sdk-static-library EXCLUDE_FROM_ALL STATIC) +add_library(rocprofiler-sdk::rocprofiler-sdk-static-library ALIAS + rocprofiler-sdk-static-library) -target_sources(rocprofiler-static-library - PRIVATE $) +target_sources(rocprofiler-sdk-static-library + PRIVATE $) target_link_libraries( - rocprofiler-static-library - PUBLIC rocprofiler-sdk::rocprofiler-headers - rocprofiler-sdk::rocprofiler-hsa-runtime-nolink - rocprofiler-sdk::rocprofiler-hip-nolink - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-object-library) + rocprofiler-sdk-static-library + PUBLIC rocprofiler-sdk::rocprofiler-sdk-headers + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime-nolink + rocprofiler-sdk::rocprofiler-sdk-hip-nolink + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-object-library) set_target_properties( - rocprofiler-static-library PROPERTIES OUTPUT_NAME rocprofiler-sdk DEFINE_SYMBOL - rocprofiler_EXPORTS) + rocprofiler-sdk-static-library PROPERTIES OUTPUT_NAME rocprofiler-sdk + DEFINE_SYMBOL rocprofiler_EXPORTS) # ----------------------------------------------------------------------------------------# # diff --git a/source/lib/rocprofiler-sdk/aql/CMakeLists.txt b/source/lib/rocprofiler-sdk/aql/CMakeLists.txt index 01f7f068..cfde2e3a 100644 --- a/source/lib/rocprofiler-sdk/aql/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/aql/CMakeLists.txt @@ -1,8 +1,8 @@ set(ROCPROFILER_LIB_AQL_SOURCES helpers.cpp packet_construct.cpp) set(ROCPROFILER_LIB_AQL_HEADERS helpers.hpp packet_construct.hpp aql_profile_v2.h) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_AQL_SOURCES} - ${ROCPROFILER_LIB_AQL_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_AQL_SOURCES} + ${ROCPROFILER_LIB_AQL_HEADERS}) if(ROCPROFILER_BUILD_TESTS) add_subdirectory(tests) diff --git a/source/lib/rocprofiler-sdk/aql/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/aql/tests/CMakeLists.txt index 99cfd326..bc9831bd 100644 --- a/source/lib/rocprofiler-sdk/aql/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/aql/tests/CMakeLists.txt @@ -11,11 +11,11 @@ target_sources(aql-test PRIVATE ${ROCPROFILER_LIB_AQL_TEST_SOURCES}) target_link_libraries( aql-test PRIVATE rocprofiler-sdk::counter-test-constants - rocprofiler-sdk::rocprofiler-static-library - rocprofiler-sdk::rocprofiler-glog - rocprofiler-sdk::rocprofiler-hsa-runtime - rocprofiler-sdk::rocprofiler-hip - rocprofiler-sdk::rocprofiler-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library + rocprofiler-sdk::rocprofiler-sdk-glog + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-hip + rocprofiler-sdk::rocprofiler-sdk-common-library GTest::gtest GTest::gtest_main) diff --git a/source/lib/rocprofiler-sdk/code_object/CMakeLists.txt b/source/lib/rocprofiler-sdk/code_object/CMakeLists.txt index ce96785f..af33979d 100644 --- a/source/lib/rocprofiler-sdk/code_object/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/code_object/CMakeLists.txt @@ -4,8 +4,9 @@ set(ROCPROFILER_LIB_CODE_OBJECT_SOURCES code_object.cpp) set(ROCPROFILER_LIB_CODE_OBJECT_HEADERS code_object.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_CODE_OBJECT_SOURCES} - ${ROCPROFILER_LIB_CODE_OBJECT_HEADERS}) +target_sources( + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_CODE_OBJECT_SOURCES} + ${ROCPROFILER_LIB_CODE_OBJECT_HEADERS}) add_subdirectory(hsa) add_subdirectory(hip) diff --git a/source/lib/rocprofiler-sdk/code_object/hip/CMakeLists.txt b/source/lib/rocprofiler-sdk/code_object/hip/CMakeLists.txt index acdfb921..e6e9d7d7 100644 --- a/source/lib/rocprofiler-sdk/code_object/hip/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/code_object/hip/CMakeLists.txt @@ -5,5 +5,5 @@ set(ROCPROFILER_LIB_CODE_OBJECT_HIP_SOURCES) set(ROCPROFILER_LIB_CODE_OBJECT_HIP_HEADERS) target_sources( - rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_CODE_OBJECT_HIP_SOURCES} - ${ROCPROFILER_LIB_CODE_OBJECT_HIP_HEADERS}) + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_CODE_OBJECT_HIP_SOURCES} + ${ROCPROFILER_LIB_CODE_OBJECT_HIP_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/code_object/hsa/CMakeLists.txt b/source/lib/rocprofiler-sdk/code_object/hsa/CMakeLists.txt index e50cfba5..0a7daf48 100644 --- a/source/lib/rocprofiler-sdk/code_object/hsa/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/code_object/hsa/CMakeLists.txt @@ -5,5 +5,5 @@ set(ROCPROFILER_LIB_CODE_OBJECT_HSA_SOURCES code_object.cpp kernel_symbol.cpp) set(ROCPROFILER_LIB_CODE_OBJECT_HSA_HEADERS code_object.hpp kernel_symbol.hpp) target_sources( - rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_CODE_OBJECT_HSA_SOURCES} - ${ROCPROFILER_LIB_CODE_OBJECT_HSA_HEADERS}) + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_CODE_OBJECT_HSA_SOURCES} + ${ROCPROFILER_LIB_CODE_OBJECT_HSA_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/context/CMakeLists.txt b/source/lib/rocprofiler-sdk/context/CMakeLists.txt index c3979034..502578fa 100644 --- a/source/lib/rocprofiler-sdk/context/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/context/CMakeLists.txt @@ -4,5 +4,5 @@ set(ROCPROFILER_LIB_CONFIG_SOURCES context.cpp correlation_id.cpp domain.cpp) set(ROCPROFILER_LIB_CONFIG_HEADERS context.hpp correlation_id.hpp domain.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_CONFIG_SOURCES} - ${ROCPROFILER_LIB_CONFIG_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_CONFIG_SOURCES} + ${ROCPROFILER_LIB_CONFIG_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/counters/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/CMakeLists.txt index e38afffe..cba0268d 100644 --- a/source/lib/rocprofiler-sdk/counters/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/counters/CMakeLists.txt @@ -4,8 +4,8 @@ set(ROCPROFILER_LIB_COUNTERS_SOURCES set(ROCPROFILER_LIB_COUNTERS_HEADERS metrics.hpp dimensions.hpp evaluate_ast.hpp core.hpp id_decode.hpp dispatch_handlers.hpp controller.hpp device_counting.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_COUNTERS_SOURCES} - ${ROCPROFILER_LIB_COUNTERS_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_COUNTERS_SOURCES} + ${ROCPROFILER_LIB_COUNTERS_HEADERS}) add_subdirectory(xml) add_subdirectory(parser) diff --git a/source/lib/rocprofiler-sdk/counters/parser/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/parser/CMakeLists.txt index d8c17220..b964f06f 100644 --- a/source/lib/rocprofiler-sdk/counters/parser/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/counters/parser/CMakeLists.txt @@ -2,7 +2,7 @@ rocprofiler_deactivate_clang_tidy() set(expr_parser_sources parser.cpp parser.h scanner.cpp raw_ast.hpp reader.hpp) -add_library(rocprofiler-expr-parser OBJECT) +add_library(rocprofiler-sdk-expr-parser OBJECT) if(ROCPROFILER_REGENERATE_COUNTERS_PARSER) find_package(FLEX REQUIRED) @@ -22,7 +22,7 @@ if(ROCPROFILER_REGENERATE_COUNTERS_PARSER) YYDEBUG=1) add_custom_target( - rocprofiler-expr-parser-patch + rocprofiler-sdk-expr-parser-patch COMMAND ${CMAKE_COMMAND} -DPROJECT_SRC_DIR=${PROJECT_SOURCE_DIR} -DPROJECT_BLD_DIR=${PROJECT_BINARY_DIR} @@ -34,17 +34,18 @@ if(ROCPROFILER_REGENERATE_COUNTERS_PARSER) ${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp VERBATIM) - # ensure gets applied when rocprofiler-expr-parser is built - add_dependencies(rocprofiler-expr-parser rocprofiler-expr-parser-patch) + # ensure gets applied when rocprofiler-sdk-expr-parser is built + add_dependencies(rocprofiler-sdk-expr-parser rocprofiler-sdk-expr-parser-patch) endif() -target_sources(rocprofiler-expr-parser PRIVATE ${expr_parser_sources}) -target_include_directories(rocprofiler-expr-parser PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -target_compile_definitions(rocprofiler-expr-parser PRIVATE YY_NO_INPUT) -target_link_libraries(rocprofiler-expr-parser - PRIVATE rocprofiler-sdk::rocprofiler-common-library) -target_sources(rocprofiler-object-library - PUBLIC $) +target_sources(rocprofiler-sdk-expr-parser PRIVATE ${expr_parser_sources}) +target_include_directories(rocprofiler-sdk-expr-parser + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_definitions(rocprofiler-sdk-expr-parser PRIVATE YY_NO_INPUT) +target_link_libraries(rocprofiler-sdk-expr-parser + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library) +target_sources(rocprofiler-sdk-object-library + PUBLIC $) if(ROCPROFILER_BUILD_TESTS) add_subdirectory(tests) diff --git a/source/lib/rocprofiler-sdk/counters/parser/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/parser/tests/CMakeLists.txt index 62c13679..87821fd6 100644 --- a/source/lib/rocprofiler-sdk/counters/parser/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/counters/parser/tests/CMakeLists.txt @@ -10,8 +10,9 @@ target_sources(parser-test PRIVATE ${ROCPROFILER_LIB_PARSER_TEST_SOURCES}) target_link_libraries( parser-test - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest + GTest::gtest_main) gtest_add_tests( TARGET parser-test diff --git a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt index 4d476bff..6c98d157 100644 --- a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt @@ -50,9 +50,10 @@ target_sources( target_link_libraries( counter_test_constants - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library rocprofiler-sdk::rocprofiler-hip - rocprofiler-sdk::rocprofiler-hsa-runtime) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library + rocprofiler-sdk::rocprofiler-sdk-hip + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime) set(ROCPROFILER_LIB_COUNTER_TEST_SOURCES metrics_test.cpp evaluate_ast_test.cpp dimension.cpp init_order.cpp core.cpp @@ -69,10 +70,10 @@ add_dependencies(counter-test agent_hasco_targets) target_link_libraries( counter-test PRIVATE rocprofiler-sdk::counter-test-constants - rocprofiler-sdk::rocprofiler-hsa-runtime - rocprofiler-sdk::rocprofiler-hip - rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-hip + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest GTest::gtest_main) diff --git a/source/lib/rocprofiler-sdk/details/CMakeLists.txt b/source/lib/rocprofiler-sdk/details/CMakeLists.txt index c7886f5e..b254d830 100644 --- a/source/lib/rocprofiler-sdk/details/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/details/CMakeLists.txt @@ -4,5 +4,5 @@ set(ROCPROFILER_DETAILS_SOURCES) set(ROCPROFILER_DETAILS_HEADERS kfd_ioctl.h) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_DETAILS_SOURCES} - ${ROCPROFILER_DETAILS_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_DETAILS_SOURCES} + ${ROCPROFILER_DETAILS_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/hip/CMakeLists.txt b/source/lib/rocprofiler-sdk/hip/CMakeLists.txt index 404d4c61..8c3374b0 100644 --- a/source/lib/rocprofiler-sdk/hip/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/hip/CMakeLists.txt @@ -1,7 +1,7 @@ set(ROCPROFILER_LIB_HIP_SOURCES abi.cpp hip.cpp) set(ROCPROFILER_LIB_HIP_HEADERS defines.hpp hip.hpp utils.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_HIP_SOURCES} - ${ROCPROFILER_LIB_HIP_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_HIP_SOURCES} + ${ROCPROFILER_LIB_HIP_HEADERS}) add_subdirectory(details) diff --git a/source/lib/rocprofiler-sdk/hip/details/CMakeLists.txt b/source/lib/rocprofiler-sdk/hip/details/CMakeLists.txt index 4565f4bb..64e98a05 100644 --- a/source/lib/rocprofiler-sdk/hip/details/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/hip/details/CMakeLists.txt @@ -4,5 +4,6 @@ set(ROCPROFILER_LIB_HIP_DETAILS_SOURCES) set(ROCPROFILER_LIB_HIP_DETAILS_HEADERS format.hpp ostream.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_HIP_DETAILS_SOURCES} - ${ROCPROFILER_LIB_HIP_DETAILS_HEADERS}) +target_sources( + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_HIP_DETAILS_SOURCES} + ${ROCPROFILER_LIB_HIP_DETAILS_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/hsa/CMakeLists.txt b/source/lib/rocprofiler-sdk/hsa/CMakeLists.txt index fee75d6c..935aee57 100644 --- a/source/lib/rocprofiler-sdk/hsa/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/hsa/CMakeLists.txt @@ -28,7 +28,7 @@ set(ROCPROFILER_LIB_HSA_HEADERS scratch_memory.hpp utils.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_HSA_SOURCES} - ${ROCPROFILER_LIB_HSA_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_HSA_SOURCES} + ${ROCPROFILER_LIB_HSA_HEADERS}) add_subdirectory(details) diff --git a/source/lib/rocprofiler-sdk/hsa/details/CMakeLists.txt b/source/lib/rocprofiler-sdk/hsa/details/CMakeLists.txt index be503cd2..4dc3696d 100644 --- a/source/lib/rocprofiler-sdk/hsa/details/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/hsa/details/CMakeLists.txt @@ -4,5 +4,6 @@ set(ROCPROFILER_LIB_HSA_DETAILS_SOURCES) set(ROCPROFILER_LIB_HSA_DETAILS_HEADERS ostream.hpp fmt.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_HSA_DETAILS_SOURCES} - ${ROCPROFILER_LIB_HSA_DETAILS_HEADERS}) +target_sources( + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_HSA_DETAILS_SOURCES} + ${ROCPROFILER_LIB_HSA_DETAILS_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/kernel_dispatch/CMakeLists.txt b/source/lib/rocprofiler-sdk/kernel_dispatch/CMakeLists.txt index f4a89597..71ac87dc 100644 --- a/source/lib/rocprofiler-sdk/kernel_dispatch/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/kernel_dispatch/CMakeLists.txt @@ -5,5 +5,5 @@ set(ROCPROFILER_LIB_KERNEL_DISPATCH_HEADERS kernel_dispatch.hpp profiling_time.h tracing.hpp) target_sources( - rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_KERNEL_DISPATCH_SOURCES} - ${ROCPROFILER_LIB_KERNEL_DISPATCH_HEADERS}) + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_KERNEL_DISPATCH_SOURCES} + ${ROCPROFILER_LIB_KERNEL_DISPATCH_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/marker/CMakeLists.txt b/source/lib/rocprofiler-sdk/marker/CMakeLists.txt index 68a87f38..d2c92a5f 100644 --- a/source/lib/rocprofiler-sdk/marker/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/marker/CMakeLists.txt @@ -3,5 +3,5 @@ set(ROCPROFILER_LIB_MARKER_SOURCES marker.cpp) set(ROCPROFILER_LIB_MARKER_HEADERS defines.hpp marker.hpp utils.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_MARKER_SOURCES} - ${ROCPROFILER_LIB_MARKER_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_MARKER_SOURCES} + ${ROCPROFILER_LIB_MARKER_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/page_migration/CMakeLists.txt b/source/lib/rocprofiler-sdk/page_migration/CMakeLists.txt index 242fe0b7..f72dd12e 100644 --- a/source/lib/rocprofiler-sdk/page_migration/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/page_migration/CMakeLists.txt @@ -3,5 +3,5 @@ set(ROCPROFILER_LIB_UVM_SOURCES page_migration.cpp) set(ROCPROFILER_LIB_UVM_HEADERS defines.hpp page_migration.hpp utils.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_UVM_SOURCES} - ${ROCPROFILER_LIB_UVM_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_UVM_SOURCES} + ${ROCPROFILER_LIB_UVM_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/pc_sampling/CMakeLists.txt b/source/lib/rocprofiler-sdk/pc_sampling/CMakeLists.txt index 415b9347..2f86982b 100644 --- a/source/lib/rocprofiler-sdk/pc_sampling/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/pc_sampling/CMakeLists.txt @@ -13,8 +13,8 @@ set(ROCPROFILER_PC_SAMPLING_SOURCES hsa_adapter.cpp utils.cpp service.cpp cid_ma set(ROCPROFILER_PC_SAMPLING_HEADERS hsa_adapter.hpp utils.hpp service.hpp types.hpp cid_manager.hpp code_object.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_PC_SAMPLING_SOURCES} - ${ROCPROFILER_PC_SAMPLING_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_PC_SAMPLING_SOURCES} + ${ROCPROFILER_PC_SAMPLING_HEADERS}) add_subdirectory(ioctl) diff --git a/source/lib/rocprofiler-sdk/pc_sampling/ioctl/CMakeLists.txt b/source/lib/rocprofiler-sdk/pc_sampling/ioctl/CMakeLists.txt index 569ee5b8..546238dc 100644 --- a/source/lib/rocprofiler-sdk/pc_sampling/ioctl/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/pc_sampling/ioctl/CMakeLists.txt @@ -2,5 +2,5 @@ set(ROCPROFILER_PC_SAMPLING_IOCTL_SOURCES ioctl_adapter.cpp) set(ROCPROFILER_PC_SAMPLING_IOCTL_HEADERS ioctl_adapter.hpp ioctl_adapter_types.hpp) target_sources( - rocprofiler-object-library PRIVATE ${ROCPROFILER_PC_SAMPLING_IOCTL_SOURCES} - ${ROCPROFILER_PC_SAMPLING_IOCTL_HEADERS}) + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_PC_SAMPLING_IOCTL_SOURCES} + ${ROCPROFILER_PC_SAMPLING_IOCTL_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/pc_sampling/parser/CMakeLists.txt b/source/lib/rocprofiler-sdk/pc_sampling/parser/CMakeLists.txt index 1896d651..d73469a0 100644 --- a/source/lib/rocprofiler-sdk/pc_sampling/parser/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/pc_sampling/parser/CMakeLists.txt @@ -4,8 +4,8 @@ set(ROCPROFILER_LIB_PC_SAMPLING_PARSER_HEADERS translation.hpp) target_sources( - rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_PC_SAMPLING_PARSER_SOURCES} - ${ROCPROFILER_LIB_PC_SAMPLING_PARSER_HEADERS}) + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_PC_SAMPLING_PARSER_SOURCES} + ${ROCPROFILER_LIB_PC_SAMPLING_PARSER_HEADERS}) if(ROCPROFILER_BUILD_TESTS) add_subdirectory(tests) diff --git a/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt index c8ceca61..4557a11d 100644 --- a/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt @@ -18,8 +18,9 @@ target_include_directories(pcs_gfx9_test PRIVATE ${PCTEST_INCLUDE_DIR}) target_link_libraries( pcs_gfx9_test - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest + GTest::gtest_main) gtest_add_tests( TARGET pcs_gfx9_test @@ -36,8 +37,9 @@ target_include_directories(pcs_id_test PRIVATE ${PCTEST_INCLUDE_DIR}) target_link_libraries( pcs_id_test - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest + GTest::gtest_main) gtest_add_tests( TARGET pcs_id_test @@ -56,8 +58,9 @@ target_include_directories(pcs_bench_test PRIVATE ${PCTEST_INCLUDE_DIR}) target_link_libraries( pcs_bench_test - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest + GTest::gtest_main) add_executable(pcs_thread_test) target_compile_options(pcs_thread_test PRIVATE "-Ofast") @@ -67,8 +70,9 @@ target_include_directories(pcs_thread_test PRIVATE ${PCTEST_INCLUDE_DIR}) target_link_libraries( pcs_thread_test - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest + GTest::gtest_main) gtest_add_tests( TARGET pcs_thread_test diff --git a/source/lib/rocprofiler-sdk/pc_sampling/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/pc_sampling/tests/CMakeLists.txt index a4d973ed..030a81a1 100644 --- a/source/lib/rocprofiler-sdk/pc_sampling/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/pc_sampling/tests/CMakeLists.txt @@ -15,8 +15,9 @@ target_sources(pcs-test PRIVATE ${ROCPROFILER_LIB_PC_SAMPLING_TEST_SOURCES} target_link_libraries( pcs-test - PRIVATE rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-static-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest + GTest::gtest_main) gtest_add_tests( TARGET pcs-test diff --git a/source/lib/rocprofiler-sdk/rccl/CMakeLists.txt b/source/lib/rocprofiler-sdk/rccl/CMakeLists.txt index 0d5db03b..6ca650e7 100644 --- a/source/lib/rocprofiler-sdk/rccl/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/rccl/CMakeLists.txt @@ -1,5 +1,5 @@ set(ROCPROFILER_LIB_RCCL_SOURCES abi.cpp rccl.cpp) set(ROCPROFILER_LIB_RCCL_HEADERS defines.hpp rccl.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_RCCL_SOURCES} - ${ROCPROFILER_LIB_RCCL_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_RCCL_SOURCES} + ${ROCPROFILER_LIB_RCCL_HEADERS}) diff --git a/source/lib/rocprofiler-sdk/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/tests/CMakeLists.txt index 8303de58..3b43509f 100644 --- a/source/lib/rocprofiler-sdk/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/tests/CMakeLists.txt @@ -14,19 +14,20 @@ include(GoogleTest) set(rocprofiler_lib_sources agent.cpp buffer.cpp contexts.cpp hsa.cpp naming.cpp timestamp.cpp version.cpp hsa_barrier.cpp) -add_executable(rocprofiler-lib-tests) -target_sources(rocprofiler-lib-tests PRIVATE ${rocprofiler_lib_sources} details/agent.cpp) +add_executable(rocprofiler-sdk-lib-tests) +target_sources(rocprofiler-sdk-lib-tests PRIVATE ${rocprofiler_lib_sources} + details/agent.cpp) target_link_libraries( - rocprofiler-lib-tests - PRIVATE rocprofiler-sdk::rocprofiler-static-library - rocprofiler-sdk::rocprofiler-common-library + rocprofiler-sdk-lib-tests + PRIVATE rocprofiler-sdk::rocprofiler-sdk-static-library + rocprofiler-sdk::rocprofiler-sdk-common-library rocprofiler-sdk::counter-test-constants - rocprofiler-sdk::rocprofiler-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime GTest::gtest GTest::gtest_main) gtest_add_tests( - TARGET rocprofiler-lib-tests + TARGET rocprofiler-sdk-lib-tests SOURCES ${rocprofiler_lib_sources} TEST_LIST lib_TESTS WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) @@ -43,29 +44,29 @@ set(rocprofiler_shared_lib_sources external_correlation.cpp intercept_table.cpp page_migration.cpp registration.cpp roctx.cpp status.cpp) -add_executable(rocprofiler-lib-tests-shared) -target_sources(rocprofiler-lib-tests-shared PRIVATE ${rocprofiler_shared_lib_sources}) +add_executable(rocprofiler-sdk-lib-tests-shared) +target_sources(rocprofiler-sdk-lib-tests-shared PRIVATE ${rocprofiler_shared_lib_sources}) target_link_libraries( - rocprofiler-lib-tests-shared - PRIVATE rocprofiler-sdk::rocprofiler-shared-library - rocprofiler-sdk::rocprofiler-common-library - rocprofiler-sdk::rocprofiler-hsa-runtime - rocprofiler-sdk::rocprofiler-drm + rocprofiler-sdk-lib-tests-shared + PRIVATE rocprofiler-sdk::rocprofiler-sdk-shared-library + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-drm rocprofiler-sdk::rocprofiler-sdk-roctx-shared-library GTest::gtest GTest::gtest_main) -set_target_properties(rocprofiler-lib-tests-shared PROPERTIES BUILD_RPATH - "\$ORIGIN/../lib") +set_target_properties(rocprofiler-sdk-lib-tests-shared PROPERTIES BUILD_RPATH + "\$ORIGIN/../lib") gtest_add_tests( - TARGET rocprofiler-lib-tests-shared + TARGET rocprofiler-sdk-lib-tests-shared SOURCES ${rocprofiler_shared_lib_sources} TEST_LIST shared_lib_TESTS WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -set(rocprofiler-lib-tests-env +set(rocprofiler-sdk-lib-tests-env "LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}:$ENV{LD_LIBRARY_PATH}") set_tests_properties( ${shared_lib_TESTS} PROPERTIES TIMEOUT 120 LABELS "unittests" ENVIRONMENT - "${rocprofiler-lib-tests-env}") + "${rocprofiler-sdk-lib-tests-env}") diff --git a/source/lib/rocprofiler-sdk/thread_trace/CMakeLists.txt b/source/lib/rocprofiler-sdk/thread_trace/CMakeLists.txt index 60f552d6..4f68e9da 100644 --- a/source/lib/rocprofiler-sdk/thread_trace/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/thread_trace/CMakeLists.txt @@ -1,8 +1,9 @@ set(ROCPROFILER_LIB_THREAD_TRACE_SOURCES att_core.cpp att_service.cpp att_parser.cpp code_object.cpp) set(ROCPROFILER_LIB_THREAD_TRACE_HEADERS att_core.hpp code_object.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_THREAD_TRACE_SOURCES} - ${ROCPROFILER_LIB_THREAD_TRACE_HEADERS}) +target_sources( + rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_THREAD_TRACE_SOURCES} + ${ROCPROFILER_LIB_THREAD_TRACE_HEADERS}) if(ROCPROFILER_BUILD_TESTS) add_subdirectory(tests) diff --git a/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt index c26a00d5..70d2df58 100644 --- a/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt @@ -10,11 +10,11 @@ target_sources(thread-trace-packet-test PRIVATE ${ROCPROFILER_THREAD_TRACE_TEST_ target_link_libraries( thread-trace-packet-test - PRIVATE rocprofiler-sdk::rocprofiler-static-library - rocprofiler-sdk::rocprofiler-glog - rocprofiler-sdk::rocprofiler-hsa-runtime - rocprofiler-sdk::rocprofiler-hip - rocprofiler-sdk::rocprofiler-common-library + PRIVATE rocprofiler-sdk::rocprofiler-sdk-static-library + rocprofiler-sdk::rocprofiler-sdk-glog + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-hip + rocprofiler-sdk::rocprofiler-sdk-common-library GTest::gtest GTest::gtest_main rocprofiler-sdk::counter-test-constants) diff --git a/source/lib/rocprofiler-sdk/tracing/CMakeLists.txt b/source/lib/rocprofiler-sdk/tracing/CMakeLists.txt index 16a9dd48..afb314c3 100644 --- a/source/lib/rocprofiler-sdk/tracing/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/tracing/CMakeLists.txt @@ -2,5 +2,5 @@ set(ROCPROFILER_LIB_TRACING_SOURCES) set(ROCPROFILER_LIB_TRACING_HEADERS fwd.hpp tracing.hpp) -target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_TRACING_SOURCES} - ${ROCPROFILER_LIB_TRACING_HEADERS}) +target_sources(rocprofiler-sdk-object-library PRIVATE ${ROCPROFILER_LIB_TRACING_SOURCES} + ${ROCPROFILER_LIB_TRACING_HEADERS}) diff --git a/source/lib/tests/buffering/CMakeLists.txt b/source/lib/tests/buffering/CMakeLists.txt index d4c95e8c..d6c5576e 100644 --- a/source/lib/tests/buffering/CMakeLists.txt +++ b/source/lib/tests/buffering/CMakeLists.txt @@ -11,8 +11,9 @@ add_executable(buffering-test) target_sources(buffering-test PRIVATE ${buffering_sources}) target_link_libraries( buffering-test - PRIVATE rocprofiler-sdk::rocprofiler-headers - rocprofiler-sdk::rocprofiler-common-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-headers + rocprofiler-sdk::rocprofiler-sdk-common-library GTest::gtest + GTest::gtest_main) gtest_add_tests( TARGET buffering-test diff --git a/source/lib/tests/common/CMakeLists.txt b/source/lib/tests/common/CMakeLists.txt index e914001f..1b26131e 100644 --- a/source/lib/tests/common/CMakeLists.txt +++ b/source/lib/tests/common/CMakeLists.txt @@ -11,8 +11,9 @@ add_executable(common-tests) target_sources(common-tests PRIVATE ${common_sources}) target_link_libraries( common-tests - PRIVATE rocprofiler-sdk::rocprofiler-headers - rocprofiler-sdk::rocprofiler-common-library GTest::gtest GTest::gtest_main) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-headers + rocprofiler-sdk::rocprofiler-sdk-common-library GTest::gtest + GTest::gtest_main) gtest_add_tests( TARGET common-tests diff --git a/source/libexec/rocprofv3-trigger-list-metrics/CMakeLists.txt b/source/libexec/rocprofv3-trigger-list-metrics/CMakeLists.txt index a8b65bb9..3a958c0c 100644 --- a/source/libexec/rocprofv3-trigger-list-metrics/CMakeLists.txt +++ b/source/libexec/rocprofv3-trigger-list-metrics/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "tools") add_executable(rocprofv3-trigger-list-metrics) target_sources(rocprofv3-trigger-list-metrics PRIVATE rocprofv3_trigger_list_metrics.cpp) target_link_libraries(rocprofv3-trigger-list-metrics - PRIVATE rocprofiler-sdk::rocprofiler-hsa-runtime) + PRIVATE rocprofiler-sdk::rocprofiler-sdk-hsa-runtime) set_target_properties( rocprofv3-trigger-list-metrics PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR} diff --git a/tests/async-copy-tracing/CMakeLists.txt b/tests/async-copy-tracing/CMakeLists.txt index f35a112e..eaa0e30d 100644 --- a/tests/async-copy-tracing/CMakeLists.txt +++ b/tests/async-copy-tracing/CMakeLists.txt @@ -22,7 +22,7 @@ add_test(NAME test-async-copy-tracing-execute COMMAND $) set(async-copy-tracing-env "${PRELOAD_ENV}" "ROCPROFILER_TOOL_OUTPUT_FILE=async-copy-tracing-test.json" - "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" + "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" ) set_tests_properties( diff --git a/tests/c-tool/CMakeLists.txt b/tests/c-tool/CMakeLists.txt index 4dcca34d..ee9689bb 100644 --- a/tests/c-tool/CMakeLists.txt +++ b/tests/c-tool/CMakeLists.txt @@ -21,7 +21,7 @@ add_test(NAME test-c-tool-execute COMMAND $ 1) set(c-tool-env "${PRELOAD_ENV}" - "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" + "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" ) set_tests_properties( @@ -44,7 +44,7 @@ add_test(NAME test-c-tool-rocp-tool-lib-execute COMMAND $ set(c-tool-rocp-tool-lib-env "${ROCPROFILER_MEMCHECK_PRELOAD_ENV}" "ROCP_TOOL_LIBRARIES=$" - "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" + "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" ) set_tests_properties( diff --git a/tests/common/CMakeLists.txt b/tests/common/CMakeLists.txt index eda118d6..ee8c28f1 100644 --- a/tests/common/CMakeLists.txt +++ b/tests/common/CMakeLists.txt @@ -37,22 +37,23 @@ set(AMDGPU_TARGETS FORCE) # build flags -add_library(rocprofiler-tests-build-flags INTERFACE) -add_library(rocprofiler-sdk::tests-build-flags ALIAS rocprofiler-tests-build-flags) -target_compile_options(rocprofiler-tests-build-flags INTERFACE -W -Wall -Wextra -Wshadow) -target_compile_features(rocprofiler-tests-build-flags INTERFACE cxx_std_17) +add_library(rocprofiler-sdk-tests-build-flags INTERFACE) +add_library(rocprofiler-sdk::tests-build-flags ALIAS rocprofiler-sdk-tests-build-flags) +target_compile_options(rocprofiler-sdk-tests-build-flags INTERFACE -W -Wall -Wextra + -Wshadow) +target_compile_features(rocprofiler-sdk-tests-build-flags INTERFACE cxx_std_17) if(ROCPROFILER_BUILD_CI OR ROCPROFILER_BUILD_WERROR) - target_compile_options(rocprofiler-tests-build-flags INTERFACE -Werror) + target_compile_options(rocprofiler-sdk-tests-build-flags INTERFACE -Werror) endif() # serialization library -if(NOT TARGET rocprofiler-sdk::rocprofiler-cereal) +if(NOT TARGET rocprofiler-sdk::rocprofiler-sdk-cereal) get_filename_component(ROCPROFILER_SOURCE_DIR "${PROJECT_SOURCE_DIR}/.." REALPATH) - add_library(rocprofiler-cereal INTERFACE) - add_library(rocprofiler-sdk::rocprofiler-cereal ALIAS rocprofiler-cereal) - target_compile_definitions(rocprofiler-cereal + add_library(rocprofiler-sdk-cereal INTERFACE) + add_library(rocprofiler-sdk::rocprofiler-sdk-cereal ALIAS rocprofiler-sdk-cereal) + target_compile_definitions(rocprofiler-sdk-cereal INTERFACE $) if(EXISTS ${ROCPROFILER_SOURCE_DIR}/external AND COMMAND @@ -65,7 +66,7 @@ if(NOT TARGET rocprofiler-sdk::rocprofiler-cereal) REPO_BRANCH "rocprofiler") target_include_directories( - rocprofiler-cereal SYSTEM + rocprofiler-sdk-cereal SYSTEM INTERFACE $ ) else() @@ -85,12 +86,12 @@ if(NOT TARGET rocprofiler-sdk::rocprofiler-cereal) endif() target_include_directories( - rocprofiler-cereal SYSTEM + rocprofiler-sdk-cereal SYSTEM INTERFACE $) endif() endif() -if(NOT TARGET rocprofiler-sdk::rocprofiler-perfetto) +if(NOT TARGET rocprofiler-sdk::rocprofiler-sdk-perfetto) # perfetto fetchcontent_declare( perfetto @@ -106,34 +107,35 @@ if(NOT TARGET rocprofiler-sdk::rocprofiler-perfetto) fetchcontent_populate(perfetto) endif() - add_library(rocprofiler-tests-perfetto STATIC) - add_library(rocprofiler-sdk::tests-perfetto ALIAS rocprofiler-tests-perfetto) + add_library(rocprofiler-sdk-tests-perfetto STATIC) + add_library(rocprofiler-sdk::tests-perfetto ALIAS rocprofiler-sdk-tests-perfetto) target_sources( - rocprofiler-tests-perfetto + rocprofiler-sdk-tests-perfetto PRIVATE ${PROJECT_BINARY_DIR}/external/perfetto/sdk/perfetto.h ${PROJECT_BINARY_DIR}/external/perfetto/sdk/perfetto.cc) target_include_directories( - rocprofiler-tests-perfetto SYSTEM + rocprofiler-sdk-tests-perfetto SYSTEM INTERFACE $) - set_target_properties(rocprofiler-tests-perfetto PROPERTIES POSITION_INDEPENDENT_CODE - ON) + set_target_properties(rocprofiler-sdk-tests-perfetto + PROPERTIES POSITION_INDEPENDENT_CODE ON) else() - add_library(rocprofiler-tests-perfetto INTERFACE) - add_library(rocprofiler-sdk::tests-perfetto ALIAS rocprofiler-tests-perfetto) - target_link_libraries(rocprofiler-tests-perfetto - INTERFACE rocprofiler-sdk::rocprofiler-perfetto) + add_library(rocprofiler-sdk-tests-perfetto INTERFACE) + add_library(rocprofiler-sdk::tests-perfetto ALIAS rocprofiler-sdk-tests-perfetto) + target_link_libraries(rocprofiler-sdk-tests-perfetto + INTERFACE rocprofiler-sdk::rocprofiler-sdk-perfetto) endif() # common utilities cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH COMMON_LIBRARY_INCLUDE_DIR) -add_library(rocprofiler-tests-common-library INTERFACE) -add_library(rocprofiler-sdk::tests-common-library ALIAS rocprofiler-tests-common-library) +add_library(rocprofiler-sdk-tests-common-library INTERFACE) +add_library(rocprofiler-sdk::tests-common-library ALIAS + rocprofiler-sdk-tests-common-library) target_link_libraries( - rocprofiler-tests-common-library INTERFACE rocprofiler-sdk::tests-build-flags - rocprofiler-sdk::rocprofiler-cereal) -target_compile_features(rocprofiler-tests-common-library INTERFACE cxx_std_17) -target_include_directories(rocprofiler-tests-common-library + rocprofiler-sdk-tests-common-library + INTERFACE rocprofiler-sdk::tests-build-flags rocprofiler-sdk::rocprofiler-sdk-cereal) +target_compile_features(rocprofiler-sdk-tests-common-library INTERFACE cxx_std_17) +target_include_directories(rocprofiler-sdk-tests-common-library INTERFACE ${COMMON_LIBRARY_INCLUDE_DIR}) set(EXTERNAL_SUBMODULE_DIR "${PROJECT_SOURCE_DIR}/../external") @@ -141,10 +143,10 @@ cmake_path(ABSOLUTE_PATH EXTERNAL_SUBMODULE_DIR NORMALIZE) if(EXISTS ${EXTERNAL_SUBMODULE_DIR}/filesystem/include/ghc/filesystem.hpp) target_compile_definitions( - rocprofiler-tests-common-library + rocprofiler-sdk-tests-common-library INTERFACE $) target_include_directories( - rocprofiler-tests-common-library SYSTEM + rocprofiler-sdk-tests-common-library SYSTEM INTERFACE $) endif() diff --git a/tests/hip-graph-tracing/CMakeLists.txt b/tests/hip-graph-tracing/CMakeLists.txt index 1f30ff54..38d5214f 100644 --- a/tests/hip-graph-tracing/CMakeLists.txt +++ b/tests/hip-graph-tracing/CMakeLists.txt @@ -27,7 +27,7 @@ add_test(NAME test-hip-graph-tracing-execute COMMAND $) set(hip-graph-tracing-env "${PRELOAD_ENV}" "ROCPROFILER_TOOL_OUTPUT_FILE=hip-graph-tracing-test.json" - "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" + "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" "ROCPROFILER_TOOL_CONTEXTS=HIP_API_CALLBACK,HIP_API_BUFFERED,KERNEL_DISPATCH_CALLBACK,KERNEL_DISPATCH_BUFFERED,CODE_OBJECT" ) diff --git a/tests/kernel-tracing/CMakeLists.txt b/tests/kernel-tracing/CMakeLists.txt index 41b3ccc2..2e49494c 100644 --- a/tests/kernel-tracing/CMakeLists.txt +++ b/tests/kernel-tracing/CMakeLists.txt @@ -27,7 +27,7 @@ add_test(NAME test-kernel-tracing-execute COMMAND $:$ENV{LD_LIBRARY_PATH}" + "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" ) set_tests_properties( diff --git a/tests/page-migration/CMakeLists.txt b/tests/page-migration/CMakeLists.txt index f2a1454d..d7c06508 100644 --- a/tests/page-migration/CMakeLists.txt +++ b/tests/page-migration/CMakeLists.txt @@ -22,7 +22,7 @@ add_test(NAME test-page-migration-execute COMMAND $) set(page-migration-env "${PRELOAD_ENV}" "ROCPROFILER_TOOL_OUTPUT_FILE=page-migration-test.json" - "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" + "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" ) set_tests_properties( diff --git a/tests/scratch-memory-tracing/CMakeLists.txt b/tests/scratch-memory-tracing/CMakeLists.txt index 28d8b4a0..a080039c 100644 --- a/tests/scratch-memory-tracing/CMakeLists.txt +++ b/tests/scratch-memory-tracing/CMakeLists.txt @@ -22,7 +22,7 @@ add_test(NAME test-scratch-memory-tracing-execute COMMAND $:$ENV{LD_LIBRARY_PATH}" + "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" ) set_tests_properties( diff --git a/tests/tools/CMakeLists.txt b/tests/tools/CMakeLists.txt index 5e481462..7ba19852 100644 --- a/tests/tools/CMakeLists.txt +++ b/tests/tools/CMakeLists.txt @@ -15,7 +15,7 @@ add_library(rocprofiler-sdk-json-tool SHARED) target_sources(rocprofiler-sdk-json-tool PRIVATE json-tool.cpp) target_link_libraries( rocprofiler-sdk-json-tool - PRIVATE rocprofiler-sdk::rocprofiler-sdk rocprofiler-sdk::rocprofiler-cereal + PRIVATE rocprofiler-sdk::rocprofiler-sdk rocprofiler-sdk::rocprofiler-sdk-cereal rocprofiler-sdk::tests-build-flags rocprofiler-sdk::tests-common-library rocprofiler-sdk::tests-perfetto) set_target_properties(