Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ It can be set by the user in different locations if needed.
git clone https://github.com/ROCm/rocprofiler-sdk.git rocprofiler-sdk-source
cmake \
-B rocprofiler-sdk-build \
-D ROCPROFILER_BUILD_TOOLS=ON \
-D ROCPROFILER_BUILD_TESTS=ON \
-D ROCPROFILER_BUILD_SAMPLES=ON \
-D CMAKE_INSTALL_PREFIX=/opt/rocm \
Expand Down
36 changes: 20 additions & 16 deletions cmake/rocprofiler_config_install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,29 @@ if(ROCPROFILER_BUILD_DOCS)
COMPONENT docs)
endif()

install(
FILES ${PROJECT_SOURCE_DIR}/LICENSE
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PACKAGE_NAME}-tests
COMPONENT tests)
if(ROCPROFILER_BUILD_SAMPLES)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/samples
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}
COMPONENT samples)
endif()

install(
DIRECTORY ${PROJECT_SOURCE_DIR}/samples
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}
COMPONENT samples)
if(ROCPROFILER_BUILD_TESTS)
install(
FILES ${PROJECT_SOURCE_DIR}/LICENSE
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PACKAGE_NAME}-tests
COMPONENT tests)

install(
DIRECTORY ${PROJECT_SOURCE_DIR}/tests
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}
COMPONENT tests)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/tests
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}
COMPONENT tests)

install(
FILES ${PROJECT_SOURCE_DIR}/requirements.txt
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}/tests
COMPONENT tests)
install(
FILES ${PROJECT_SOURCE_DIR}/requirements.txt
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}/tests
COMPONENT tests)
endif()

install(
EXPORT ${PACKAGE_NAME}-targets
Expand Down
13 changes: 11 additions & 2 deletions cmake/rocprofiler_config_packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,18 @@ set(COMPONENT_DESC_docs "rocprofiler-sdk documentation")
set(COMPONENT_DESC_tests "rocprofiler-sdk tests")
set(COMPONENT_DESC_roctx "ROCm Tools Extension library and headers")

set(EXPECTED_PACKAGING_COMPONENTS 6)
set(EXPECTED_PACKAGING_COMPONENTS 3)
if(ROCPROFILER_BUILD_TOOLS)
math(EXPR EXPECTED_PACKAGING_COMPONENTS "${EXPECTED_PACKAGING_COMPONENTS} + 1" DECIMAL)
endif()
if(ROCPROFILER_BUILD_DOCS)
set(EXPECTED_PACKAGING_COMPONENTS 7)
math(EXPR EXPECTED_PACKAGING_COMPONENTS "${EXPECTED_PACKAGING_COMPONENTS} + 1" DECIMAL)
endif()
if(ROCPROFILER_BUILD_SAMPLES)
math(EXPR EXPECTED_PACKAGING_COMPONENTS "${EXPECTED_PACKAGING_COMPONENTS} + 1" DECIMAL)
endif()
if(ROCPROFILER_BUILD_TESTS)
math(EXPR EXPECTED_PACKAGING_COMPONENTS "${EXPECTED_PACKAGING_COMPONENTS} + 1" DECIMAL)
endif()

if(NOT NUM_ROCPROFILER_PACKAGING_COMPONENTS EQUAL EXPECTED_PACKAGING_COMPONENTS)
Expand Down
2 changes: 2 additions & 0 deletions cmake/rocprofiler_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rocprofiler_add_option(
ROCPROFILER_BUILD_CI "Enable continuous integration default values for options" OFF
ADVANCED)

rocprofiler_add_option(ROCPROFILER_BUILD_TOOLS "Enable building the tools"
${ROCPROFILER_BUILD_CI})
rocprofiler_add_option(ROCPROFILER_BUILD_TESTS "Enable building the tests"
${ROCPROFILER_BUILD_CI})
rocprofiler_add_option(ROCPROFILER_BUILD_SAMPLES "Enable building the code samples"
Expand Down
74 changes: 40 additions & 34 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,28 +167,30 @@ if(ROCPROFILER_BUILD_DOCS)
endif()

# perfetto
rocprofiler_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/perfetto
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
TEST_FILE meson.build
REPO_URL https://android.googlesource.com/platform/external/perfetto external/perfetto
REPO_BRANCH "v44.0")

add_library(rocprofiler-sdk-perfetto-static-library STATIC)
target_sources(
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-sdk-perfetto-static-library SYSTEM
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/perfetto/sdk>)
set_target_properties(
rocprofiler-sdk-perfetto-static-library
PROPERTIES POSITION_INDEPENDENT_CODE ON OUTPUT_NAME rocprofiler-sdk-perfetto)
target_link_libraries(
rocprofiler-sdk-perfetto
INTERFACE $<BUILD_INTERFACE:rocprofiler-sdk-perfetto-static-library>)
if(ROCPROFILER_BUILD_TOOLS)
rocprofiler_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/perfetto
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
TEST_FILE meson.build
REPO_URL https://android.googlesource.com/platform/external/perfetto external/perfetto
REPO_BRANCH "v44.0")

