Bug#1108159: libamdhip64-dev: CMakeDetermineHIPCompiler.cmake unable to find HIP runtime CMake package
Package: libamdhip64-dev
Version: 5.7.1-6
Severity: normal
X-Debbugs-Cc: spaarshthakkar11010@gmail.com, cgmb@slerp.xyz, debian-ai@lists.debian.org
Dear Maintainer,
I am trying to enable ROCm in dbcsr[1] and one of the dependencies is libamdhip64-dev since it contains the hip-config.cmake file. When I try to build my package, it fails with the following error message:
```
-- The HIP compiler identification is unknown
CMake Error at /usr/share/cmake-3.31/Modules/CMakeDetermineHIPCompiler.cmake:217 (message):
The ROCm root directory:
/usr
does not contain the HIP runtime CMake package, expected at one of:
/usr/lib/cmake/hip-lang/hip-lang-config.cmake
/usr/lib64/cmake/hip-lang/hip-lang-config.cmake
Call Stack (most recent call first):
CMakeLists.txt:277 (enable_language)
```
The issue is that debian stores the hip-config.cmake file at `/usr/lib/x86_64-linux-gnu/cmake/hip/hip-config.cmake`.
It does not work even if I try to pass the location of the file explicitly via `CMAKE_HIP_COMPILER_ROCM_LIB` flag during building the package, due to the hardcoded logic in `CMakeDetermineHIPCompiler.cmake`, it appends the `CMAKE_HIP_COMPILER_ROCM_LIB` variable with `/lib/cmake` or `/lib64/cmake`:
```
set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS
"${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib"
"${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib64"
)
```
I am not entirely sure if this is a `libamdhip64-dev` bug or something related to `CMake`.
My dbcsr fork can be found here[2] and I am using a docker container.
Additional Information:
CMake version: 3.31.6
Regards,
Spaarsh
[1]: https://salsa.debian.org/debichem-team/dbcsr/
[2]: https://salsa.debian.org/Spaarsh/dbcsr/
Note: This is a docker container.
-- System Information:
Debian Release: trixie/sid
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-37-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Versions of packages libamdhip64-dev depends on:
ii libamd-comgr-dev 6.0+git20231212.4510c28+dfsg-3+b2
ii libamdhip64-5 5.7.1-6
ii libhiprtc-builtins5 5.7.1-6
ii libhsa-runtime-dev 6.1.2-3
libamdhip64-dev recommends no packages.
Versions of packages libamdhip64-dev suggests:
pn hipcc <none>
pn libamdhip64-doc <none>
-- no debconf information
Reply to: