Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 619af58

Browse files
committed
Add support for GPerftools to taxi benchmark
1 parent 9ff396a commit 619af58

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

omniscidb/Benchmarks/taxi/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ add_executable(${bench_name} taxi_reduced_bench.cpp)
44
target_link_libraries(${bench_name} ${EXECUTE_TEST_LIBS} benchmark)
55

66
add_executable(taxi_full taxi_full_bench.cpp)
7-
target_link_libraries(taxi_full ${EXECUTE_TEST_LIBS} benchmark)
7+
target_link_options(taxi_full PUBLIC "LINKER:--no-as-needed")
8+
target_link_libraries(taxi_full ${PROFILER_LIBS} ${EXECUTE_TEST_LIBS} benchmark)

omniscidb/CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
3131
# Force -O0 optimization level for debug builds.
3232
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
3333

34+
set(PROFILER_LIBS "")
35+
option(ENABLE_PROFILER "Enable Gperftools linking" OFF)
36+
if(ENABLE_PROFILER)
37+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fPIC")
38+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fPIC")
39+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
40+
find_package(Gperftools REQUIRED COMPONENTS TCMALLOC PROFILER)
41+
set(PROFILER_LIBS ${Gperftools_TCMALLOC} ${Gperftools_PROFILER})
42+
add_definitions("-DHAVE_PROFILER")
43+
endif()
44+
3445
if("${CMAKE_VERSION}" VERSION_GREATER 3.11.999)
3546
cmake_policy(SET CMP0074 NEW)
3647
endif()
@@ -608,14 +619,6 @@ if(TIME_LIMITED_BUILD)
608619
set(MAPD_PACKAGE_FLAGS "${MAPD_PACKAGE_FLAGS}-${TIME_LIMITED_NUMBER_OF_DAYS}d")
609620
endif()
610621

611-
option(ENABLE_PROFILER "Enable google perftools" OFF)
612-
if(ENABLE_PROFILER)
613-
find_package(Gperftools REQUIRED COMPONENTS TCMALLOC PROFILER)
614-
set(PROFILER_LIBS ${Gperftools_TCMALLOC} ${Gperftools_PROFILER})
615-
add_definitions("-DHAVE_PROFILER")
616-
else()
617-
set(PROFILER_LIBS "")
618-
endif()
619622

620623
add_subdirectory(SqliteConnector)
621624

0 commit comments

Comments
 (0)