Skip to content

Installation issue: hipify-clang failure with external llvm-amdgpu #3777

@G-Ragghianti

Description

@G-Ragghianti

Steps to reproduce the issue

When the rocm distribution of llvm (llvm-amdgpu) is installed on the system, it is automatically picked up as a spack compiler. Then it is automatically used as an external dependency when building anything with that version of hip/rocm. The hipify-clang package fails to build against this external llvm-amdgpu due to a cmake error in finding ClangConfig.cmake (even if the file is installed). This causes failure to build hip and any packages that depend on hip. This is a significant problem because it is difficult to prevent spack from finding the external llvm-amdgpu and configuring it as a compiler.

Here is a docker reproducer:

FROM rockylinux:9

RUN dnf -y group install development
RUN dnf -y install git gfortran dnf-plugins-core && \
    dnf config-manager --add-repo https://repo.radeon.com/amdgpu/7.0.2/rhel/9.4/main/x86_64/ && \
    dnf config-manager --add-repo https://repo.radeon.com/rocm/rhel9/7.0.2/main/ && \
    dnf -y --enablerepo=crb install --nogpgcheck amdgpu-dkms rocm rocm-llvm-devel

RUN git clone https://github.com/spack/spack /tmp/spack
RUN source /tmp/spack/share/spack/setup-env.sh && \
   spack env activate --temp && \
   spack add hipify-clang@7.0.2 && \
   spack install -j8 -p4 --fail-fast

Error message

Error message
1 error found in build log:
     14    -- Detecting CXX compile features - done
     15    -- HIPIFY config:
     16    --    - Build hipify-clang    : ON
     17    --    - Test hipify-clang     : OFF
     18    --    - Is part of HIP SDK    : OFF
     19    --    - Install clang headers : ON
  >> 20    CMake Error at CMakeLists.txt:41 (find_package):
     21      Could not find a package configuration file provided by "Clang" wi
           th any of
     22      the following names:
     23    
     24        ClangConfig.cmake
     25        clang-config.cmake
     26    

See build log for details:
  /tmp/jenkins/spack-stage/spack-stage-hipify-clang-6.4.3-nmnplbiszrwpobw7koemz6fvqxp5yazr/spack-build-out.txt

==> Warning: Skipping build of hip-6.4.3-akmuic6ezitgipc7k63ra7zjaqtv6dwu since hipify-clang-6.4.3-nmnplbiszrwpobw7koemz6fvqxp5yazr failed

Information on your system

Additional information

@afzpatel
@renjithravindrankannath
@srekolam

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions