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 ...)`
Цей коміт міститься в:
зафіксовано
GitHub
джерело
d93d4d9463
коміт
74facf87a6
@@ -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()
|
||||
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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@
|
||||
|
||||
@@ -11,15 +11,15 @@ include(FindPackageHandleStandardArgs)
|
||||
include(rocprofiler_compilers)
|
||||
include(rocprofiler_utilities)
|
||||
|
||||
target_compile_definitions(rocprofiler-build-flags INTERFACE $<$<CONFIG:DEBUG>:DEBUG>)
|
||||
target_compile_definitions(rocprofiler-sdk-build-flags INTERFACE $<$<CONFIG:DEBUG>: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 $<$<COMPILE_LANGUAGE:C>:$<$<C_COMPILER_ID:GNU>:-rdynamic>>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-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
|
||||
$<$<CXX_COMPILER_ID:GNU>:-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 $<$<COMPILE_LANGUAGE:C>:$<$<C_COMPILER_ID:GNU>:-static-libgcc>>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-static-libgcc>>)
|
||||
target_link_options(
|
||||
rocprofiler-static-libgcc INTERFACE
|
||||
rocprofiler-sdk-static-libgcc INTERFACE
|
||||
$<$<COMPILE_LANGUAGE:C>:$<$<C_COMPILER_ID:GNU,Clang>:-static-libgcc>>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU,Clang>:-static-libgcc>>)
|
||||
|
||||
target_compile_options(
|
||||
rocprofiler-static-libstdcxx
|
||||
rocprofiler-sdk-static-libstdcxx
|
||||
INTERFACE $<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-static-libstdc++>>)
|
||||
target_link_options(
|
||||
rocprofiler-static-libstdcxx INTERFACE
|
||||
rocprofiler-sdk-static-libstdcxx INTERFACE
|
||||
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU,Clang>:-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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,15 +10,15 @@ include(rocprofiler_config_nolink_target)
|
||||
# ########################################################################################
|
||||
|
||||
target_include_directories(
|
||||
rocprofiler-headers
|
||||
rocprofiler-sdk-headers
|
||||
INTERFACE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/source/include>
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/include>
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
|
||||
target_compile_definitions(
|
||||
rocprofiler-headers INTERFACE $<BUILD_INTERFACE:AMD_INTERNAL_BUILD=1>
|
||||
$<BUILD_INTERFACE:__HIP_PLATFORM_AMD__=1>)
|
||||
rocprofiler-sdk-headers INTERFACE $<BUILD_INTERFACE:AMD_INTERNAL_BUILD=1>
|
||||
$<BUILD_INTERFACE:__HIP_PLATFORM_AMD__=1>)
|
||||
|
||||
# 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()
|
||||
|
||||
@@ -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"
|
||||
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-perfetto "Enables Perfetto support"
|
||||
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-otf2 "Enables OTF2 support" INTERNAL)
|
||||
rocprofiler_add_interface_library(rocprofiler-cereal "Enables Cereal support" INTERNAL)
|
||||
rocprofiler_add_interface_library(rocprofiler-compile-definitions "Compile definitions"
|
||||
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-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-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-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-cxx-filesystem "C++ filesystem library"
|
||||
INTERNAL)
|
||||
rocprofiler_add_interface_library(rocprofiler-yaml-cpp "YAML CPP Parser" INTERNAL)
|
||||
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-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_add_interface_library(
|
||||
rocprofiler-hsa-runtime-nolink
|
||||
"rocprofiler-hsa-runtime without linking to HSA library" IMPORTED)
|
||||
rocprofiler_add_interface_library(
|
||||
rocprofiler-hsakmt-nolink "rocprofiler-hsakmt without linking to HSAKMT library"
|
||||
rocprofiler-sdk-hip-nolink "rocprofiler-sdk-hip without linking to HIP library"
|
||||
IMPORTED)
|
||||
rocprofiler_add_interface_library(rocprofiler-rccl-nolink
|
||||
rocprofiler_add_interface_library(
|
||||
rocprofiler-sdk-hsa-runtime-nolink
|
||||
"rocprofiler-sdk-hsa-runtime without linking to HSA library" IMPORTED)
|
||||
rocprofiler_add_interface_library(
|
||||
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)
|
||||
|
||||
@@ -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 $<BUILD_INTERFACE:-g3 -Og -fno-omit-frame-pointer
|
||||
-fno-optimize-sibling-calls -fno-inline-functions -fsanitize=${_FLAG}>)
|
||||
target_link_options(rocprofiler-memcheck INTERFACE
|
||||
target_link_options(rocprofiler-sdk-memcheck INTERFACE
|
||||
$<BUILD_INTERFACE:-fsanitize=${_FLAG} -Wl,--no-undefined>)
|
||||
|
||||
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
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача