Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing lib search path on SLES (which is using lib64) #13

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
780ef88
SWDEV-467873 - making lib install path configurable
ajanicijamd Oct 21, 2024
11eb47f
Fixed formatting
ajanicijamd Oct 21, 2024
940e672
Fixed formatting
ajanicijamd Oct 21, 2024
1b46573
Setting default libdir to lib64 for opensuse build
ajanicijamd Oct 22, 2024
39c120c
Set -DCMAKE_DEFAULT_INSTALL_LIBDIR=lib for redhat build
ajanicijamd Oct 22, 2024
74deaae
Modified timemory
ajanicijamd Oct 22, 2024
5014b1d
Changed CMAKE_DEFAULT_INSTALL_LIBDIR to CMAKE_INSTALL_LIBDIR
ajanicijamd Oct 22, 2024
b6bfa3a
Fixed formatting
ajanicijamd Oct 22, 2024
856cf47
Added diagnostic message
ajanicijamd Oct 22, 2024
2bb5d1a
Added diagnostic message
ajanicijamd Oct 22, 2024
c2b2551
Removed diagnostic message, modified *LIBDIR
ajanicijamd Oct 22, 2024
e336b40
Fixed formatting
ajanicijamd Oct 22, 2024
a6769f4
Modified install library path for PAPI
ajanicijamd Oct 23, 2024
1d86312
Fixed formatting
ajanicijamd Oct 23, 2024
196038b
Modified CMake scripts
ajanicijamd Oct 24, 2024
376d6a4
Modified CMake scripts in submodule dyninst
ajanicijamd Oct 24, 2024
bf2102b
Removed unnecessary setting from workflow YAML files
ajanicijamd Oct 25, 2024
53bcfdb
Modified CMake scripts
ajanicijamd Oct 25, 2024
3cfa730
Fixed formatting
ajanicijamd Oct 25, 2024
682b0a1
Modified workflow files
ajanicijamd Oct 25, 2024
5d73408
Modified workflow files
ajanicijamd Oct 25, 2024
3c22365
Modified CMake scripts
ajanicijamd Oct 25, 2024
768dbd3
Fixed formatting
ajanicijamd Oct 25, 2024
1d86b84
Modified build scripts
ajanicijamd Oct 28, 2024
832164d
Fixed formatting
ajanicijamd Oct 28, 2024
bb2a68a
Fixed formatting
ajanicijamd Oct 28, 2024
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
25 changes: 14 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,20 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(_STRIP_LIBRARIES_DEFAULT ON)
endif()

if(DEFINED CMAKE_INSTALL_LIBDIR AND NOT DEFINED CMAKE_DEFAULT_INSTALL_LIBDIR)
# always have a fresh install
unset(CMAKE_INSTALL_LIBDIR CACHE)
include(GNUInstallDirs) # install directories
# force this because dyninst always installs to lib
set(CMAKE_DEFAULT_INSTALL_LIBDIR
"${CMAKE_INSTALL_LIBDIR}"
CACHE STRING "Object code libraries" FORCE)
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
if(DEFINED CMAKE_DEFAULT_INSTALL_LIBDIR)
# always have a fresh install
unset(CMAKE_INSTALL_LIBDIR CACHE)
include(GNUInstallDirs) # install directories
# force this because dyninst always installs to lib
set(CMAKE_INSTALL_LIBDIR
"${CMAKE_DEFAULT_INSTALL_LIBDIR}"
CACHE STRING "Object code libraries" FORCE)
else()
set(CMAKE_INSTALL_LIBDIR
"lib"
CACHE STRING "Object code libraries" FORCE)
endif()
endif()

if(NOT "$ENV{ROCPROFSYS_CI}" STREQUAL "")
Expand Down Expand Up @@ -150,9 +156,6 @@ endif()
include(Compilers) # compiler identification
include(BuildSettings) # compiler flags

