Merge pull request #4798 from akva2/tracy_option

added: build system option to enable Tracy profiler
This commit is contained in:
Bård Skaflestad 2023-08-15 17:40:13 +02:00 committed by GitHub
commit 207e57804d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,7 @@ option(USE_CHOW_PATEL_ILU_GPU_PARALLEL "Try to use more parallelism on the GPU d
option(BUILD_FLOW_ALU_GRID "Build flow blackoil with alu grid" OFF)
option(USE_DAMARIS_LIB "Use the Damaris library for asynchronous I/O?" OFF)
option(USE_BDA_BRIDGE "Enable the BDA bridge (GPU/AMGCL solvers)" ON)
option(USE_TRACY_PROFILER "Enable tracy profiling" OFF)
# The following was copied from CMakeLists.txt in opm-common.
# TODO: factor out the common parts in opm-common and opm-simulator as a cmake module
@ -258,6 +259,12 @@ macro (config_hook)
add_definitions(-DFMT_HEADER_ONLY)
list(APPEND EXTRA_INCLUDES SYSTEM ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
endif()
if(USE_TRACY_PROFILER AND Tracy_FOUND)
set(USE_TRACY 1)
list(APPEND opm-simulators_LIBRARIES Tracy::TracyClient)
else()
set(USE_TRACY)
endif()
include_directories(${EXTRA_INCLUDES})
include(UseDamaris)

View File

@ -22,6 +22,7 @@ set (opm-simulators_CONFIG_VAR
HAVE_SUITESPARSE_UMFPACK
HAVE_DAMARIS
HAVE_HDF5
USE_TRACY
)
# dependencies
@ -54,6 +55,7 @@ set (opm-simulators_DEPS
"opm-models REQUIRED"
"Damaris 1.7"
"HDF5"
"Tracy"
)
find_package_deps(opm-simulators)