[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1010649: libamd-comgr-dev: find_package(amd_comgr) cannot include amd_comgr-targets.cmake



Package: libamd-comgr-dev
Version: 5.1.0-1
Severity: important
X-Debbugs-Cc: cgmb-deb@slerp.xyz

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):

--- rocm-compilersupport-5.1.0.orig/lib/comgr/CMakeLists.txt
+++ rocm-compilersupport-5.1.0/lib/comgr/CMakeLists.txt
@@ -210,7 +210,7 @@ target_include_directories(amd_comgr
 set(AMD_COMGR_CONFIG_NAME amd_comgr-config.cmake)
 set(AMD_COMGR_TARGETS_NAME amd_comgr-targets.cmake)
 set(AMD_COMGR_VERSION_NAME amd_comgr-config-version.cmake)
-set(AMD_COMGR_PACKAGE_PREFIX lib/cmake/amd_comgr)
+set(AMD_COMGR_PACKAGE_PREFIX ${CMAKE_INSTALL_LIBDIR}/cmake/amd_comgr)

 # Generate the build-tree package.
 set(AMD_COMGR_PREFIX_CODE)
@@ -256,11 +256,6 @@ install(FILES
 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 @@ if (NOT COMGR_BUILD_SHARED_LIBS)
   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)


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.4.0-109-generic (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages libamd-comgr-dev depends on:
ii  libamd-comgr2  5.1.0-1

libamd-comgr-dev recommends no packages.

libamd-comgr-dev suggests no packages.

-- no debconf information


Reply to: