From 5db64b5425458faa80c9f79c173fd3b1a9384400 Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Fri, 13 Sep 2024 03:16:06 -0500 Subject: [PATCH] Fix OTF2 build dependency (#1080) - systems with many cores (e.g. 128) had a race condition between compiling generateOTF2.cpp and the otf2-build make install step [ROCm/rocprofiler-sdk commit: 92c0c9d252e212d31b984374fd55266a55015093] --- .../external/otf2/CMakeLists.txt | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/projects/rocprofiler-sdk/external/otf2/CMakeLists.txt b/projects/rocprofiler-sdk/external/otf2/CMakeLists.txt index b1ee50c76d..fd31757699 100644 --- a/projects/rocprofiler-sdk/external/otf2/CMakeLists.txt +++ b/projects/rocprofiler-sdk/external/otf2/CMakeLists.txt @@ -32,18 +32,14 @@ fetchcontent_declare( URL https://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-${OTF2_VERSION}/otf2-${OTF2_VERSION}.tar.gz URL_HASH ${OTF2_URL_HASH}) -fetchcontent_getproperties(ot2f-source) - -if(NOT ot2f-source_POPULATED) - message(STATUS "Downloading OTF2...") - fetchcontent_populate(otf2-source) -endif() +fetchcontent_makeavailable(otf2-source) set(_otf2_root ${ROCPROFILER_BINARY_DIR}/external/otf2) set(_otf2_inc_dirs $) set(_otf2_lib_dirs $) set(_otf2_libs $) -set(_otf2_build_byproducts "${_otf2_root}/lib/libotf2${CMAKE_STATIC_LIBRARY_SUFFIX}") +set(_otf2_build_byproducts "${_otf2_root}/include/otf2/otf2.h" + "${_otf2_root}/lib/libotf2${CMAKE_STATIC_LIBRARY_SUFFIX}") find_program( MAKE_COMMAND @@ -56,12 +52,12 @@ externalproject_add( SOURCE_DIR ${otf2-source_SOURCE_DIR} BUILD_IN_SOURCE 1 DOWNLOAD_COMMAND "" - PATCH_COMMAND + PATCH_COMMAND "" + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} - /configure -q --prefix=${_otf2_root} CFLAGS=-fPIC\ -O3\ -g - CXXFLAGS=-fPIC\ -O3\ -g LDFLAGS= PYTHON=: SPHINX=: - CONFIGURE_COMMAND ${MAKE_COMMAND} install -s - BUILD_COMMAND "" + /configure -q --enable-silent-rules --prefix=${_otf2_root} + CFLAGS=-fPIC\ -O3\ -g CXXFLAGS=-fPIC\ -O3\ -g LDFLAGS= PYTHON=: SPHINX=: + BUILD_COMMAND ${MAKE_COMMAND} install -s BUILD_BYPRODUCTS "${_otf2_build_byproducts}" INSTALL_COMMAND "") @@ -70,3 +66,5 @@ 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)