CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
81 lines
2.7 KiB
CMake
81 lines
2.7 KiB
CMake
# ======================================================================================
|
|
# Builds OTF2
|
|
# ======================================================================================
|
|
|
|
set(ROCPROFILER_BINARY_DIR ${PROJECT_BINARY_DIR})
|
|
set(OTF2_VERSION
|
|
"3.0.3"
|
|
CACHE STRING "OTF2 version")
|
|
set(OTF2_URL_HASH
|
|
"SHA256=18a3905f7917340387e3edc8e5766f31ab1af41f4ecc5665da6c769ca21c4ee8"
|
|
CACHE STRING "OTF2 URL download hash")
|
|
|
|
project(
|
|
OTF2
|
|
LANGUAGES C
|
|
VERSION ${OTF2_VERSION}
|
|
DESCRIPTION "Open Trace Format v2"
|
|
HOMEPAGE_URL "https://perftools.pages.jsc.fz-juelich.de/cicd/otf2")
|
|
|
|
include(FetchContent)
|
|
include(ExternalProject)
|
|
include(ProcessorCount)
|
|
|
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
|
cmake_policy(SET CMP0135 NEW)
|
|
endif()
|
|
|
|
set(FETCHCONTENT_BASE_DIR ${ROCPROFILER_BINARY_DIR}/external/packages)
|
|
|
|
# Only OTF2 3.0.3 is uploaded to S3. If another otf2 release is added, update the URL,
|
|
# OTF2_VERSION, and OTF2_URL_HASH
|
|
if(NOT ${OTF2_VERSION} STREQUAL "3.0.3")
|
|
message(FATAL_ERROR "Unsupported OTF2 version: ${OTF2_VERSION}")
|
|
endif()
|
|
|
|
fetchcontent_declare(
|
|
otf2-source
|
|
URL https://rocm-third-party-deps.s3.us-east-2.amazonaws.com/otf2-${OTF2_VERSION}.tar.gz
|
|
URL_HASH ${OTF2_URL_HASH})
|
|
|
|
fetchcontent_makeavailable(otf2-source)
|
|
|
|
set(_otf2_root ${ROCPROFILER_BINARY_DIR}/external/otf2)
|
|
set(_otf2_inc_dirs $<BUILD_INTERFACE:${_otf2_root}/include>)
|
|
set(_otf2_lib_dirs $<BUILD_INTERFACE:${_otf2_root}/${CMAKE_INSTALL_LIBDIR}>)
|
|
set(_otf2_libs
|
|
$<BUILD_INTERFACE:${_otf2_root}/${CMAKE_INSTALL_LIBDIR}/libotf2${CMAKE_STATIC_LIBRARY_SUFFIX}>
|
|
)
|
|
set(_otf2_build_byproducts
|
|
"${_otf2_root}/include/otf2/otf2.h"
|
|
"${_otf2_root}/${CMAKE_INSTALL_LIBDIR}/libotf2${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
find_program(
|
|
MAKE_COMMAND
|
|
NAMES make gmake
|
|
PATH_SUFFIXES bin REQUIRED)
|
|
|
|
externalproject_add(
|
|
otf2-build
|
|
PREFIX ${_otf2_root}
|
|
SOURCE_DIR ${otf2-source_SOURCE_DIR}
|
|
BUILD_IN_SOURCE 1
|
|
DOWNLOAD_COMMAND ""
|
|
PATCH_COMMAND ""
|
|
CONFIGURE_COMMAND
|
|
${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
|
|
<SOURCE_DIR>/configure -q --enable-silent-rules --prefix=${_otf2_root}
|
|
--libdir=${_otf2_root}/${CMAKE_INSTALL_LIBDIR} CFLAGS=-fPIC\ -O3\ -g
|
|
CXXFLAGS=-fPIC\ -O3\ -g LDFLAGS= PYTHON=: SPHINX=:
|
|
BUILD_COMMAND ${MAKE_COMMAND} install -s
|
|
BUILD_BYPRODUCTS "${_otf2_build_byproducts}"
|
|
INSTALL_COMMAND "")
|
|
|
|
add_library(otf2 INTERFACE)
|
|
add_library(otf2::otf2 ALIAS otf2)
|
|
target_include_directories(otf2 SYSTEM INTERFACE ${_otf2_inc_dirs})
|
|
target_link_directories(otf2 INTERFACE ${_otf2_lib_dirs})
|
|
target_link_libraries(otf2 INTERFACE ${_otf2_libs})
|
|
|
|
add_dependencies(otf2 otf2-build)
|