Skip to content

Commit

Permalink
Revert "Reintroduce the option to profile with Tracy"
Browse files Browse the repository at this point in the history
This reverts commit 75f4edf, as we believe its changes are not yet ready for release. Tracy is configured through CMake options, part of which are converted to C++ compile definitions. Since they affect both Tracy's binary and headers, the same options/definitions must be set when compiling Tracy's system library, wavemap C++ library (CMake), and its ROS1 interface (catkin). A complicating factor is that catkin ignores standard CMake features like inheriting a linked library's PUBLIC definitions. We will reintroduce Tracy-support once we find a cleaner, less error-prone way to integrate it into the project.
  • Loading branch information
victorreijgwart committed Nov 25, 2024
1 parent 75f4edf commit 57ad3bc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
4 changes: 2 additions & 2 deletions interfaces/ros1/wavemap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../library/cpp

# Include the library's tests in catkin's run_tests target
include(cmake/append_to_catkin_tests.cmake)
append_to_catkin_tests(test_wavemap_core)
append_to_catkin_tests(test_wavemap_io)
append_to_catkin_tests(test_wavemap_core)

# Support installs
# Mark targets for installation
Expand All @@ -38,6 +38,6 @@ install(TARGETS wavemap_core wavemap_io wavemap_pipeline
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
# Mark headers for installation
install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/../../../library/cpp/include/wavemap/"
${CMAKE_CURRENT_SOURCE_DIR}/../../../library/cpp/include/wavemap/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h")
1 change: 0 additions & 1 deletion library/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ option(BUILD_SHARED_LIBS
option(USE_SYSTEM_EIGEN "Use system pre-installed Eigen" ON)
option(USE_SYSTEM_GLOG "Use system pre-installed glog" ON)
option(USE_SYSTEM_BOOST "Use system pre-installed Boost" ON)
option(TRACY_ENABLE "Enable profiling with Tracy" OFF)

# CMake helpers and general wavemap tooling (e.g. to run clang-tidy CI)
include(GNUInstallDirs)
Expand Down
12 changes: 1 addition & 11 deletions library/cpp/cmake/find-wavemap-deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,4 @@ else ()
endif ()

# Optional dependencies
if (TRACY_ENABLE)
find_package(Tracy QUIET)
if (NOT Tracy_FOUND)
message(FATAL_ERROR
"Profiling is enabled (TRACY_ENABLE=ON), but Tracy is not available. "
"Please switch it to OFF or install Tracy as a system package with: "
"cmake -S . -B build -DTRACY_ENABLE=ON -DBUILD_SHARED_LIBS=true "
"-DCMAKE_BUILD_TYPE=Release && cmake --build build --parallel && "
"sudo make install")
endif ()
endif ()
find_package(tracy QUIET)
5 changes: 0 additions & 5 deletions library/cpp/cmake/wavemap-extras.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ function(set_wavemap_target_properties target)
# General C++ defines
target_compile_definitions(${target} PUBLIC EIGEN_INITIALIZE_MATRICES_BY_NAN)

# Profiling related C++ defines
if (TRACY_ENABLE)
target_compile_definitions(${target} PUBLIC TRACY_ENABLE)
endif ()

# Conditional compilation options
if (DCHECK_ALWAYS_ON)
target_compile_definitions(${target} PUBLIC DCHECK_ALWAYS_ON)
Expand Down
4 changes: 2 additions & 2 deletions library/cpp/src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set_wavemap_target_properties(wavemap_core)
add_wavemap_include_directories(wavemap_core)
target_link_libraries(wavemap_core
PUBLIC Eigen3::Eigen glog Boost::preprocessor)
if (Tracy_FOUND)
target_link_libraries(wavemap_core PUBLIC TracyClient dl)
if (tracy_FOUND)
target_link_libraries(wavemap_core PUBLIC TracyClient)
endif ()

# Set sources
Expand Down

0 comments on commit 57ad3bc

Please sign in to comment.