From 271f017251b97688bb9c0e3d246a66ec2ee261f2 Mon Sep 17 00:00:00 2001 From: "Galantsev, Dmitrii" Date: Wed, 8 Jan 2025 22:47:44 -0600 Subject: [PATCH] OTF2 - Fix lib vs lib64 location on some systems (#68) On my dev machine I use OpenSUSE Tumbleweed. For some reason OTF2 gets installed into BUILD/external/otf2/lib64/, while cmake for the lib searches BUILD/external/otf2/lib and cannot find it. My fix sets the location to always match CMAKE_INSTALL_LIBDIR Signed-off-by: Galantsev, Dmitrii --- external/otf2/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/external/otf2/CMakeLists.txt b/external/otf2/CMakeLists.txt index fd31757699..65ea4837d0 100644 --- a/external/otf2/CMakeLists.txt +++ b/external/otf2/CMakeLists.txt @@ -36,10 +36,13 @@ 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}/include/otf2/otf2.h" - "${_otf2_root}/lib/libotf2${CMAKE_STATIC_LIBRARY_SUFFIX}") +set(_otf2_lib_dirs $) +set(_otf2_libs + $ + ) +set(_otf2_build_byproducts + "${_otf2_root}/include/otf2/otf2.h" + "${_otf2_root}/${CMAKE_INSTALL_LIBDIR}/libotf2${CMAKE_STATIC_LIBRARY_SUFFIX}") find_program( MAKE_COMMAND @@ -56,7 +59,8 @@ externalproject_add( CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} /configure -q --enable-silent-rules --prefix=${_otf2_root} - CFLAGS=-fPIC\ -O3\ -g CXXFLAGS=-fPIC\ -O3\ -g LDFLAGS= PYTHON=: SPHINX=: + --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 "")