Skip to content

Commit

Permalink
adding optional caliper dependency (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
landinjm authored Dec 20, 2024
1 parent 21b73fd commit 0710491
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ endif()

deal_ii_initialize_cached_variables()

# Caliper
set(PRISMS_PF_WITH_CALIPER OFF CACHE BOOL "Whether the user wants to compile PRISMS-PF with the profiling code Caliper, or not.")
message(STATUS "Using PRISMS_PF_WITH_CALIPER = '${PRISMS_PF_WITH_CALIPER}'")
if(PRISMS_PF_WITH_CALIPER)
find_package(CALIPER)
if(${CALIPER_FOUND})
include_directories(${CALIPER_INCLUDE_DIR})
message(STATUS "Caliper found at ${CALIPER_DIR}")
else()
message(FATAL_ERROR "Caliper not found. Disable PRISMS_PF_WITH_CALIPER or specify a hint to your installation directory with CALIPER_DIR")
endif()
endif()

# Create compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(FORCE_COLORED_OUTPUT ON CACHE BOOL "Forces colored output when compiling with gcc and clang.")
Expand Down
1 change: 1 addition & 0 deletions include/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
#cmakedefine PRISMS_PF_SOURCE_DIR "@PRISMS_PF_SOURCE_DIR@"

// Optional features:
#cmakedefine PRISMS_PF_WITH_CALIPER

#endif

0 comments on commit 0710491

Please sign in to comment.