Skip to content

Commit

Permalink
Add ROCMClang as an LLVM compiler to cmake (#2184)
Browse files Browse the repository at this point in the history
* Add ROCMClang as an LLVM compiler to cmake

Since CMake >= 3.21, ROCm is identified as ROCMClang.

* HIP: Fix legacy CI / hipcc

Until we get ROCM 4.4, we need to work around this new detection:
https://gitlab.kitware.com/cmake/cmake/-/blob/v3.21.0/Modules/CMakeDetermineCompilerId.cmake#L153-159

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
  • Loading branch information
WeiqunZhang and ax3l authored Jul 21, 2021
1 parent 948bd72 commit 91fa2b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
-DAMReX_AMD_ARCH=gfx908 \
-DCMAKE_C_COMPILER=$(which clang) \
-DCMAKE_CXX_COMPILER=$(which hipcc) \
-DCMAKE_CXX_COMPILER_ID="Clang" \
-DCMAKE_CXX_COMPILER_VERSION=12.0 \
-DCMAKE_CXX_STANDARD_COMPUTED_DEFAULT="17" \
-DCMAKE_Fortran_COMPILER=$(which gfortran) \
-DCMAKE_CXX_STANDARD=17
cmake --build build_full_legacywrapper -j 2
Expand Down
1 change: 1 addition & 0 deletions Tools/CMake/AMReXGenerateConfigHeader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function ( generate_config_header )
set(COMPILER_ID_MACRO __PGI)
elseif ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) OR
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" ) OR
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "ROCMClang" ) OR
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM" ) )
set(COMPILER_ID_MACRO __llvm__)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" )
Expand Down

0 comments on commit 91fa2b7

Please sign in to comment.