ROCm / clr

MIT License
89 stars 46 forks source link

[Issue]: warning clangrt builtins lib not found when CXX doesn't exist #54

Closed ye-luo closed 8 months ago

ye-luo commented 8 months ago

Problem Description

Got warning

-- The Fortran compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- The HIP compiler identification is Clang 17.0.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting HIP compiler ABI info
-- Detecting HIP compiler ABI info - done
-- Check for working HIP compiler: /opt/rocm-6.0.0/llvm/bin/clang++ - skipped
-- Detecting HIP compile features
-- Detecting HIP compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
CMake Warning (dev) at /opt/rocm-6.0.0/lib/cmake/hip/hip-config-amd.cmake:156 (message):
  clangrt builtins lib not found: No such file or directory
Call Stack (most recent call first):
  /opt/rocm-6.0.0/lib/cmake/hip/hip-config.cmake:149 (include)
  CMakeLists.txt:3 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/yeluo/opt/cmake_gpu/test_rocm_nocxx

There is another reference to CXX generating warnings to project without using CXX. https://github.com/ROCm/clr/blob/2adcc33bedfba3123b86d3cd7d769d86d342b0e2/hipamd/hip-config-amd.cmake#L62 It seems that

-- Check for working HIP compiler: /opt/rocm-6.0.0/llvm/bin/clang++ - skipped

The HIP compiler has been found above, I don't get why looking for HIP_CXX_COMPILER compiler via CMAKE_CXX_COMPILER. I would expect no warning.

Operating System

Any linux

CPU

Any CPU

GPU

AMD Instinct MI250

ROCm Version

ROCm 6.0.0

ROCm Component

clr

Steps to Reproduce

CMakeLists.txt

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(qe LANGUAGES Fortran C HIP)
find_package(hip CONFIG)

command:

cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=gfortran .

Need patch first if testing with rocm 6.0.0 release

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

No response

Additional Information

No response

iassiour commented 8 months ago

I think this is fixed by this older commit https://github.com/ROCm/clr/commit/515d07cb3ab7b2f206cfded0c7f288e01a0282f1 that is not yet into release. Could you please confirm.

ye-luo commented 8 months ago

Seems good after 515d07c patch