Bug#1035835: libamdhip64-dev: find_package(hip) fails if CXX language is not enabled
Package: libamdhip64-dev
Version: 5.2.3-8
Severity: normal
X-Debbugs-Cc: cgmb@slerp.xyz
Dear Maintainer,
The libamdhip64-dev package requires the CXX language to be enabled in
order for find_package(hip) to succeed. This is because there is an
unquoted check against the CXX compiler within hip-config.cmake. The
variable for the compiler should be quoted to compare against an empty
string in the case that the compiler variable is undefined (rather than
causing a syntax error).
What was done:
apt-get -y update
apt-get -y install build-essential cmake libamdhip64-dev hipcc
cat << 'EOF' > main.c
#include <hip/hip_runtime_api.h>
int main() {
return 0;
}
EOF
cat << 'EOF' > CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(example LANGUAGES C)
find_package(hip REQUIRED)
add_executable(example main.c)
target_link_libraries(example PRIVATE hip::host)
EOF
cmake -S. -Bbuild
What was seen:
# cmake -S. -Bbuild
-- The C compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- hip::amdhip64 is SHARED_LIBRARY
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/hip/hip-config.cmake:290 (if):
if given arguments:
"STREQUAL" "Clang"
Unknown arguments specified
Call Stack (most recent call first):
CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
See also "/root/build/CMakeFiles/CMakeOutput.log".
-- System Information:
Debian Release: 12.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-8-amd64 (SMP w/32 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 5.2.3-2
ii libamdhip64-5 5.2.3-8
ii libhiprtc-builtins5 5.2.3-8
ii libhsa-runtime-dev 5.2.3-3
libamdhip64-dev recommends no packages.
libamdhip64-dev suggests no packages.
-- no debconf information
Reply to: