Skip to content

HIP: Convert clang output to cmake style paths

Mészáros Gergely requested to merge Maetveis/cmake:hip_use_cmake_path into master

On windows the location of the rocm root directory as reported by clang might be in windows style (with backslashes) which breaks the cache.

Before this change cmake produces this error, if it infers the rocm dir from clang on windows:

-- The HIP compiler identification is Clang 15.0.0 with GNU-like command-line
CMake Warning (dev) at build/CMakeFiles/3.24.0/CMakeHIPCompiler.cmake:20 (set):
  Syntax error in cmake code at

    C:/Users/mesza/Desktop/Develpment/test/build/CMakeFiles/3.24.0/CMakeHIPCompiler.cmake:20

  when parsing string

    C:\Program Files\AMD\ROCm\1.2

  Invalid escape sequence \P

  Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
  "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Detecting HIP compiler ABI info
CMake Error at C:/Users/mesza/Desktop/Develpment/test/build/CMakeFiles/3.24.0/CMakeHIPCompiler.cmake:20 (set):
  Syntax error in cmake code at

    C:/Users/mesza/Desktop/Develpment/test/build/CMakeFiles/3.24.0/CMakeHIPCompiler.cmake:20

  when parsing string

    C:\Program Files\AMD\ROCm\1.2

  Invalid character escape '\P'.
Call Stack (most recent call first):
  C:/Users/mesza/Desktop/Develpment/test/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)


CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
  Failed to configure test project build system.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeTestHIPCompiler.cmake:29 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:1 (project)


-- Configuring incomplete, errors occurred!
See also "C:/Users/mesza/Desktop/Develpment/test/build/CMakeFiles/CMakeOutput.log".
Edited by Mészáros Gergely

Merge request reports