summaryrefslogtreecommitdiff
path: root/pkgs/development/rocm-modules/rocprof-trace-decoder/use-system-dependencies.patch
blob: 1f821a11108820bc4edcb7f5388cb1f7dafe0030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a923cad..53b0f49 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -34,13 +34,7 @@ if(DISABLE_COMGR)
 endif()
 
 if(NOT APPLE AND BUILD_INTEGRATION_TESTS)
-    # Add nlohmann JSON as an external dependency
-    include(FetchContent)
-    FetchContent_Declare(
-        json
-        GIT_REPOSITORY https://github.com/nlohmann/json.git
-        GIT_TAG v3.11.3)
-    FetchContent_MakeAvailable(json)
+    find_package(nlohmann_json REQUIRED)
 
     add_subdirectory(att-tool)
 endif()
diff --git a/test/att-tool/CMakeLists.txt b/test/att-tool/CMakeLists.txt
index 208af16..acd161f 100644
--- a/test/att-tool/CMakeLists.txt
+++ b/test/att-tool/CMakeLists.txt
@@ -1,7 +1,7 @@
 #
 # ATT decoder wrapper library for use by the rocprofv3 tool
 #
-find_library(COMGR REQUIRED NAMES amd_comgr HINTS /opt/rocm/lib)
+find_library(COMGR REQUIRED NAMES amd_comgr)
 
 set(ATT_TOOL_SOURCE_FILES
     waitcnt/analysis.cpp
@@ -19,8 +19,11 @@ set(ATT_TOOL_SOURCE_FILES
 
 set(DECODER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../source/)
 
-set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR} ${json_SOURCE_DIR}/include /opt/rocm/include)
-set(LINK_LIBS ${COMGR} pthread)
+set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR})
+find_path(COMGR_INCLUDE_DIR REQUIRED NAMES amd_comgr.h PATH_SUFFIXES amd_comgr)
+find_path(HSA_INCLUDE_DIR REQUIRED NAMES hsa/amd_hsa_elf.h)
+set(LINK_LIBS ${COMGR} pthread nlohmann_json::nlohmann_json)
+list(APPEND INCLUDE_DIRS ${COMGR_INCLUDE_DIR} ${HSA_INCLUDE_DIR})
 
 # Sources re-globbed only for sanitizer builds
 file(GLOB ATT_DECODER_V3_FILES
diff --git a/test/att-tool/sdk/disassembly.hpp b/test/att-tool/sdk/disassembly.hpp
index c054143..ec3d6d2 100644
--- a/test/att-tool/sdk/disassembly.hpp
+++ b/test/att-tool/sdk/disassembly.hpp
@@ -22,7 +22,7 @@
 
 #pragma once
 
-#include <amd_comgr/amd_comgr.h>
+#include <amd_comgr.h>
 #include <hsa/amd_hsa_elf.h>
 
 #include <fcntl.h>
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 8adafc0..9501efe 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -9,16 +9,7 @@ project(att-decoder-unit-tests LANGUAGES CXX)
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# Fetch GoogleTest
-include(FetchContent)
-FetchContent_Declare(
-    googletest
-    GIT_REPOSITORY https://github.com/google/googletest.git
-    GIT_TAG v1.14.0)
-set(INSTALL_GTEST
-    OFF
-    CACHE BOOL "" FORCE)
-FetchContent_MakeAvailable(googletest)
+find_package(GTest REQUIRED)
 
 enable_testing()