You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm following the instructions at https://github.com/ROCm/HIPIFY/blob/amd-staging/docs/building/building-hipify.rst, swapping -G "Visual Studio 17 2022" for -G Ninja. I regularly use Ninja for other projects with MSVC on Windows, including LLVM, without issues (it's a much nicer experience than the Visual Studio generator IME).
The build fails due to compilation commands passing MSVC flags to the clang++ compiler after this code changes the value of CMAKE_CXX_COMPILER from (for example) C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe to clang++:
I'm not sure if there is something mandatory about using the compiler from LLVM_TOOLS_BINARY_DIR though. I would suspect that any build toolchain could be used, so long as the linking step against clang/LLVM libraries succeeds.
We're starting to build many ROCm projects as part of https://github.com/nod-ai/TheRock. Other projects so far have been compatible with Ninja.
I see these solutions for TheRock:
Try switching to the Visual Studio generator (perhaps for only some subprojects like HIPIFY)
Problem Description
Using the Ninja CMake generator (https://ninja-build.org/), HIPIFY fails to build with MSVC.
I'm following the instructions at https://github.com/ROCm/HIPIFY/blob/amd-staging/docs/building/building-hipify.rst, swapping
-G "Visual Studio 17 2022"for-G Ninja. I regularly use Ninja for other projects with MSVC on Windows, including LLVM, without issues (it's a much nicer experience than the Visual Studio generator IME).The build fails due to compilation commands passing MSVC flags to the
clang++compiler after this code changes the value ofCMAKE_CXX_COMPILERfrom (for example)C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exetoclang++:HIPIFY/CMakeLists.txt
Lines 90 to 93 in f601f96
Sample error logs:
Full error logs: https://gist.github.com/ScottTodd/10cca27eba121216129b2111f2e316b1
Operating System
Windows 11 (10.0.22631)
CPU
AMD Ryzen Threadripper PRO 7975WX 32-Cores
ROCm Version
ROCm 6.3.1
ROCm Component
HIPIFY
Steps to Reproduce
Build clang from LLVM source:
Build HIPIFY:
See errors: https://gist.github.com/ScottTodd/10cca27eba121216129b2111f2e316b1
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
Building using the Visual Studio generator does work successfully. Swap step 2 in my reproducer with
https://gist.github.com/ScottTodd/a29c712370fa7b83fd64931675be8965
Changing this code to keep the existing
CMAKE_CXX_COMPILERfixes the build for me:HIPIFY/CMakeLists.txt
Lines 90 to 93 in f601f96
I'm not sure if there is something mandatory about using the compiler from
LLVM_TOOLS_BINARY_DIRthough. I would suspect that any build toolchain could be used, so long as the linking step against clang/LLVM libraries succeeds.We're starting to build many ROCm projects as part of https://github.com/nod-ai/TheRock. Other projects so far have been compatible with Ninja.
I see these solutions for TheRock: