ROCm / clr

MIT License
85 stars 35 forks source link

[Issue]: hip-config-amd.cmake choked when there is no CXX compiler #48

Closed ye-luo closed 5 months ago

ye-luo commented 5 months ago

Problem Description

My application only use C and Fortran compiler + HIP as a CMake language.

CMake Error at /opt/rocm-6.0.0/lib/cmake/hip/hip-config-amd.cmake:121 (if):
  if given arguments:

    "STREQUAL" "Clang"

  Unknown arguments specified
Call Stack (most recent call first):
  /opt/rocm-6.0.0/lib/cmake/hip/hip-config.cmake:149 (include)
  CMakeLists.txt:3 (find_package)

due to non existing CMAKE_CXX_COMPILER_ID https://github.com/ROCm/clr/blob/74edd40d26b049d7e9fd39faade8a6a83915f6df/hipamd/hip-config-amd.cmake#L149C6-L149C27

Operating System

Any Linux

CPU

Any CPU

GPU

AMD Instinct MI250X

ROCm Version

ROCm 6.0.0

ROCm Component

clr

Steps to Reproduce

CMakeLists.txt

cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
project(qe LANGUAGES Fortran C HIP)
find_package(hip CONFIG)
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=gfortran .

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

iassiour commented 5 months ago

Thank you @ye-luo for reporting. I will create an internal PR with the fix.

iassiour commented 5 months ago

The issue has been fixed here: https://github.com/ROCm/clr/commit/b60926a03e0379add5009d0c01260e97557fc895