Skip to content

Commit

Permalink
#2183: Setup CMake to use LDMS lib
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Sep 30, 2023
1 parent cacd48a commit f8db3aa
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ else()
option(vt_libfort_enabled "Build VT with fort library enabled" OFF)
endif()

option(vt_ldms_enabled "Build VT with LDMS" OFF)
option(vt_mimalloc_enabled "Build VT with mimalloc" OFF)
option(vt_mimalloc_static "Build VT with mimalloc using static linking" ON)
option(vt_asan_enabled "Build VT with address sanitizer" OFF)
Expand Down
10 changes: 10 additions & 0 deletions cmake/configure_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ else()
set(vt_feature_cmake_fcontext "0")
endif()

if (${vt_ldms_enabled})
message(STATUS "LDMS enabled")
message(STATUS "LDMS: vt_ldms_includes:${vt_ldms_includes}")
message(STATUS "LDMS: vt_ldms_libs:${vt_ldms_libs}")
set(vt_feature_cmake_ldms "1")
else()
message(STATUS "LDMS disabled")
set(vt_feature_cmake_ldms "0")
endif()

if (${vt_mimalloc_enabled})
message(STATUS "mimalloc enabled")
set(vt_feature_cmake_mimalloc "1")
Expand Down
13 changes: 13 additions & 0 deletions cmake/link_vt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,19 @@ function(link_target_with_vt)
)
endif()

if (${vt_ldms_enabled})
if (${ARG_DEBUG_LINK})
message(STATUS "link_target_with_vt: ldms=${vt_ldms_enabled}")
endif()
target_include_directories(${ARG_TARGET} SYSTEM PUBLIC
${vt_ldms_includes}
)
target_link_directories(${ARG_TARGET} PUBLIC ${vt_ldms_libs})
target_link_libraries(
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} :libldms.so :libldmsd_stream.so
)
endif()

if (${ARG_CUSTOM_LINK_ARGS})
if (${ARG_DEBUG_LINK})
message(STATUS "link_target_with_vt: custom=${ARG_CUSTOM_LINK_ARGS}")
Expand Down
1 change: 1 addition & 0 deletions cmake_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define vt_feature_cmake_priority_bits_level @vt_feature_cmake_priority_bits_level@
#define vt_feature_cmake_priorities @vt_feature_cmake_priorities@
#define vt_feature_cmake_fcontext @vt_feature_cmake_fcontext@
#define vt_feature_cmake_ldms @vt_feature_cmake_ldms@
#define vt_feature_cmake_test_trace_on @vt_feature_cmake_test_trace_on@
#define vt_feature_cmake_mimalloc @vt_feature_cmake_mimalloc@
#define vt_feature_cmake_mpi_access_guards @vt_feature_cmake_mpi_access_guards@
Expand Down
1 change: 1 addition & 0 deletions src/vt/configs/features/features_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#define vt_feature_memory_pool 0 || vt_feature_cmake_memory_pool
#define vt_feature_priorities 0 || vt_feature_cmake_priorities
#define vt_feature_fcontext 0 || vt_feature_cmake_fcontext
#define vt_feature_ldms 0 || vt_feature_ldms
#define vt_feature_mimalloc 0 || vt_feature_cmake_mimalloc
#define vt_feature_mpi_access_guards 0 || vt_feature_cmake_mpi_access_guards
#define vt_feature_zoltan 0 || vt_feature_cmake_zoltan
Expand Down

0 comments on commit f8db3aa

Please sign in to comment.