set(CMAKE_INSTALL_LIBDIR
"lib"
CACHE STRING "Object code libraries (lib)" FORCE)
set(CMAKE_CXX_STANDARD
17
CACHE STRING "CXX language standard")
Expand Down
13 changes: 8 additions & 5 deletions cmake/ElfUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ endif()

set(_eu_root ${PROJECT_BINARY_DIR}/external/elfutils)
set(_eu_inc_dirs $<BUILD_INTERFACE:${_eu_root}/include>)
set(_eu_lib_dirs $<BUILD_INTERFACE:${_eu_root}/lib>)
set(_eu_libs $<BUILD_INTERFACE:${_eu_root}/lib/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}>
$<BUILD_INTERFACE:${_eu_root}/lib/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}>)
set(_eu_build_byproducts "${_eu_root}/lib/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${_eu_root}/lib/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(_eu_lib_dirs $<BUILD_INTERFACE:${_eu_root}/${CMAKE_INSTALL_LIBDIR}>)
set(_eu_libs
$<BUILD_INTERFACE:${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}>
$<BUILD_INTERFACE:${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}>
)
set(_eu_build_byproducts
"${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}")

externalproject_add(
rocprofiler-systems-elfutils-build
Expand Down
35 changes: 19 additions & 16 deletions cmake/PAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@ if(NOT EXISTS "${ROCPROFSYS_PAPI_INSTALL_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
${ROCPROFSYS_PAPI_INSTALL_DIR}/include)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib)
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR})
execute_process(
COMMAND
${CMAKE_COMMAND} -E touch ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so)
${CMAKE_COMMAND} -E touch
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so)
set(_ROCPROFSYS_PAPI_BUILD_BYPRODUCTS
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so)
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so)
endif()

rocprofiler_systems_add_option(ROCPROFSYS_PAPI_AUTO_COMPONENTS
Expand Down Expand Up @@ -232,11 +233,13 @@ add_custom_target(
rocprofiler-systems-papi-clean
COMMAND ${MAKE_EXECUTABLE} distclean
COMMAND ${CMAKE_COMMAND} -E rm -rf ${ROCPROFSYS_PAPI_INSTALL_DIR}/include/*
COMMAND ${CMAKE_COMMAND} -E rm -rf ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/*
COMMAND ${CMAKE_COMMAND} -E rm -rf
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/*
COMMAND
${CMAKE_COMMAND} -E touch ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so
${CMAKE_COMMAND} -E touch
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so
WORKING_DIRECTORY ${ROCPROFSYS_PAPI_SOURCE_DIR}/src
COMMENT "Cleaning PAPI...")

Expand All @@ -247,16 +250,16 @@ set(PAPI_INCLUDE_DIR
${ROCPROFSYS_PAPI_INSTALL_DIR}/include
CACHE PATH "PAPI include folder" FORCE)
set(PAPI_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_pfm_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_STATIC_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_pfm_STATIC_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
CACHE FILEPATH "PAPI library" FORCE)

target_include_directories(rocprofiler-systems-papi SYSTEM
Expand All @@ -269,7 +272,7 @@ rocprofiler_systems_target_compile_definitions(
$<BUILD_INTERFACE:TIMEMORY_USE_PAPI=1>)

install(
DIRECTORY ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/
DIRECTORY ${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT papi
FILES_MATCHING
Expand Down
3 changes: 2 additions & 1 deletion cmake/Packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,8 @@ install(
COMPONENT gotcha)
if(ROCPROFSYS_BUILD_LIBUNWIND)
install(
DIRECTORY ${PROJECT_BINARY_DIR}/external/timemory/external/libunwind/install/lib/
DIRECTORY
${PROJECT_BINARY_DIR}/external/timemory/external/libunwind/install/${CMAKE_INSTALL_LIBDIR}/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT libunwind
FILES_MATCHING
Expand Down
2 changes: 1 addition & 1 deletion external/dyninst
2 changes: 1 addition & 1 deletion external/timemory
Loading