add_library(rocprofiler-sdk-perfetto-static-library STATIC)
target_sources(
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-sdk-perfetto-static-library SYSTEM
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/perfetto/sdk>)
set_target_properties(
rocprofiler-sdk-perfetto-static-library
PROPERTIES POSITION_INDEPENDENT_CODE ON OUTPUT_NAME rocprofiler-sdk-perfetto)
target_link_libraries(
rocprofiler-sdk-perfetto
INTERFACE $<BUILD_INTERFACE:rocprofiler-sdk-perfetto-static-library>)
endif()

# ELFIO
rocprofiler_checkout_git_submodule(
Expand All @@ -208,18 +210,22 @@ if(TARGET rocprofiler-sdk-elfio)
endif()

# OTF2
add_subdirectory(otf2)
if(ROCPROFILER_BUILD_TOOLS)
add_subdirectory(otf2)
endif()

rocprofiler_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/json
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/nlohmann/json.git
REPO_BRANCH "develop")
if(ROCPROFILER_BUILD_TOOLS)
rocprofiler_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/json
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/nlohmann/json.git
REPO_BRANCH "develop")

add_subdirectory(json)
add_subdirectory(json)

# target_link_libraries(rocprofiler-sdk-json INTERFACE $<BUILD_INTERFACE:json::json>)
target_include_directories(
rocprofiler-sdk-json SYSTEM
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/json/include>)
# target_link_libraries(rocprofiler-sdk-json INTERFACE $<BUILD_INTERFACE:json::json>)
target_include_directories(
rocprofiler-sdk-json SYSTEM
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/json/include>)
endif()
6 changes: 4 additions & 2 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ rocprofiler_activate_clang_tidy()

add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(libexec)
add_subdirectory(bin)
if(ROCPROFILER_BUILD_TOOLS)
add_subdirectory(libexec)
add_subdirectory(bin)
endif()
add_subdirectory(docs)
add_subdirectory(scripts)
3 changes: 2 additions & 1 deletion source/docs/install/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Building ROCprofiler-SDK
git clone https://github.com/ROCm/rocprofiler-sdk.git rocprofiler-sdk-source
cmake \
-B rocprofiler-sdk-build \
-D ROCPROFILER_BUILD_TOOLS=ON \
-D ROCPROFILER_BUILD_TESTS=ON \
-D ROCPROFILER_BUILD_SAMPLES=ON \
-D CMAKE_INSTALL_PREFIX=/opt/rocm \
Expand Down Expand Up @@ -95,4 +96,4 @@ To run the built tests, ``cd`` into the ``rocprofiler-sdk-build`` directory and

.. code-block:: bash

/usr/local/bin/python -m pip install -r requirements.txt
/usr/local/bin/python -m pip install -r requirements.txt
16 changes: 10 additions & 6 deletions source/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
#
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "core")
add_subdirectory(common)
add_subdirectory(output)
if(ROCPROFILER_BUILD_TOOLS)
add_subdirectory(output)
endif()
add_subdirectory(rocprofiler-sdk)

set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "tools")
add_subdirectory(rocprofiler-sdk-codeobj)
add_subdirectory(rocprofiler-sdk-roctx)
add_subdirectory(rocprofiler-sdk-att)
add_subdirectory(rocprofiler-sdk-tool)

if(ROCPROFILER_BUILD_TOOLS)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "tools")
add_subdirectory(rocprofiler-sdk-codeobj)
add_subdirectory(rocprofiler-sdk-att)
add_subdirectory(rocprofiler-sdk-tool)
endif()

if(ROCPROFILER_BUILD_TESTS)
add_subdirectory(tests)
Expand Down
1 change: 1 addition & 0 deletions source/lib/rocprofiler-sdk/counters/metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <dlfcn.h> // for dladdr
#include <cstdint>
#include <cstdlib>
#include <fstream>
#include <memory>
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <unistd.h>
#include <algorithm>
#include <cstring>
#include <deque>
#include <fstream>
#include <mutex>
#include <unordered_map>
Expand Down
Loading