ROCm / rocprofiler

ROC profiler library. Profiling with perf-counters and derived metrics.
https://rocm.docs.amd.com/projects/rocprofiler/en/latest/
Other
116 stars 44 forks source link

non-default builds seem to be really hard #67

Open lfmeadow opened 2 years ago

lfmeadow commented 2 years ago

I'm trying to hack my way around it. I just want to build a local copy of the library etc. All the use of cmake envirables is making it difficult. e.g.: CMAKE_INSTALL_PREFIX=~/tools/rocprofiler/install CMAKE_PREFIX_PATH=/opt/rocm/include/hsa:/opt/rocm cmake .. end up with CMake-install-prefix: /usr/local CPack-install-prefix: /usr/local

Also it doesn't find libhsakmt.so apparently not in 4.5.2: /opt/rocm-4.5.2/lib64/cmake/hsakmt /opt/rocm-4.5.2/lib64/cmake/hsakmt/hsakmt-config.cmake /opt/rocm-4.5.2/lib64/cmake/hsakmt/hsakmtTargets-release.cmake /opt/rocm-4.5.2/lib64/cmake/hsakmt/hsakmtTargets.cmake /opt/rocm-4.5.2/lib64/cmake/hsakmt/hsakmt-config-version.cmake /opt/rocm-4.5.2/lib64/libhsakmt.a /opt/rocm-4.5.2/include/hsakmttypes.h /opt/rocm-4.5.2/include/hsakmt.h /opt/rocm-4.5.2/share/doc/hsakmt /opt/rocm-4.5.2/share/pkgconfig/libhsakmt.pc

Is it on the github somewhere? Thanks.

Hacked around it:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e1df75..0551493 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@
 cmake_minimum_required ( VERSION 2.8.12 )

 # Install prefix
-set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "Install path prefix default")
+#set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "Install path prefix default")

 ## Verbose output.
 set ( CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL "Verbose Output" FORCE )
diff --git a/cmake_modules/env.cmake b/cmake_modules/env.cmake
index 30e86c1..c8ca290 100644
--- a/cmake_modules/env.cmake
+++ b/cmake_modules/env.cmake
@@ -108,12 +108,15 @@ elseif ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86" )
 endif ()

 ## Find hsa-runtime headers/lib
-find_file ( HSA_RUNTIME_INC "hsa/hsa.h" )
-find_library ( HSA_RUNTIME_LIB "libhsa-runtime${NBIT}.so" )
+#find_file ( HSA_RUNTIME_INC "hsa/hsa.h" )
+#find_library ( HSA_RUNTIME_LIB "libhsa-runtime${NBIT}.so" )
+set ( HSA_RUNTIME_INC "/opt/rocm/include/hsa/hsa.h" )
+set ( HSA_RUNTIME_LIB "/opt/rocm/lib/libhsa-runtime64.so" )
 get_filename_component ( HSA_RUNTIME_INC_PATH "${HSA_RUNTIME_INC}" DIRECTORY )
 get_filename_component ( HSA_RUNTIME_LIB_PATH "${HSA_RUNTIME_LIB}" DIRECTORY )

-find_library ( HSA_KMT_LIB "libhsakmt.so" )
+#find_library ( HSA_KMT_LIB "libhsakmt.so" )
+set ( HSA_KMT_LIB "/opt/rocm-4.5.2/lib64/libhsakmt.a" )
 get_filename_component ( HSA_KMT_LIB_PATH "${HSA_KMT_LIB}" DIRECTORY )
 get_filename_component ( ROCM_ROOT_DIR "${HSA_KMT_LIB_PATH}" DIRECTORY )