File: 0004-dynamic-package-prefix.patch

package info (click to toggle)
rocm-compilersupport 5.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,224 kB
  • sloc: cpp: 6,826; ansic: 3,464; asm: 1,144; lisp: 226; sh: 21; makefile: 12
file content (51 lines) | stat: -rw-r--r-- 2,450 bytes parent folder | download
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
Description: find_package(amd_comgr) cannot include amd_comgr-targets.cmake
 When attempting to build HIP using the instructions provided in
 https://gist.github.com/cgmb/edb7b790ab55681fb2ba5385ee02489b, if the
 change to /usr/lib/x86_64-linux-gnu/cmake/amd_comgr/amd_comgr-config.cmake
 is skipped, then the build will fail with the error:
 .
  CMake Error at /usr/lib/x86_64-linux-gnu/cmake/amd_comgr/amd_comgr-config.cmake:8 (include):
    include could not find requested file:
 .
      /usr/lib/lib/cmake/amd_comgr/amd_comgr-targets.cmake
  Call Stack (most recent call first):
    /root/ROCclr-rocm-5.1.1/cmake/ROCclrLC.cmake:21 (find_package)
    /root/ROCclr-rocm-5.1.1/cmake/ROCclr.cmake:129 (include)
    src/cmake/FindROCclr.cmake:51 (include)
    src/CMakeLists.txt:51 (find_package)
 .
 This error is introduced by the patches 0004-Relocate-cmake-export.patch
 and 0005-cmake-exports-continued.patch, which change some places where
 AMD_COMGR_PACKAGE_PREFIX is used, but leave others unchanged, resulting
 in inconsistencies. I recommend dropping those patches and replacing them
 with a patch that fixes the behaviour earlier in the file (thereby keeping
 it more consistent later):
Author: Cordell Bloor <cgmb-deb@slerp.xyz>
Bug-Debian: https://bugs.debian.org/1010649
Forwarded: no
Last-Update: 2022-05-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- rocm-compilersupport.orig/lib/comgr/CMakeLists.txt
+++ rocm-compilersupport/lib/comgr/CMakeLists.txt
@@ -256,11 +256,6 @@
 set(AMD_COMGR_PREFIX_CODE "
 # Derive absolute install prefix from config file path.
 get_filename_component(AMD_COMGR_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
-string(REGEX REPLACE "/" ";" count "${AMD_COMGR_PACKAGE_PREFIX}")
-foreach(p ${count})
-  set(AMD_COMGR_PREFIX_CODE "${AMD_COMGR_PREFIX_CODE}
-get_filename_component(AMD_COMGR_PREFIX \"\${AMD_COMGR_PREFIX}\" PATH)")
-endforeach()
 
 if (NOT COMGR_BUILD_SHARED_LIBS)
   string(APPEND AMD_COMGR_PREFIX_CODE "\ninclude(CMakeFindDependencyMacro)\n")
@@ -268,7 +263,7 @@
   string(APPEND AMD_COMGR_PREFIX_CODE "find_dependency(LLD REQUIRED)\n")
 endif()
 
-set(AMD_COMGR_TARGETS_PATH "\${AMD_COMGR_PREFIX}/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
+set(AMD_COMGR_TARGETS_PATH "\${AMD_COMGR_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
 configure_file("cmake/${AMD_COMGR_CONFIG_NAME}.in"
   "${CMAKE_CURRENT_BINARY_DIR}/${AMD_COMGR_CONFIG_NAME}.install"
   @ONLY)