Skip to content

Commit

Permalink
Merge pull request #167 from masterleinad/find_vtune_linux
Browse files Browse the repository at this point in the history
Don't require Caliper to find ITT
  • Loading branch information
dalg24 authored Mar 10, 2023
2 parents f979c8f + 7bf8544 commit 7ad4156
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions cmake/FindITT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,22 @@ elseif(NOT USE_LIB64)
endif()
#--------------------------------------------------------------------------------#

if(MSVC)

if(KokkosTools_ENABLE_CALIPER)
# Just reuse find module implemented in Caliper
set(ITT_PREFIX ${VTune_ROOT})
include(${PROJECT_SOURCE_DIR}/tpls/Caliper/cmake/FindITTAPI.cmake)
else()
# 2022-02-14: find_library() can't locate libittnotify.lib on Windows - not sure why...
# using find_file() instead as a workaround
get_property(USE_LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if(USE_LIB64)
find_file(ITT_LIBRARY libittnotify.lib ${VTune_ROOT}/lib64)
find_file(ITT_LIBRARY libittnotify${CMAKE_STATIC_LIBRARY_SUFFIX} ${VTune_ROOT}/lib64)
else()
find_file(ITT_LIBRARY libittnotify.lib ${VTune_ROOT}/lib32)
find_file(ITT_LIBRARY libittnotify${CMAKE_STATIC_LIBRARY_SUFFIX} ${VTune_ROOT}/lib32)
endif()
find_path(ITT_INCLUDE_DIR NAMES ittnotify.h HINTS ${VTune_ROOT}/include)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ITT DEFAULT_MSG ITT_LIBRARY ITT_INCLUDE_DIR)

else()

# Just reuse find module implemented in Caliper
set(ITT_PREFIX ${VTune_ROOT})
include(${PROJECT_SOURCE_DIR}/tpls/Caliper/cmake/FindITTAPI.cmake)

endif()

# Set up imported target
Expand Down

0 comments on commit 7ad4156

Please sign in to comment.