Files
rocm-systems/cmake/rocprofiler_config_install.cmake
T
Jonathan R. Madsen 1edd4891b2 ROCTx Library (#360)
* Initial implementation of roctx library

* Update include/roctx/CMakeLists.txt

- fix installation

* Update cmake/rocprofiler_config_packaging.cmake

- add rocprofiler-sdk-roctx installer

* Update include/roctx/CMakeLists.txt

- include api_trace.h in installation

* Update include/roctx/api_trace.h

- add ROCTX_API_TABLE_VERSION_MAJOR define
- add ROCTX_API_TABLE_VERSION_STEP define

* Update lib/roctx/roctx.cpp

- static asserts for table size and struct member offsets

* Update external/CMakeLists.txt

- move BUILD_SHARED_LIBS to top
- disable libunwind for glog

* Update lib/roctx/CMakeLists.txt

- Update {BUILD,INSTALL}_RPATH

* Relocate include/roctx to include/rocprofiler-sdk/roctx

* Relocate lib/roctx to lib/rocprofiler-sdk-roctx

- change the name of the library from libroctx to librocprofiler-sdk-roctx

* Move lib/plugins to lib/rocprofiler-sdk-tool/plugins

- also change install export group

* Update lib/rocprofiler-sdk/CMakeLists.txt

- change rocprofiler-shared-library EXPORT group (rocprofiler-sdk-library-targets -> rocprofiler-sdk-targets)

* Update cmake/rocprofiler_utilities.cmake

- change install EXPORT group
  - rocprofiler-sdk-library-targets -> rocprofiler-sdk-targets

* Update CMakeLists.txt

- set PACKAGE_NAME at high level
- include(rocprofiler_config_install_roctx)

* Update cmake/rocprofiler_config_install* and cmake/Templates/*.cmake.in

- added rocprofiler_config_install_roctx.cmake for installing roctx as a package
- reorganization of existing cmake/Templates/*-config.cmake.in files
- created new config.cmake.in and build-config.cmake.in for rocprofiler-sdk-roctx

* Relocate include/rocprofiler-sdk/roctx to include/rocprofiler-sdk-roctx

* Update rocprofiler_config_install_roctx.cmake

* Update lib/rocprofiler-sdk-roctx/roctx.cpp

- update include paths

* Update lib/rocprofiler-sdk-roctx/CMakeLists.txt

- change target name to have rocprofiler-sdk- prefix
- interface target_include_directories
- define export symbol

* source formatting (clang-format v11) (#361)

Co-authored-by: jrmadsen <jrmadsen@users.noreply.github.com>

* Update include/rocprofiler-sdk/fwd.h

- fix doxygen markup for ROCPROFILER_STATUS_ERROR_CONTEXT_ERROR

* Update modulefile and setup-env.sh

* Update cmake/Templates/rocprofiler-sdk/config.cmake.in

- fix inclusion of rocprofiler-sdk-targets.cmake

* Update include/rocprofiler-sdk-roctx

- add types.h for typedefs
- add doxygen comments for roctx.h
- add roctxGetThreadId function
- roctxProfilerStart and roctxProfilerStop accept thread ID param

* Update lib/rocprofiler-sdk-roctx/roctx.cpp

- hsa_agent_t* -> hsa_agent_s*

* Update lib/rocprofiler-sdk-roctx/roctx.cpp

- support for roctxGetThreadId
- update signatures of roctxProfilerPause and roctxProfilerResume

* Update lib/rocprofiler-sdk-roctx/roctx.cpp

- Initialize logging with ROCTX_LOG_LEVEL

* Update include/rocprofiler-sdk-roctx/roctx.h

- remove ROCTX_NONNULL for ihipStream_t parameter in roctxNameHipStream because default stream is a nullptr

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-17 01:27:41 -06:00

110 baris
4.0 KiB
CMake

# include guard
include_guard(GLOBAL)
include(CMakePackageConfigHelpers)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME development)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/samples
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}
COMPONENT samples)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/tests
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}
COMPONENT tests)
install(
EXPORT ${PACKAGE_NAME}-targets
FILE ${PACKAGE_NAME}-targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}
COMPONENT development)
# ------------------------------------------------------------------------------#
# install tree
#
set(PROJECT_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
set(PROJECT_BUILD_TARGETS headers shared-library)
set(PROJECT_EXTRA_DIRS "${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}"
"${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME}")
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/Templates/${PACKAGE_NAME}/config.cmake.in
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}/${PACKAGE_NAME}-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}
INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
PATH_VARS PROJECT_INSTALL_DIR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR)
write_basic_package_version_file(
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}/${PACKAGE_NAME}-config-version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMinorVersion)
configure_file(
${PROJECT_SOURCE_DIR}/cmake/rocprofiler_config_nolink_target.cmake
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}-sdk/${PROJECT_NAME}-sdk-config-nolink-target.cmake
COPYONLY)
install(
FILES
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}/${PACKAGE_NAME}-config.cmake
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}/${PACKAGE_NAME}-config-version.cmake
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}/${PACKAGE_NAME}-config-nolink-target.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}
COMPONENT development)
export(PACKAGE ${PROJECT_NAME})
# ------------------------------------------------------------------------------#
# build tree
#
set(${PACKAGE_NAME}_BUILD_TREE
ON
CACHE BOOL "" FORCE)
set(PROJECT_BUILD_TREE_TARGETS headers shared-library build-flags stack-protector)
configure_file(
${PROJECT_SOURCE_DIR}/cmake/Templates/${PACKAGE_NAME}/build-config.cmake.in
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}/${PACKAGE_NAME}-build-config.cmake
@ONLY)
file(RELATIVE_PATH rocp_bin2src_rel_path ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR})
string(REPLACE "//" "/" rocp_inc_rel_path "${rocp_bin2src_rel_path}/source/include")
set(_BUILDTREE_EXPORT_DIR
"${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PACKAGE_NAME}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink ${rocp_inc_rel_path}
${PROJECT_BINARY_DIR}/include WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
if(NOT EXISTS "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
endif()
if(NOT EXISTS "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME}")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME}")
endif()
if(NOT EXISTS "${_BUILDTREE_EXPORT_DIR}")
file(MAKE_DIRECTORY "${_BUILDTREE_EXPORT_DIR}")
endif()
if(NOT EXISTS "${_BUILDTREE_EXPORT_DIR}/${PACKAGE_NAME}-targets.cmake")
file(TOUCH "${_BUILDTREE_EXPORT_DIR}/${PACKAGE_NAME}-targets.cmake")
endif()
export(
EXPORT ${PACKAGE_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
FILE "${_BUILDTREE_EXPORT_DIR}/${PACKAGE_NAME}-targets.cmake")
set(${PACKAGE_NAME}_DIR
"${_BUILDTREE_EXPORT_DIR}"
CACHE PATH "${PACKAGE_NAME} build tree install" FORCE)