Bug#1125754: clang-21: ROCM_PATH envvar excludes resource directory from device libs search path
Cordell Bloor
cgmb at debian.org
Fri Jan 16 22:50:07 GMT 2026
Package: clang-21
Version: 1:21.1.8-1+b1
Severity: normal
X-Debbugs-Cc: cgmb at debian.org, tflink at tirfa.com, debian-ai at lists.debian.org
Dear Maintainer,
clang-21 does not consider the LLVM 21 resource directory for the ROCm
device libs when ROCM_PATH is defined in the environment, unlike older
versions of LLVM (e.g., clang-17).
Various build systems will search for ROCm and then explicitly set the
ROCM_PATH during their build, which causes their builds to fail even if
the ROCM_PATH is correctly set.
To reproduce this problem consider:
apt install -y hipcc clang-21 rocm-device-libs-21
cat > main.hip << END
int main() { return 0; }
END
clang++-21 main.hip -lamdhip64 -o main # SUCCESS
ROCM_PATH=/usr clang++-21 main.hip -lamdhip64 -o main # FAIL
The failing output (with -v added) is:
Debian clang version 21.1.8 (1+b1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-21/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/15
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/15
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found HIP installation: /usr, version 6.4.43484
clang++-21: error: cannot find ROCm device library; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
To resolve this problem, the LLVM resource directory should always be
considered when searching for the ROCm device libraries.
Sincerely,
Cory Bloor
-- System Information:
Debian Release: forky/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.17.13+deb13-amd64 (SMP w/12 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 clang-21 depends on:
ii binutils 2.45.50.20251209-1
ii libc6 2.42-7
ii libc6-dev 2.42-7
ii libclang-common-21-dev 1:21.1.8-1+b1
ii libclang-cpp21 1:21.1.8-1+b1
ii libclang1-21 1:21.1.8-1+b1
ii libgcc-15-dev 15.2.0-12
ii libgcc-s1 15.2.0-12
ii libllvm21 1:21.1.8-1+b1
ii libobjc-15-dev 15.2.0-12
ii libstdc++-15-dev 15.2.0-12
ii libstdc++6 15.2.0-12
ii llvm-21-linker-tools 1:21.1.8-1+b1
Versions of packages clang-21 recommends:
ii clang-tools-21 1:21.1.8-1+b1
pn llvm-21-dev <none>
ii python3 3.13.9-3
Versions of packages clang-21 suggests:
pn clang-21-doc <none>
pn wasi-libc <none>
-- no debconf information
More information about the Pkg-llvm-team
mailing list