Files
rocm-systems/examples/lulesh/CMakeLists.txt
T
Jonathan R. Madsen d04cbe862e fix omnitrace print-* with libraries (#94)
* fix omnitrace print-* with libraries

* timemory submodule update

* Update workflows to use ./bin/omnitrace instead of ./omnitrace

* cmake format

* update timemory submodule

- fix ODR violations in utility/procfs

* cmake updates

- uniform find_package for all ROCm-based libraries

* tweak transpose example

- throw exception instead of std::exit

* Inspect cmdv name before assuming not exe

- some ELF execs "think" they are libraries so only assume rewrite + simulate + all-functions if filename looks like library
- adds some test for --print-available -- <library>

* Fix _has_lib_prefix when command is < 3

* Updates and reverts to omnitrace exe

- update module_function operator< and operator==
- add function_signature operator<
- refactor module_function ctor
- revert some previous changes w.r.t. simulate and include_unninstr

* Fix source/bin/tests to use same output dir as tests

* cmake format

* Segfault mitigation + refactor + modify function iteration

- refactor module_function ctor to avoid segfaults
- string_t -> std::string
- replace std::string with std::string_view in some places
- get_name(module_t*)
- get_name(procedure_t*)
- disable using both app_modules and app_functions
- new option: --parse-all-modules to iterate over app_modules
- removed some unused code w.r.t. debug info

* Disable module_function address range for uninstrumentable functions

* Disable module_function address range for uninstrumentable functions

* Refactored getting file/line info and init/fini

- use dyninst insertInitCallback and insertFiniCallback if main not found
- fixed all issues with segmentation faults in --simulate --all-functions

* revert changes to Findrocprofiler.cmake
2022-07-21 01:15:41 -05:00

76 wiersze
2.4 KiB
CMake

cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(lulesh LANGUAGES C CXX)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake/Modules)
option(LULESH_BUILD_KOKKOS "Build Kokkos from submodule" ON)
if(LULESH_BUILD_KOKKOS)
add_subdirectory(external)
if(LULESH_USE_CUDA)
kokkos_compilation(PROJECT)
elseif(LULESH_USE_HIP AND NOT "${CMAKE_CXX_COMPILER}" MATCHES "hipcc")
if(NOT HIPCC_EXECUTABLE)
find_package(hip QUIET HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
find_program(
HIPCC_EXECUTABLE
NAMES hipcc
HINTS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm)
mark_as_advanced(HIPCC_EXECUTABLE)
endif()
kokkos_compilation(PROJECT COMPILER ${HIPCC_EXECUTABLE})
endif()
else()
find_package(Kokkos REQUIRED COMPONENTS separable_compilation)
kokkos_compilation(PROJECT)
endif()
set(CMAKE_CXX_EXTENSIONS OFF)
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE
"Release"
CACHE STRING "CMake build type" FORCE)
endif()
option(LULESH_USE_MPI "Enable MPI" OFF)
add_library(lulesh-mpi INTERFACE)
if(LULESH_USE_MPI)
find_package(MPI REQUIRED)
target_compile_definitions(lulesh-mpi INTERFACE USE_MPI=1)
target_link_libraries(lulesh-mpi INTERFACE MPI::MPI_C MPI::MPI_CXX)
else()
target_compile_definitions(lulesh-mpi INTERFACE USE_MPI=0)
endif()
if(NOT TARGET Kokkos::kokkos)
find_package(Kokkos REQUIRED)
endif()
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hxx)
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cc)
add_executable(${PROJECT_NAME} ${sources} ${headers})
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/includes)
target_link_libraries(${PROJECT_NAME} PRIVATE Kokkos::kokkos lulesh-mpi)
if(OMNITRACE_INSTALL_EXAMPLES)
if(LULESH_BUILD_KOKKOS)
install(
TARGETS kokkoscore kokkoscontainers
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT omnitrace-examples)
set_target_properties(
${PROJECT_NAME} PROPERTIES INSTALL_RPATH
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()
install(
TARGETS ${PROJECT_NAME}
DESTINATION bin
COMPONENT omnitrace-examples)
endif()